@goodgamestudios/cxf-announcements
Advanced tools
Comparing version 0.6.0-qa.9 to 0.6.0-qa.10
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="0.6.0-qa.10"></a> | ||
# [0.6.0-qa.10](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.6.0-qa.9...v0.6.0-qa.10) (2019-10-21) | ||
<a name="0.6.0-qa.9"></a> | ||
@@ -7,0 +12,0 @@ # [0.6.0-qa.9](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.6.0-qa.8...v0.6.0-qa.9) (2019-10-21) |
@@ -30,3 +30,3 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"OUZ9":[function(require,module,exports) { | ||
},{"./utils":"FO+Z"}],"hRFt":[function(require,module,exports) { | ||
"use strict";var e=a(require("@babel/runtime/regenerator")),n=a(require("@babel/runtime/helpers/slicedToArray")),t=a(require("@babel/runtime/helpers/asyncToGenerator"));function a(e){return e&&e.__esModule?e:{default:e}}require("url-search-params-polyfill");var r=require("./utils"),o=r.appendLoginParams,s=require("./window-handlers"),i=function(e,n,t,a){var r=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(r,".lastMessageHash")},l=new Map([["bigfarm","bf"],["empirefourkingdoms","e4k"],["empire","em"]]),c=function(e,n,t){var a=n.game,r=n.appendHtmlTagFor;return function(n,o){var s=o.network,l=o.instance,c=o.lang,u=o.playername;if(n.message&&n.message[c]){var g=n.announcementStartDate,m=n.announcementEndDate;if(!g||g<=t&&m>=t)if(m&&m<t)console.warn("ignoring message since its expired already");else{var d=i(a,u,s,l),f=n.message_hash;if(f!==localStorage.getItem(d)){var h=JSON.stringify({key:d,currentMessageHash:f}),p=new URLSearchParams({game:a,lang:c,network:s,instance:l,hash:h}),w="".concat(e).concat(a,"_announcement.html?").concat(p.toString()),v=r(w);return console.log("shown message ",v),v}console.warn("ignoring message since it was already displayed once. to re-enable it, please delete ggs.cxf.announcements local storage")}else console.warn("ignoring message since start and end times are not valid")}else console.warn("ignoring message since there is no translation for the current language: ",c)}};function u(e,n,t){return g.apply(this,arguments)}function g(){return(g=(0,t.default)(e.default.mark(function n(t,a,r){return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=o(t,r),e.abrupt("return",fetch(t).then(function(e){return e.json()}).then(function(e){console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"),console.log(e),console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"),e.message&&0!==Object.keys(e.message).length&&(console.log("Loaded and found a message for this lang | channel(network+instance)"),a(e,r))}).catch(function(e){return console.log("failed loading ".concat(t,": ").concat(e))}));case 2:case"end":return e.stop()}},n,this)}))).apply(this,arguments)}module.exports=function(e,t){var a=c("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/test/announcements/templates/",e,Date.now()),r=l.get(e.game);return{initAnnouncements:function(o){Object.assign(o,t.getPlayerInfo(o.userdata));var i=function(){!function(e){u("https://7vjlctgjad.execute-api.eu-west-1.amazonaws.com/dev/messages/"+r,a,e)}(o),s()};if(o.level>t.lastTutorialLevel)return i();var l,c,g;console.warn(" still during tutorial, need to wait until tutorial finishes"),e.off(t.levelUpCmd,module.exports.placeholder),e.on(t.levelUpCmd,(c=(l=t).getLevel,g=l.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=c(t),r=g+1;console.log("NEW LEVEL ",a," minimum required is ",r),a>r||(a!==r?console.warn(" still during tutorial, need to wait until tutorial finishes"):i())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:u,handleAnnouncementMessage:c,getHashKey:i}; | ||
"use strict";var e=a(require("@babel/runtime/regenerator")),n=a(require("@babel/runtime/helpers/slicedToArray")),t=a(require("@babel/runtime/helpers/asyncToGenerator"));function a(e){return e&&e.__esModule?e:{default:e}}require("url-search-params-polyfill");var r=require("./utils"),o=r.appendLoginParams,s=require("./window-handlers"),i=function(e,n,t,a){var r=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(r,".lastMessageHash")},l=new Map([["bigfarm","bf"],["empirefourkingdoms","e4k"],["empire","em"],["testgame","testgame"]]),u=function(e,n){var t=n.game,a=n.appendHtmlTagFor;return function(n,r){var o=r.network,s=r.instance,l=r.lang,u=r.playername;if(0!==Object.keys(n).length&&0!==n.Count){var c=i(t,u,o,s),g=n.message_hash||"";if(g!==localStorage.getItem(c)){var m=JSON.stringify({key:c,currentMessageHash:g}),f=new URLSearchParams({game:t,lang:l,network:o,instance:s,hash:m}),d="".concat(e).concat(t,"_announcement.html?").concat(f.toString()),h=a(d);return console.log("shown message ",h),h}console.warn("ignoring message since it was already displayed once. to re-enable it, please delete ggs.cxf.announcements local storage")}}};function c(e,n,t){return g.apply(this,arguments)}function g(){return(g=(0,t.default)(e.default.mark(function n(t,a,r){return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=o(t,r),e.abrupt("return",fetch(t).then(function(e){return e.json()}).then(function(e){0!==Object.keys(e).length&&0!==e.Count&&(console.log("Loaded and found a message for this lang | channel(network+instance)"),a(e,r))}).catch(function(e){return console.log("failed loading ".concat(t,": ").concat(e))}));case 2:case"end":return e.stop()}},n,this)}))).apply(this,arguments)}module.exports=function(e,t){var a=u("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/test/announcements/templates/",e),r=l.get(e.game);return{initAnnouncements:function(o){Object.assign(o,t.getPlayerInfo(o.userdata));var i=function(){!function(e){c("https://7vjlctgjad.execute-api.eu-west-1.amazonaws.com/dev/messages/"+r,a,e)}(o),s()};if(o.level>t.lastTutorialLevel)return i();var l,u,g;console.warn(" still during tutorial, need to wait until tutorial finishes"),e.off(t.levelUpCmd,module.exports.placeholder),e.on(t.levelUpCmd,(u=(l=t).getLevel,g=l.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=u(t),r=g+1;console.log("NEW LEVEL ",a," minimum required is ",r),a>r||(a!==r?console.warn(" still during tutorial, need to wait until tutorial finishes"):i())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:c,handleAnnouncementMessage:u,getHashKey:i}; | ||
},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/slicedToArray":"69HE","@babel/runtime/helpers/asyncToGenerator":"agGE","url-search-params-polyfill":"L8PX","./utils":"FO+Z","./window-handlers":"T61a"}],"+uO6":[function(require,module,exports) { | ||
@@ -33,0 +33,0 @@ "use strict";var e=n(require("@babel/runtime/helpers/slicedToArray"));function n(e){return e&&e.__esModule?e:{default:e}}function a(n){console.log("announcements initialized successfully - waiting for player login",n.game);var a="empire"===n.game?require("./game-adapters/empire"):require("./game-adapters/bigfarm"),r=require("./announcements-private")(n,a),i=function(a){var i=(0,e.default)(a,4),o=i[0],l=i[1],t=i[2],u=i[3];r.initAnnouncements({userdata:o,lang:l,network:t,instance:u,game:n.game})};n.once(a.loginCmd,i),n.once(a.levelUpCmd,r.placeholder),n.once(3,i),n.once(24,r.placeholder)}a(window.CXF); |
{ | ||
"name": "@goodgamestudios/cxf-announcements", | ||
"version": "0.6.0-qa.9", | ||
"version": "0.6.0-qa.10", | ||
"main": "dist/announcements.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
6
335596
218