@goodgamestudios/cxf-announcements
Advanced tools
Comparing version 0.6.0-qa.23 to 0.6.0-qa.24
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="0.6.0-qa.24"></a> | ||
# [0.6.0-qa.24](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.6.0-qa.23...v0.6.0-qa.24) (2019-10-22) | ||
<a name="0.6.0-qa.23"></a> | ||
@@ -7,0 +12,0 @@ # [0.6.0-qa.23](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.6.0-qa.22...v0.6.0-qa.23) (2019-10-22) |
@@ -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 o=require("./utils"),r=o.appendLoginParams,s=require("./window-handlers"),l=function(e,n,t,a){var o=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(o,".lastMessageHash")},i=function(e){return e.split("").reduce(function(e,n){return(e<<5)-e+n.charCodeAt(0)|0},0)},u=function(e,n){var t=n.game,a=n.appendHtmlTagFor;return function(n,o){var r=o.network,s=o.instance,u=o.lang,c=o.playername,g=l(t,c,r,s),m=n.Items[0],d=m.title,f=m.message,h=i(d+f),p=localStorage.getItem(g);if(console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"),console.log("old hash: "+p),console.log("current hash"+h),console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"),h!==p){var w=JSON.stringify({key:g,currentMessageHash:h}),v=new URLSearchParams({game:t,lang:u,network:r,instance:s,hash:w}),y="".concat(e).concat(t,"_announcement.html?").concat(v.toString()),b=a(y);return console.log("shown message ",b),b}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,o){return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r(t,o),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,o))}).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=new Map([["bigfarm","bf"],["empire","em"],["empirefourkingdoms","e4k"],["test-game","test-game"]]),o=u("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/test/announcements/templates/",e),r=a.get(e.game)||"";return{initAnnouncements:function(a){Object.assign(a,t.getPlayerInfo(a.userdata));var l=function(){!function(e){c("https://7vjlctgjad.execute-api.eu-west-1.amazonaws.com/dev/messages/"+r,o,e)}(a),s()};if(a.level>t.lastTutorialLevel)return l();var i,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=(i=t).getLevel,g=i.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=u(t),o=g+1;console.log("NEW LEVEL ",a," minimum required is ",o),a>o||(a!==o?console.warn(" still during tutorial, need to wait until tutorial finishes"):l())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:c,handleAnnouncementMessage:u,getHashKey:l}; | ||
"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 o=require("./utils"),r=o.appendLoginParams,s=require("./window-handlers"),l=function(e,n,t,a){var o=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(o,".lastMessageHash")},i=function(e){return e.split("").reduce(function(e,n){return(e<<5)-e+n.charCodeAt(0)|0},0)},u=function(e,n){var t=n.game,a=n.appendHtmlTagFor;return function(n,o){var r=o.network,s=o.instance,u=o.lang,c=o.playername,g=l(t,c,r,s),m=n.Items[0],d=m.title,f=m.message,h=i(d+f),p=localStorage.getItem(g);if(console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"),console.log("old hash: "+p),console.log("current hash"+h),console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"),!h||!p||h.toString()!==p.toString()){var w=JSON.stringify({key:g,currentMessageHash:h}),v=new URLSearchParams({game:t,lang:u,network:r,instance:s,hash:w}),y="".concat(e).concat(t,"_announcement.html?").concat(v.toString()),b=a(y);return console.log("shown message ",b),b}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,o){return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r(t,o),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,o))}).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=new Map([["bigfarm","bf"],["empire","em"],["empirefourkingdoms","e4k"],["test-game","test-game"]]),o=u("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/test/announcements/templates/",e),r=a.get(e.game)||"";return{initAnnouncements:function(a){Object.assign(a,t.getPlayerInfo(a.userdata));var l=function(){!function(e){c("https://7vjlctgjad.execute-api.eu-west-1.amazonaws.com/dev/messages/"+r,o,e)}(a),s()};if(a.level>t.lastTutorialLevel)return l();var i,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=(i=t).getLevel,g=i.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=u(t),o=g+1;console.log("NEW LEVEL ",a," minimum required is ",o),a>o||(a!==o?console.warn(" still during tutorial, need to wait until tutorial finishes"):l())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:c,handleAnnouncementMessage:u,getHashKey:l}; | ||
},{"@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.23", | ||
"version": "0.6.0-qa.24", | ||
"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
340116