Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@goodgamestudios/cxf-announcements

Package Overview
Dependencies
Maintainers
19
Versions
339
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goodgamestudios/cxf-announcements - npm Package Compare versions

Comparing version 0.6.0-qa.12 to 0.6.0-qa.13

dist/templates/announcement.50e46201.js

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Change Log

<a name="0.6.0-qa.13"></a>
# [0.6.0-qa.13](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.6.0-qa.12...v0.6.0-qa.13) (2019-10-21)
<a name="0.6.0-qa.12"></a>

@@ -7,0 +12,0 @@ # [0.6.0-qa.12](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.6.0-qa.11...v0.6.0-qa.12) (2019-10-21)

2

dist/announcements.js

@@ -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"],["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};
"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,t){var a=n.game,r=n.appendHtmlTagFor;return function(n,s){var o=s.network,l=s.instance,c=s.lang,u=s.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,o,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:o,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 c(e,n,t){return u.apply(this,arguments)}function u(){return(u=(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){var a=l("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/test/announcements/templates/",e,Date.now());return{initAnnouncements:function(r){Object.assign(r,t.getPlayerInfo(r.userdata));var s=function(){!function(n){c("https://7vjlctgjad.execute-api.eu-west-1.amazonaws.com/dev/messages/"+e.game,a,n)}(r),o()};if(r.level>t.lastTutorialLevel)return s();var i,l,u;console.warn(" still during tutorial, need to wait until tutorial finishes"),e.off(t.levelUpCmd,module.exports.placeholder),e.on(t.levelUpCmd,(l=(i=t).getLevel,u=i.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=l(t),r=u+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"):s())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:c,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) {

@@ -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.12",
"version": "0.6.0-qa.13",
"main": "dist/announcements.js",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc