@goodgamestudios/cxf-announcements
Advanced tools
Comparing version 0.1.1-dev.0 to 0.1.1-qa.0
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="0.1.1-qa.0"></a> | ||
## [0.1.1-qa.0](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.1.1-dev.0...v0.1.1-qa.0) (2018-12-10) | ||
<a name="0.1.1-dev.0"></a> | ||
@@ -7,0 +12,0 @@ ## [0.1.1-dev.0](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v1.1.0-dev.4...v0.1.1-dev.0) (2018-12-10) |
@@ -32,3 +32,3 @@ parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r},p.cache={};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({"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"),s=r.appendLoginParams,o=require("./window-handlers"),l=function(e,n,t,a){var r=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(r,".lastMessageHash")},i=function(e,n){var t=n.game,a=n.appendHtmlTagFor;return function(n,r){var s=r.network,o=r.instance,i=r.lang,u=r.playername;if(n.message&&n.message[i]){var c=l(t,u,s,o),g=n.message_hash;if(g!==localStorage.getItem(c)){var d=JSON.stringify({key:c,currentMessageHash:g}),f=new URLSearchParams({game:t,lang:i,network:s,instance:o,hash:d}),m="".concat(e).concat(t,"_announcement.html?").concat(f.toString()),h=a(m);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")}else console.warn("ignoring message since there is no translation for the current language: ",i)}};function u(e,n,t){return c.apply(this,arguments)}function c(){return(c=(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=s(t,r),e.abrupt("return",fetch(t).then(function(e){return e.json()}).then(function(e){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,a){var r=i("https://unpkg.com/@goodgamestudios/announcements@dev/dist/",e);return{initAnnouncements:function(s){Object.assign(s,t.getPlayerInfo(s.userdata));var l=function(){!function(n){u("https://jsffll6u27.execute-api.eu-west-1.amazonaws.com/dev/messages/"+e.game,r,n)}(s),a.subscribe(r,s),o()};if(s.level>t.lastTutorialLevel)return l();var i,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=(i=t).getLevel,g=i.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"):l())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:u,handleAnnouncementMessage:i,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 r=require("./utils"),s=r.appendLoginParams,o=require("./window-handlers"),i=function(e,n,t,a){var r=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(r,".lastMessageHash")},l=function(e,n){var t=n.game,a=n.appendHtmlTagFor;return function(n,r){var s=r.network,o=r.instance,l=r.lang,u=r.playername;if(n.message&&n.message[l]){var c=i(t,u,s,o),g=n.message_hash;if(g!==localStorage.getItem(c)){var m=JSON.stringify({key:c,currentMessageHash:g}),d=new URLSearchParams({game:t,lang:l,network:s,instance:o,hash:m}),f="".concat(e).concat(t,"_announcement.html?").concat(d.toString()),h=a(f);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")}else console.warn("ignoring message since there is no translation for the current language: ",l)}};function u(e,n,t){return c.apply(this,arguments)}function c(){return(c=(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=s(t,r),e.abrupt("return",fetch(t).then(function(e){return e.json()}).then(function(e){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,a){var r=l("https://unpkg.com/@goodgamestudios/announcements@production/dist-templates/",e);return{initAnnouncements:function(s){Object.assign(s,t.getPlayerInfo(s.userdata));var i=function(){!function(n){u("https://evf0700w70.execute-api.eu-west-1.amazonaws.com/test/messages/"+e.game,r,n)}(s),a.subscribe(r,s),o()};if(s.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:l,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) { | ||
@@ -35,0 +35,0 @@ "use strict";var e=n(require("@babel/runtime/helpers/slicedToArray"));function n(e){return e&&e.__esModule?e:{default:e}}function r(n){console.log("announcements initialized successfully - waiting for player login",n.game);var r=require("./pubnubsubscriber")(n.pubnub),a="empire"===n.game?require("./game-adapters/empire"):require("./game-adapters/bigfarm"),i=require("./announcements-private")(n,a,r),u=function(r){var a=(0,e.default)(r,4),u=a[0],o=a[1],l=a[2],t=a[3];i.initAnnouncements({userdata:u,lang:o,network:l,instance:t,game:n.game})};n.once(a.loginCmd,u),n.once(a.levelUpCmd,i.placeholder),n.once(3,u),n.once(24,i.placeholder)}r(window.CXF); |
{ | ||
"name": "@goodgamestudios/cxf-announcements", | ||
"version": "0.1.1-dev.0", | ||
"version": "0.1.1-qa.0", | ||
"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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3
1
3
92465
5
91