This repository has been archived by the owner on Jun 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gameservice-sdk.js.map
1 lines (1 loc) · 257 KB
/
gameservice-sdk.js.map
1
{"version":3,"sources":["webpack://gameservice-sdk/webpack/universalModuleDefinition","webpack://gameservice-sdk/./node_modules/axios/index.js","webpack://gameservice-sdk/./node_modules/axios/lib/adapters/xhr.js","webpack://gameservice-sdk/./node_modules/axios/lib/axios.js","webpack://gameservice-sdk/./node_modules/axios/lib/cancel/Cancel.js","webpack://gameservice-sdk/./node_modules/axios/lib/cancel/CancelToken.js","webpack://gameservice-sdk/./node_modules/axios/lib/cancel/isCancel.js","webpack://gameservice-sdk/./node_modules/axios/lib/core/Axios.js","webpack://gameservice-sdk/./node_modules/axios/lib/core/InterceptorManager.js","webpack://gameservice-sdk/./node_modules/axios/lib/core/buildFullPath.js","webpack://gameservice-sdk/./node_modules/axios/lib/core/createError.js","webpack://gameservice-sdk/./node_modules/axios/lib/core/dispatchRequest.js","webpack://gameservice-sdk/./node_modules/axios/lib/core/enhanceError.js","webpack://gameservice-sdk/./node_modules/axios/lib/core/mergeConfig.js","webpack://gameservice-sdk/./node_modules/axios/lib/core/settle.js","webpack://gameservice-sdk/./node_modules/axios/lib/core/transformData.js","webpack://gameservice-sdk/./node_modules/axios/lib/defaults.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/bind.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/buildURL.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/combineURLs.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/cookies.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/isAxiosError.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://gameservice-sdk/./node_modules/axios/lib/helpers/spread.js","webpack://gameservice-sdk/./node_modules/axios/lib/utils.js","webpack://gameservice-sdk/./src/GameService/Achievements/index.ts","webpack://gameservice-sdk/./src/GameService/Assets/index.ts","webpack://gameservice-sdk/./src/GameService/Authentication/index.ts","webpack://gameservice-sdk/./src/GameService/GSLive/Chats/index.ts","webpack://gameservice-sdk/./src/GameService/GSLive/Chats/models.ts","webpack://gameservice-sdk/./src/GameService/GSLive/Controllers/Command/index.ts","webpack://gameservice-sdk/./src/GameService/GSLive/Controllers/Command/models.ts","webpack://gameservice-sdk/./src/GameService/GSLive/Controllers/RealTime/index.ts","webpack://gameservice-sdk/./src/GameService/GSLive/Controllers/RealTime/models.ts","webpack://gameservice-sdk/./src/GameService/GSLive/Controllers/ُTurnBased/index.ts","webpack://gameservice-sdk/./src/GameService/GSLive/Controllers/ُTurnBased/models.ts","webpack://gameservice-sdk/./src/GameService/GSLive/RealTime/index.ts","webpack://gameservice-sdk/./src/GameService/GSLive/RealTime/models.ts","webpack://gameservice-sdk/./src/GameService/GSLive/TurnBased/index.ts","webpack://gameservice-sdk/./src/GameService/GSLive/TurnBased/models.ts","webpack://gameservice-sdk/./src/GameService/GSLive/index.ts","webpack://gameservice-sdk/./src/GameService/Leaderboards/index.ts","webpack://gameservice-sdk/./src/GameService/Player/index.ts","webpack://gameservice-sdk/./src/GameService/Player/models.ts","webpack://gameservice-sdk/./src/GameService/Save/index.ts","webpack://gameservice-sdk/./src/GameService/Social/Friends/index.ts","webpack://gameservice-sdk/./src/GameService/Social/index.ts","webpack://gameservice-sdk/./src/GameService/Table/index.ts","webpack://gameservice-sdk/./src/GameService/index.ts","webpack://gameservice-sdk/./src/Utils/Consts.ts","webpack://gameservice-sdk/./src/Utils/Errors.ts","webpack://gameservice-sdk/./src/Utils/Logger.ts","webpack://gameservice-sdk/./src/Utils/Statistics.ts","webpack://gameservice-sdk/./node_modules/uuid/index.js","webpack://gameservice-sdk/./node_modules/uuid/lib/bytesToUuid.js","webpack://gameservice-sdk/./node_modules/uuid/lib/rng-browser.js","webpack://gameservice-sdk/./node_modules/uuid/v1.js","webpack://gameservice-sdk/./node_modules/uuid/v4.js","webpack://gameservice-sdk/./node_modules/ws/browser.js","webpack://gameservice-sdk/webpack/bootstrap","webpack://gameservice-sdk/./src/index.ts"],"names":["root","factory","exports","module","define","amd","self","utils","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","config","Promise","resolve","reject","requestData","data","requestHeaders","headers","isFormData","request","XMLHttpRequest","auth","username","password","unescape","encodeURIComponent","Authorization","btoa","fullPath","baseURL","url","open","method","toUpperCase","params","paramsSerializer","timeout","onreadystatechange","readyState","status","responseURL","indexOf","responseHeaders","getAllResponseHeaders","response","responseType","responseText","statusText","onabort","onerror","ontimeout","timeoutErrorMessage","isStandardBrowserEnv","xsrfValue","withCredentials","xsrfCookieName","read","undefined","xsrfHeaderName","forEach","val","key","toLowerCase","setRequestHeader","isUndefined","e","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","cancel","abort","send","bind","Axios","mergeConfig","createInstance","defaultConfig","context","instance","prototype","extend","axios","create","instanceConfig","defaults","Cancel","CancelToken","isCancel","all","promises","spread","isAxiosError","default","message","this","toString","__CANCEL__","executor","TypeError","resolvePromise","token","reason","throwIfRequested","source","c","value","InterceptorManager","dispatchRequest","interceptors","arguments","chain","interceptor","unshift","fulfilled","rejected","push","length","shift","getUri","replace","handlers","use","eject","id","fn","h","isAbsoluteURL","combineURLs","requestedURL","enhanceError","code","error","Error","transformData","throwIfCancellationRequested","transformRequest","merge","common","adapter","transformResponse","toJSON","name","description","number","fileName","lineNumber","columnNumber","stack","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","target","isPlainObject","isArray","slice","mergeDeepProperties","prop","axiosKeys","concat","otherKeys","Object","keys","filter","validateStatus","fns","normalizeHeaderName","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","process","call","isArrayBuffer","isBuffer","isStream","isFile","isBlob","isArrayBufferView","buffer","isURLSearchParams","isObject","JSON","stringify","parse","maxContentLength","maxBodyLength","thisArg","args","Array","i","apply","encode","serializedParams","parts","v","isDate","toISOString","join","hashmarkIndex","relativeURL","write","expires","path","domain","secure","cookie","isNumber","Date","toGMTString","isString","document","match","RegExp","decodeURIComponent","remove","now","test","payload","originURL","msie","navigator","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","window","location","requestURL","parsed","normalizedName","ignoreDuplicateOf","split","line","trim","substr","callback","arr","getPrototypeOf","isFunction","obj","l","hasOwnProperty","constructor","FormData","ArrayBuffer","isView","pipe","URLSearchParams","product","result","assignValue","a","b","str","stripBOM","content","charCodeAt","superThis","get","Url","Api","Endpoint","GetAchievements","Authentication","gameToken","Log","achievement","msg","achievementid","post","GetAchievementsv2","new","tag","DownloadAssets","ClientID","userToken","gameID","Email","Password","Login","v4","Start","Token","NickName","PhoneNumber","SMSAuth","ClientSecret","Code","SMSAuthCallback","Statistics","game","_id","GSLive","Command","Initilize","command","OnSubscribeChannel","channelName","OnChatReceived","ChannelsSubscribed","ChannelsRecentMessages","ChannelMembers","PendingMessages","OnUnSubscribeChannel","pkt","Packet","SetHead","Actions","ActionSubscribe","SetToken","commandToken","SetMsg","Send","Message","SetTo","SetText","ActionChat","SetData","ToString","memberID","ActionPrivateChat","ActionGetSubscribedChannels","Data","SetID","ActionGetLastGroupMessages","skip","limit","SetMin","SetMax","ActionGetMembersOfChannel","ActionGetPendingMessages","ActionUnSubscribe","IsPrivate","To","From","Text","Time","Channel","input","inputJ","SetIsPrivate","SetFrom","SetTime","SetChannel","Cast","isInAutoMatchQueue","OnConnect","Payload","SetGameID","ActionAuth","OnReceive","event","packet","Parse","Cipher","GetHead","GetToken","onReady","msgPublic","GetData","Chats","GetChannel","GetFrom","GetText","msgPrivate","GetMsg","msgs","members","channels","pendings","ActionAutoMatch","autoMatchInfo","TurnBased","OnAutoMatchUpdated","RealTime","LeftWaitingQ","OnAutoMatchCanceled","ActionGetRooms","ActionJoinRoom","start","StartGame","Room","TurnbasedController","Area","Port","RealTimeController","Hash","console","onDisconnect","wasClean","relay","ip","CommandConnection","WebSocket","cipher","isEncriptionActive","encription","onopen","onmessage","onclose","err","Rc4","x","s","j","res","y","String","fromCharCode","serilized","Buffer","from","Head","Msg","rc4","GameID","ID","User","Invite","Name","Min","Max","SyncMode","Role","Private","Persist","Extra","inputS","areaT","MemerID","cast","Protocol","PublicKey","realtimeToken","BigInt","RoomID","ConnectHash","AuthPayload","Action","ToBuffer","Deserialize","ActionPublicMessage","NewMessageReceived","MessageInfo","MessageType","SendType","GProtocolSendType","Type","ClientReceiveTime","ClientSendTime","Export","ActionPrivateMessage","msgPrv","ActionJoin","JoinPayload","BufferToString","OnJoinedRoom","ActionMembersDetail","RoomMembersDetailReceived","ActionLeave","member","OnLeaveRoom","user","isMe","Connection","close","ActionEventMessage","evM","ev","EventPayload","OnPropertyEvent","By","SenderID","Value","GetExtra","ActionRoomInfo","roomInfoS","roomInfo","CurrentRoomInfoReceived","binaryType","StringToBuffer","charList","uintArray","Uint8Array","buff","encodedString","escape","Operations","Types","_Token","_Type","Serialize","binary","compress","_Action","Number","havePayload","haveClientSendTime","t","alloc","writeUInt16LE","valueOf","writeBigUInt64LE","writeBigInt64LE","offset","payloadLen","readUInt8","readUInt16LE","readBigUInt64LE","readBigInt64LE","_Extra","_SenderID","_ReceiverID","_Payload","type","action","ReceiverID","haveSenderID","haveRecieverID","haveExtra","ReceiverIDBuff","SenderIDBuff","senderLen","receiverLen","extraLen","haveSender","haveReceiver","JoinType","UserJoined","JoinMemberOrder","room","turnbasedToken","joinData","joinDetail","JoinDetail","ActionTakeTurn","turnData","OnTakeTurn","ActionChooseNext","nextData","OnChoosedNext","ActionVote","voteDetail","vote","VoteDetail","OnVoteReceived","Member","Outcome","ActionAcceptVote","resultdata","GameResult","OnComplete","ActionGetUsers","OnRoomMembersDetailReceived","ActionCurrentTurnDetail","currentTurn","OnCurrentTurnMember","ModifyValue","propertyChange","PropertyChange","OnPropertyUpdated","GetRoomInfo","OnCurrentRoomInfoReceived","maxPayload","_Name","_Private","_Persist","Logo","Creator","Status","NumOfMembers","Variables","CreatedAt","_ID","_Logo","_Creator","_Min","_Max","_Role","_Status","_NumOfMembers","_Variables","_CreatedAt","PropertyType","Sender","JoinOrder","outcomes","memberOutcome","outcome","AcceptCount","OnReconnected","OnAvailableRoomsReceived","OnFindMemberReceived","OnInvitationSent","options","maxPlayer","minPlayer","SetName","roomName","SetPassword","roomPassword","SetRole","role","SetPersist","isPersist","SetPrivate","isPrivate","SetExtra","extra","SetSyncMode","ActionCreateRoom","roomID","query","SetUser","ActionFindUser","userID","ActionInviteUser","ActionGetInviteList","inviteID","SetInvite","ActionAcceptInvite","sendType","recieverID","Property","SetMemberProperty","propertyName","DelMemberProperty","SetRoomProperty","DelRoomProperty","ActionGetRoomSnapshot","NameLength","ValueLength","NewInviteReceived","OnInviteInboxReceived","whoIsNext","Next","dataIn","outcomesS","map","Rank","Outcomes","_Value","_Rank","Leaderboard","leaderboard","leaderboardId","score","LeaderboardV2","scores","GetCurrentPlayer","memberId","LastLoginInfo","memInfo","MemberInfo","put","currentPassword","newPassword","GetCurrentUser","Devices","deviceId","Id","Label","Tags","GlobalProperty","Options","Mobile","saveName","saveData","SaveGame","delete","Friends","count","list","tableId","find","rowsOwner","sort","Table","aggrigation","itemId","newItem","editedItem","clientId","clientSecret","Verbose","Internal","InvalidInput","Assets","Achievements","Leaderboards","Player","Save","Social","OPEN","ApiUrls","DBaaSUrls","CommandUrls","DBaaS","CommandActions","TurnBasedActions","RealTimeActions","log","statis","DeviceID","v1","uuid","byteToHex","buf","bth","getRandomValues","crypto","msCrypto","rnds8","rnds","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","node","clockseq","seedBytes","msecs","getTime","nsecs","dt","tl","t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,EACH,OAAOA,EAAapvB,QAGrB,IAAIC,EAASgvB,EAAyBE,GAAY,CAGjDnvB,QAAS,IAOV,OAHAqvB,EAAoBF,GAAU/jB,KAAKnL,EAAOD,QAASC,EAAQA,EAAOD,QAASkvB,GAGpEjvB,EAAOD,Q,2FCrBf,gBACA,UAAe,EAAAsvB,a","file":"gameservice-sdk.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"gameservice-sdk\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"gameservice-sdk\"] = factory();\n\telse\n\t\troot[\"gameservice-sdk\"] = factory();\n})(self, function() {\nreturn ","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","import { Achievement } from './models';\nimport { Url } from '../../Utils/Consts';\nimport { Log } from '../../Utils/Logger';\nimport axios from 'axios';\nimport { GameService } from '..';\n\n\nexport class Achievements {\n constructor(public superThis: GameService) { }\n\n async GetAchievements(): Promise<Achievement[]> {\n try {\n let { data } = await axios.get(`${Url.Api.Endpoint}${Url.Api.GetAchievements}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetAchievements\", data);\n\n return data.achievement;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async Unlock(achievementid: string): Promise<Achievement> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.GetAchievementsv2}/${achievementid}`, null, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"Unlock\", data);\n\n return data.new;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n}","import { AssetInfoData } from './models';\nimport { Url } from '../../Utils/Consts';\nimport { Log } from '../../Utils/Logger';\nimport axios from 'axios';\nimport { GameService } from '../index';\n\nexport class Assets {\n constructor(public superThis: GameService) { }\n \n async GetAssetInfo(tag: string): Promise<AssetInfoData> {\n try {\n let { data } = await axios.get(`${Url.Api.Endpoint}${Url.Api.DownloadAssets}/${this.superThis.ClientID}/datapack/?tag=${tag}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetAssetInfo\", data);\n\n return data.data;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n}","import { Actions, Url } from '../../Utils/Consts';\nimport { Log } from '../../Utils/Logger';\nimport * as Statistics from '../../Utils/Statistics';\nimport { GameService } from '../index';\nimport { v4 } from 'uuid';\nimport axios from 'axios';\n\nexport class Authentication {\n userToken: string = \"\";\n gameToken: string = \"\";\n gameID: string = \"\";\n\n constructor(public superThis: GameService) { }\n\n async Login(Email: string, Password: string): Promise<string> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.Login}`, {\n \"email\": Email,\n \"password\": Password,\n \"device_id\": v4(),\n })\n\n // Log(\"Login\", data);\n\n this.userToken = data.token;\n\n await this.Start()\n\n return data.token;\n } catch (e) {\n if (e && e.response) {\n if (e.response.data)\n throw e.response.data\n throw e.response\n } else\n throw e\n }\n }\n async LoginWithToken(Token: string) {\n this.userToken = Token;\n await this.Start()\n }\n async SignUp(NickName: string, Email: string, Password: string): Promise<string> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.Login}`, {\n \"mode\": \"register\",\n \"name\": NickName,\n \"client_id\": this.superThis.ClientID,\n \"email\": Email,\n \"password\": Password,\n \"device_id\": v4(),\n })\n\n Log(\"SignUp\", data);\n\n this.userToken = data.token;\n\n await this.Start()\n\n return data.token;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async CheckSmsStatus(): Promise<boolean> {\n return true\n }\n async SendLoginCodeSms(PhoneNumber: string): Promise<boolean> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.SMSAuth}`, {\n \"game\": this.superThis.ClientID,\n \"secret\": this.superThis.ClientSecret,\n \"phone_number\": PhoneNumber,\n })\n\n Log(\"SendLoginCodeSms\", data);\n\n return true;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async LoginOrSignUpWithSms(NickName: string, PhoneNumber: string, Code: string): Promise<string> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.SMSAuthCallback}`, {\n \"name\": NickName,\n \"code\": Code,\n \"phone_number\": PhoneNumber,\n \"device_id\": v4(),\n })\n\n Log(\"SendLoginCodeSms\", data);\n\n return data.token;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async LoginAsGuest(): Promise<string> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.Login}`, {\n \"device_id\": v4(),\n })\n\n Log(\"LoginAsGuest\", data);\n\n this.userToken = data.token;\n\n await this.Start()\n\n return data.token;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n private async Start() {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.Start}`, {\n \"game\": this.superThis.ClientID,\n \"system_info\": Statistics.get(),\n \"secret\": this.superThis.ClientSecret,\n \"token\": this.userToken,\n \"connectionType\": \"wss\"\n })\n\n // Log(\"Start\", data);\n\n this.gameToken = data.token;\n this.gameID = data.game._id;\n\n await this.superThis.GSLive.Command.Initilize(data.command);\n\n return data.token;\n } catch (e) {\n // if (this.superThis.Verbose) \n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n}","import { GameService } from '../..';\nimport { Log } from '../../../Utils/Logger';\nimport { Actions } from '../../../Utils/Consts';\nimport { Data, Packet, Payload } from '../Controllers/Command/models';\nimport { Message } from './models';\n\nexport class Chats {\n constructor(public superThis: GameService) { }\n\n public async SubscribeChannel(channelName: string) {\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionSubscribe);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetMsg(channelName)\n pkt.Send();\n }\n public OnSubscribeChannel: (channelName: string) => void = (channelName) => { }\n\n public async SendChannelMessage(channelName: string, message: string) {\n let payload = new Message(this.superThis);\n payload.SetTo(channelName);\n payload.SetText(message);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionChat);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(payload.ToString())\n pkt.Send();\n }\n\n public async SendPrivateMessage(memberID: string, message: string) {\n let payload = new Message(this.superThis);\n payload.SetTo(memberID);\n payload.SetText(message);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionPrivateChat);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(payload.ToString())\n pkt.Send();\n }\n public OnChatReceived: (channelName: string, sender: object, message: string, isPrivate: boolean) => void = () => { };\n\n public async GetChannelsSubscribed() {\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionGetSubscribedChannels);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.Send();\n }\n public ChannelsSubscribed: (channels: object[]) => void = () => { };\n\n public async GetChannelRecentMessages(channelName: string) {\n let payload = new Data(this.superThis);\n payload.SetID(channelName);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionGetLastGroupMessages);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(payload.ToString())\n pkt.Send();\n }\n public ChannelsRecentMessages: (messages: object[]) => void = () => { };\n\n public async GetChannelMembers(channelName: string, skip: number = 0, limit: number = 25) {\n let payload = new Data(this.superThis);\n payload.SetID(channelName);\n payload.SetMin(skip)\n payload.SetMax(limit)\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionGetMembersOfChannel);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(payload.ToString())\n pkt.Send();\n }\n public ChannelMembers: (members: object[]) => void = () => { };\n\n public async GetPendingMessages() {\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionGetPendingMessages);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.Send();\n }\n public PendingMessages: (pendingMessages: object[]) => void = () => { };\n\n public async UnSubscribeChannel(channelName: string) {\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionUnSubscribe);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetMsg(channelName)\n pkt.Send();\n }\n public OnUnSubscribeChannel: Function = () => { };\n}\n","import { GameService } from '../../index';\n\nexport class Message {\n constructor(public superThis: GameService) { }\n\n private IsPrivate: boolean | undefined\n GetIsPrivate(): boolean | undefined {\n return this.IsPrivate;\n }\n SetIsPrivate(IsPrivate: boolean) {\n this.IsPrivate = IsPrivate;\n }\n\n private To: string | undefined\n GetTo(): string | undefined {\n return this.To;\n }\n SetTo(To: string) {\n this.To = To;\n }\n\n private From: object | undefined\n GetFrom(): object | undefined {\n return this.From;\n }\n SetFrom(From: object) {\n this.From = From;\n }\n\n\n private Text: string | undefined\n GetText(): string | undefined {\n return this.Text;\n }\n SetText(Text: string) {\n this.Text = Text;\n }\n\n private Time: number | undefined\n GetTime(): number | undefined {\n return this.Time;\n }\n SetTime(Time: number) {\n this.Time = Time;\n }\n\n private Channel: string | undefined\n GetChannel(): string | undefined {\n return this.Channel;\n }\n SetChannel(Channel: string) {\n this.Channel = Channel;\n }\n\n private Cast() {\n return {\n \"0\": this.IsPrivate,\n \"1\": this.To,\n \"2\": this.From,\n \"3\": this.Text,\n \"4\": this.Time,\n \"5\": this.Channel\n }\n }\n\n public Parse(input: any) {\n let inputJ = JSON.parse(input)\n this.SetIsPrivate(inputJ[\"0\"]);\n this.SetTo(inputJ[\"1\"]);\n this.SetFrom(inputJ[\"2\"]);\n this.SetText(inputJ[\"3\"]);\n this.SetTime(inputJ[\"4\"]);\n this.SetChannel(inputJ[\"5\"]);\n }\n\n ToString(): string {\n return JSON.stringify(this.Cast())\n }\n}","import { Actions, Url } from '../../../../Utils/Consts';\nimport { GameService } from '../../../index';\nimport nWebSocket from 'ws';\nimport { Area, Packet, Payload, StartGame } from './models';\nimport { Message } from '../../Chats/models';\nimport { Log } from '../../../../Utils/Logger';\nimport { GSLive } from '../..';\n\nexport class Command {\n constructor(public superThis: GameService) { }\n\n commandToken: string = \"\";\n isInAutoMatchQueue = false;\n\n public Initilize(relay: any) {\n if (relay.ip == undefined || relay.port == undefined)\n return console.error(\"No valid command returned from HttpServices\", { relay });\n if (typeof window === 'undefined') {\n Log(\"[Command]\", `[Node] [Connecting] [${relay.ip}:${relay.port}]`);\n GSLive.CommandConnection = new nWebSocket(`ws://${relay.ip}:${relay.port}`);\n } else {\n Log(\"[Command]\", `[Browser] [Connecting] [${relay.port}:${relay.port}]`);\n GSLive.CommandConnection = new WebSocket(`ws://${relay.ip}:${relay.port}`);\n }\n \n this.superThis.GSLive.Cipher = relay.cipher;\n this.superThis.GSLive.isEncriptionActive = relay.encription != \"deactive\";\n\n GSLive.CommandConnection!.onopen = this.OnConnect\n GSLive.CommandConnection!.onmessage = this.OnReceive;\n GSLive.CommandConnection!.onclose = this.onDisconnect;\n\n GSLive.CommandConnection!.onerror = (err: nWebSocket.ErrorEvent) => {\n throw err;\n };\n }\n\n protected OnConnect = (e: nWebSocket.OpenEvent) => {\n // console.log(\"[Command] [Connected]\")\n // Send Auth pkt\n let payload = new Payload(this.superThis);\n payload.SetGameID(this.superThis.Authentication.gameID);\n payload.SetToken(this.superThis.Authentication.userToken);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionAuth);\n pkt.SetData(payload.ToString())\n pkt.Send(false);\n }\n\n protected OnReceive = async (event: nWebSocket.MessageEvent) => {\n let packet = new Packet(this.superThis)\n packet.Parse(event.data, this.superThis.GSLive.Cipher != \"\" && this.commandToken != \"\");\n // console.log(packet.Export())\n\n switch (packet.GetHead()) {\n case Actions.Command.ActionAuth:\n this.commandToken = packet.GetToken()!;\n this.superThis.onReady()\n break\n // ---- Chats ---- //\n case Actions.Command.ActionChat:\n let msgPublic = new Message(this.superThis);\n msgPublic.Parse(packet.GetData()!)\n this.superThis.GSLive.Chats.OnChatReceived(msgPublic.GetChannel()!, msgPublic.GetFrom()!, msgPublic.GetText()!, false)\n break\n case Actions.Command.ActionPrivateChat:\n let msgPrivate = new Message(this.superThis);\n msgPrivate.Parse(packet.GetData()!)\n this.superThis.GSLive.Chats.OnChatReceived(msgPrivate.GetChannel()!, msgPrivate.GetFrom()!, msgPrivate.GetText()!, true)\n break\n case Actions.Command.ActionSubscribe:\n this.superThis.GSLive.Chats.OnSubscribeChannel(packet.GetMsg()!)\n break\n case Actions.Command.ActionUnSubscribe:\n this.superThis.GSLive.Chats.OnUnSubscribeChannel(packet.GetMsg()!)\n break\n case Actions.Command.ActionGetLastGroupMessages:\n let msgs: object[] = JSON.parse(packet.GetData()!);\n this.superThis.GSLive.Chats.ChannelsRecentMessages(msgs)\n break\n case Actions.Command.ActionGetMembersOfChannel:\n let members: object[] = JSON.parse(packet.GetData()!);\n this.superThis.GSLive.Chats.ChannelMembers(members)\n break\n case Actions.Command.ActionGetSubscribedChannels:\n let channels: object[] = JSON.parse(packet.GetData()!);\n this.superThis.GSLive.Chats.ChannelsSubscribed(channels)\n break\n case Actions.Command.ActionGetPendingMessages:\n let pendings: object[] = JSON.parse(packet.GetData()!);\n this.superThis.GSLive.Chats.PendingMessages(pendings)\n break\n\n // ---- Create Room ---- //\n case Actions.Command.ActionAutoMatch:\n let autoMatchInfo;\n if (packet.GetData() != undefined) {\n autoMatchInfo = JSON.parse(packet.GetData()!)\n }\n if (packet.GetMsg()) {\n autoMatchInfo = packet.GetMsg();\n }\n this.superThis.GSLive.TurnBased.OnAutoMatchUpdated(autoMatchInfo);\n this.superThis.GSLive.RealTime.OnAutoMatchUpdated(autoMatchInfo);\n this.isInAutoMatchQueue = true;\n break\n case Actions.Command.LeftWaitingQ:\n this.superThis.GSLive.TurnBased.OnAutoMatchCanceled(packet.GetMsg() || \"\")\n this.superThis.GSLive.RealTime.OnAutoMatchCanceled(packet.GetMsg() || \"\")\n this.isInAutoMatchQueue = false;\n break\n case Actions.Command.ActionGetRooms:\n\n break\n case Actions.Command.ActionJoinRoom:\n // connect to relay\n let start = new StartGame();\n start.parse(packet.GetData()!)\n if (start.Room![\"syncMode\"] == 1)\n await this.superThis.GSLive.TurnbasedController.Initilize(start.Room![\"_id\"], start.Area!.Endpoint, start.Area!.Port)\n else\n await this.superThis.GSLive.RealTimeController.Initilize(start.Room![\"_id\"], start.Area?.Hash!, start.Area!.Endpoint, start.Area!.Port)\n this.isInAutoMatchQueue = false;\n break\n // case Actions.Command.ActionKickUser:\n\n // break\n\n case Actions.Error:\n console.error(`[Command] [Error] [Msg: ${packet.GetMsg()}]`)\n break\n }\n }\n\n private onDisconnect = (event: nWebSocket.CloseEvent) => {\n if (event.wasClean) {\n Log(\"[Command]\", `[close] Connection closed cleanly, code = ${event.code} reason = ${event.reason}`);\n } else {\n Log(\"[Command]\", '[close] Connection died');\n }\n this.commandToken = \"\";\n }\n}","import { GSLive } from '../..';\nimport { GameService } from '../../../index';\nimport buffer from 'buffer';\n\nexport function Rc4(key: string, str: string) {\n var s = [], j = 0, x, res = '';\n for (var i = 0; i < 256; i++) {\n s[i] = i;\n }\n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n i = 0;\n j = 0;\n for (var y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n return res;\n}\n\nexport class Packet {\n constructor(public superThis: GameService) { }\n\n public Parse(input: any, encription: boolean = true) {\n let inputJ = JSON.parse(input)\n let data = inputJ[\"2\"];\n let msg = inputJ[\"3\"];\n if (this.superThis.GSLive.isEncriptionActive && encription) {\n if (inputJ[\"2\"]) data = Buffer.from(Rc4(this.superThis.GSLive.Cipher, Buffer.from(inputJ[\"2\"], 'base64').toString(\"latin1\")), \"latin1\").toString(\"utf-8\")\n if (inputJ[\"3\"]) msg = Buffer.from(Rc4(this.superThis.GSLive.Cipher, Buffer.from(inputJ[\"3\"], 'base64').toString(\"latin1\")), \"latin1\").toString(\"utf-8\")\n }\n this.SetToken(inputJ[\"0\"]);\n this.SetHead(inputJ[\"1\"]);\n this.SetData(data);\n this.SetMsg(msg);\n }\n\n private Token: string | undefined\n public GetToken(): string | undefined {\n return this.Token;\n }\n public SetToken(Token: string) {\n this.Token = Token;\n }\n\n private Head: number | undefined\n public GetHead(): number | undefined {\n return this.Head;\n }\n public SetHead(Head: number) {\n this.Head = Head;\n }\n\n private Data: string | undefined\n public GetData(): string | undefined {\n return this.Data;\n }\n public SetData(Data: string) {\n this.Data = Data;\n }\n\n private Msg: string | undefined\n public GetMsg(): string | undefined {\n return this.Msg;\n }\n public SetMsg(Msg: string) {\n this.Msg = Msg;\n }\n\n Export() {\n return {\n \"0\": this.Token,\n \"1\": this.Head,\n \"2\": this.Data,\n \"3\": this.Msg\n }\n }\n\n private Cast(encription: boolean = true) {\n if (this.superThis.GSLive.isEncriptionActive && encription) {\n if (this.Data) {\n let rc4 = Rc4(this.superThis.GSLive.Cipher, Buffer.from(this.Data!).toString(\"utf-8\"));\n let data = Buffer.from(rc4, \"latin1\").toString('base64');\n this.Data = data;\n }\n if (this.Msg) {\n let rc4 = Rc4(this.superThis.GSLive.Cipher, Buffer.from(this.Msg!).toString(\"utf-8\"));\n let msg = Buffer.from(rc4, \"latin1\").toString('base64')\n this.Msg = msg;\n }\n }\n\n return {\n \"0\": this.Token,\n \"1\": this.Head,\n \"2\": this.Data,\n \"3\": this.Msg\n }\n }\n ToString(encription: boolean = true): string {\n return JSON.stringify(this.Cast(encription))\n }\n Send = (encription: boolean = true) => {\n let serilized = this.ToString(encription)\n if (GSLive.CommandConnection === undefined)\n throw \"User not connected to Command Server\";\n GSLive.CommandConnection!.send(serilized);\n }\n}\n\nexport class Payload {\n constructor(public superThis: GameService) { }\n\n private GameID: string | undefined\n GetGameID(): string | undefined {\n return this.GameID;\n }\n SetGameID(GameID: string) {\n this.GameID = GameID;\n }\n\n private Token: string | undefined\n GetToken(): string | undefined {\n return this.Token;\n }\n SetToken(Token: string) {\n this.Token = Token;\n }\n\n private Cast() {\n return {\n \"0\": this.GameID,\n \"1\": this.Token\n }\n }\n\n ToString(): string {\n return JSON.stringify(this.Cast())\n }\n}\n\nexport class Data {\n constructor(public superThis: GameService) { }\n\n private ID: string | undefined\n GetID(): string | undefined {\n return this.ID;\n }\n SetID(ID: string) {\n this.ID = ID;\n }\n\n private User: string | undefined\n GetUser(): string | undefined {\n return this.User;\n }\n SetUser(User: string) {\n this.User = User;\n }\n\n private Invite: string | undefined\n GetInvite(): string | undefined {\n return this.Invite;\n }\n SetInvite(Invite: string) {\n this.Invite = Invite;\n }\n\n private Name: string | undefined\n GetName(): string | undefined {\n return this.Name;\n }\n SetName(Name: string) {\n this.Name = Name;\n }\n\n private Head: string | undefined\n GetHead(): string | undefined {\n return this.Head;\n }\n SetHead(Head: string) {\n this.Head = Head;\n }\n\n private Min: number | undefined\n GetMin(): number | undefined {\n return this.Min;\n }\n SetMin(Min: number) {\n this.Min = Min;\n }\n\n private Max: number | undefined\n GetMax(): number | undefined {\n return this.Max;\n }\n SetMax(Max: number) {\n this.Max = Max;\n }\n\n private SyncMode: number | undefined\n GetSyncMode(): number | undefined {\n return this.SyncMode;\n }\n SetSyncMode(SyncMode: number) {\n this.SyncMode = SyncMode;\n }\n\n private Role: string | undefined\n GetRole(): string | undefined {\n return this.Role;\n }\n SetRole(Role: string) {\n this.Role = Role;\n }\n\n private Private: boolean | undefined\n GetPrivate(): boolean | undefined {\n return this.Private;\n }\n SetPrivate(Private: boolean) {\n this.Private = Private;\n }\n\n private Persist: boolean | undefined\n GetPersist(): boolean | undefined {\n return this.Persist;\n }\n SetPersist(Persist: boolean) {\n this.Persist = Persist;\n }\n\n private Extra: string | undefined\n GetExtra(): string | undefined {\n return this.Extra;\n }\n SetExtra(Extra: string) {\n this.Extra = Extra;\n }\n\n private Password: string | undefined\n GetPassword(): string | undefined {\n return this.Password;\n }\n SetPassword(Password: string) {\n this.Password = Password;\n }\n\n Parse(inputJ: any) {\n this.ID = inputJ[0];\n this.User = inputJ[1];\n this.Invite = inputJ[2];\n this.Name = inputJ[3];\n this.Head = inputJ[4];\n this.Min = inputJ[5];\n this.Max = inputJ[6];\n this.SyncMode = inputJ[7];\n this.Role = inputJ[8];\n this.Private = inputJ[9];\n this.Persist = inputJ[10];\n this.Extra = inputJ[11];\n this.Password = inputJ[12];\n }\n\n Export() {\n return {\n ID: this.ID,\n User: this.User,\n Invite: this.Invite,\n Name: this.Name,\n Head: this.Head,\n Min: this.Min,\n Max: this.Max,\n SyncMode: this.SyncMode,\n Role: this.Role,\n Private: this.Private,\n Persist: this.Persist,\n Extra: this.Extra,\n Password: this.Password,\n }\n }\n\n private Cast() {\n return {\n \"0\": this.ID,\n \"1\": this.User,\n \"2\": this.Invite,\n \"3\": this.Name,\n \"4\": this.Head,\n \"5\": this.Min,\n \"6\": this.Max,\n \"7\": this.SyncMode,\n \"8\": this.Role,\n \"9\": this.Private,\n \"10\": this.Persist,\n \"11\": this.Extra,\n \"12\": this.Password\n }\n }\n\n ToString(): string {\n return JSON.stringify(this.Cast())\n }\n}\n\nexport class StartGame {\n MemerID: string | undefined\n Area: Area | undefined\n Room: any | undefined\n\n parse(inputS: string) {\n\n let input = JSON.parse(inputS)\n let areaT = new Area();\n areaT.parse(JSON.stringify(input[\"2\"]))\n\n this.Room = input[\"0\"];\n this.MemerID = input[\"1\"];\n this.Area = areaT\n }\n\n cast(): object {\n return {\n \"0\": this.Room,\n \"1\": this.MemerID,\n \"2\": this.Area,\n }\n }\n\n toString(): string {\n return JSON.stringify(this.cast())\n }\n}\n\nexport class Area {\n Endpoint: string = \"\"\n Protocol: string | undefined\n Port: number = 0\n Token: string | undefined\n PublicKey: string | undefined\n Hash: string | undefined\n\n parse(inputS: string) {\n let input = JSON.parse(inputS)\n this.Endpoint = input[\"0\"];\n this.Protocol = input[\"1\"];\n this.Port = input[\"2\"];\n this.Token = input[\"3\"];\n this.PublicKey = input[\"4\"];\n this.Hash = input[\"5\"];\n }\n\n cast(): object {\n return {\n \"0\": this.Endpoint,\n \"1\": this.Protocol,\n \"2\": this.Port,\n \"3\": this.Token,\n \"4\": this.PublicKey,\n \"5\": this.Hash\n }\n }\n\n toString(): string {\n return JSON.stringify(this.cast())\n }\n}","import { Actions, } from '../../../../Utils/Consts';\nimport { GameService } from '../../../index';\nimport { Data, JoinPayload } from './models';\nimport { AuthPayload, BufferToString, Packet } from './models';\nimport WebSocket from 'ws';\nimport { Log } from '../../../../Utils/Logger';\nimport { EventPayload, GProtocolSendType, MessageType } from '../../RealTime/models';\nimport { Room } from '../ُTurnBased/models';\n\nexport class RealTime {\n constructor(public superThis: GameService) { }\n\n realtimeToken: bigint = BigInt(0);\n RoomID: string = \"\";\n ConnectHash: string = \"\";\n static Connection: WebSocket | undefined = undefined\n\n public Initilize(RoomID: string, ConnectHash: string, Endpoint: string, Port: number) {\n Log(\"[RealTime]\", `[Connecting] [${RoomID}] [ws://${Endpoint}:${Port}]`);\n\n this.RoomID = RoomID;\n this.ConnectHash = ConnectHash;\n\n RealTime.Connection = new WebSocket(`ws://${Endpoint}:${Port}`);\n RealTime.Connection.binaryType = \"arraybuffer\"\n RealTime.Connection!.onopen = this.OnConnect\n RealTime.Connection!.onmessage = this.OnReceive;\n RealTime.Connection!.onclose = this.onDisconnect;\n RealTime.Connection!.onerror = function (error) {\n throw error;\n };\n }\n protected OnConnect = (e: WebSocket.OpenEvent) => {\n Log(\"[RealTime]\", \"[onConnect]\")\n // Send Auth pkt\n let payload = new AuthPayload();\n payload.RoomID = this.RoomID;\n payload.Token = this.superThis.Authentication.gameToken;\n payload.Hash = this.ConnectHash;\n\n let pkt = new Packet();\n pkt.Action = Actions.RealTime.ActionAuth;\n pkt.Payload = payload.ToBuffer()\n pkt.Send();\n }\n\n protected OnReceive = (event: WebSocket.MessageEvent) => {\n let packet = new Packet()\n packet.Deserialize(Buffer.from(event.data.toString(), \"base64\"));\n\n switch (packet.Action) {\n case Actions.RealTime.ActionAuth:\n this.realtimeToken = packet.Token!\n break\n // case Actions.RealTime.ActionData:\n\n // break\n case Actions.RealTime.ActionPublicMessage:\n let msg = new Data();\n msg.Deserialize(packet.Payload!)\n this.superThis.GSLive.RealTime.NewMessageReceived({\n MessageInfo: {\n MessageType: MessageType[packet.Action],\n SendType: GProtocolSendType[packet.Type],\n ClientReceiveTime: packet.ClientSendTime,\n },\n Message: msg.Export(),\n })\n break\n case Actions.RealTime.ActionPrivateMessage:\n let msgPrv = new Data();\n msgPrv.Deserialize(packet.Payload!)\n this.superThis.GSLive.RealTime.NewMessageReceived({\n MessageInfo: {\n MessageType: MessageType[packet.Action],\n SendType: GProtocolSendType[packet.Type],\n ClientReceiveTime: packet.ClientSendTime,\n },\n Message: msgPrv.Export(),\n })\n break\n case Actions.RealTime.ActionJoin:\n let payload = new JoinPayload()\n payload.Parse(JSON.parse(BufferToString(packet.Payload!)))\n this.superThis.GSLive.RealTime.OnJoinedRoom(payload.Export())\n break\n case Actions.RealTime.ActionMembersDetail:\n let members = JSON.parse(BufferToString(packet.Payload!));\n this.superThis.GSLive.RealTime.RoomMembersDetailReceived(members)\n break\n case Actions.RealTime.ActionLeave:\n let member = JSON.parse(BufferToString(packet.Payload!));\n this.superThis.GSLive.RealTime.OnLeaveRoom(member)\n if (member!.user!.isMe) {\n RealTime.Connection?.close()\n this.realtimeToken = BigInt(0)\n this.ConnectHash = \"\"\n this.RoomID = \"\"\n RealTime.Connection = undefined;\n }\n break\n // case Actions.RealTime.ActionDestroy:\n\n // break\n // case Actions.RealTime.ActionStatus:\n\n // break\n // case Actions.RealTime.ActionMirror:\n // // Do Nothing\n // break\n case Actions.RealTime.ActionEventMessage:\n let evM = new Data();\n evM.Deserialize(packet.Payload!)\n\n let ev = new EventPayload();\n ev.Deserialize(evM.Payload)\n this.superThis.GSLive.RealTime.OnPropertyEvent({\n By: evM.SenderID,\n Name: ev.Name,\n Value: BufferToString(ev.Value),\n Action: evM.GetExtra().Action,\n Type: evM.GetExtra().Type,\n })\n break\n // case Actions.RealTime.ActionGetRoomSnapshot:\n // console.log(\"ActionGetRoomSnapshot\", BufferToString(packet.Payload!))\n // break\n // case Actions.RealTime.ActionObserver:\n\n // break\n case Actions.RealTime.ActionRoomInfo:\n let roomInfoS = JSON.parse(BufferToString(packet.Payload!));\n let roomInfo = new Room();\n roomInfo.Parse(roomInfoS);\n this.superThis.GSLive.RealTime.CurrentRoomInfoReceived(roomInfo.Export())\n break\n case Actions.Error:\n console.error(`[Error] [Msg: ${packet.Payload?.toString()}]`)\n break\n\n default:\n Log(\"[RealTime]\", `[OnReceive]: ${packet.ToString()}`);\n }\n }\n private onDisconnect = (event: WebSocket.CloseEvent) => {\n if (event.wasClean) {\n Log(\"[RealTime]\", `[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);\n } else {\n // e.g. server process killed or network down event.code is usually 1006 in this case\n Log(\"[RealTime]\", '[close] Connection died');\n }\n this.realtimeToken = BigInt(0);\n this.ConnectHash = \"\";\n }\n}","import { RealTime } from \".\"\nimport { Room } from \"../ُTurnBased/models\"\n\nexport class Packet {\n private _Action: number | undefined\n public get Action(): number | undefined {\n return this._Action\n }\n public set Action(value: number | undefined) {\n if (value! > 255) value = 255\n this._Action = value\n }\n Payload: Uint8Array | undefined\n private _Token: bigint = BigInt(0)\n public get Token(): bigint {\n return this._Token\n }\n public set Token(value: bigint) {\n this._Token = value\n }\n // 0 -> unReliable, 1 -> Reliable\n private _Type: number = 0\n public get Type(): number {\n return this._Type\n }\n public set Type(value: number) {\n if (value! > 255) value = 255\n this._Type = value\n }\n ClientSendTime: number | undefined\n\n Cast() {\n return {\n \"1\": this.Action,\n \"2\": BufferToString(this.Payload!),\n \"3\": Number(this.Token),\n \"4\": this.Type,\n \"5\": this.ClientSendTime\n }\n }\n\n ToString(): string {\n return JSON.stringify(this.Cast())\n }\n\n\n Parse(inputJ: any) {\n this.Action = inputJ[\"1\"]\n this.Payload = inputJ[\"2\"]\n this.Token = inputJ[\"3\"]\n this.Type = inputJ[\"4\"]\n this.ClientSendTime = inputJ[\"5\"]\n }\n\n Serialize(): Uint8Array {\n let havePayload: number = 0x0\n let haveClientSendTime: number = 0x0\n if (this.Payload)\n havePayload = 0x1\n if (this.ClientSendTime)\n haveClientSendTime = 0x1\n\n let source = [this.Action!, haveClientSendTime, havePayload];\n if (havePayload === 0x1) {\n let t = Buffer.alloc(2);\n t.writeUInt16LE(this.Payload?.length!)\n source = [...source, ...t.valueOf()]\n }\n source.push(this.Type)\n\n let t = Buffer.alloc(8);\n t.writeBigUInt64LE(this.Token)\n source = [...source, ...t.valueOf()]\n\n if (havePayload === 0x1)\n source = [...source, ...this.Payload!]\n if (haveClientSendTime === 0x1) {\n let t = Buffer.alloc(8);\n t.writeBigInt64LE(BigInt(this.ClientSendTime!))\n source = [...source, ...t.valueOf()]\n }\n return new Uint8Array(source)\n }\n\n Deserialize(input: Uint8Array) {\n let buff = Buffer.from(input);\n let offset = 0;\n\n let haveClientSendTime = 0x0;\n let havePayload = 0x0;\n\n let payloadLen = 0x0;\n this.Action = buff.readUInt8(offset++)\n\n haveClientSendTime = buff.readUInt8(offset++)\n\n havePayload = buff.readUInt8(offset++)\n\n if (havePayload > 0) {\n payloadLen = buff.readUInt16LE(offset)\n offset += 2\n }\n\n this.Type = buff.readUInt8(offset++)\n\n this.Token = buff.readBigUInt64LE(offset)\n offset += 8\n\n if (havePayload > 0) {\n this.Payload = buff.slice(offset, offset + payloadLen)\n offset += payloadLen\n }\n\n if (haveClientSendTime > 0) {\n this.ClientSendTime = Number(buff.readBigInt64LE(offset))\n }\n }\n\n Send = () => {\n let serilized = this.Serialize()\n if (RealTime.Connection!.readyState)\n RealTime.Connection!.send(serilized, { binary: true, compress: false });\n }\n}\n\nexport class Data {\n private _SenderID: string | undefined\n public get SenderID(): string | undefined {\n return this._SenderID\n }\n public set SenderID(value: string | undefined) {\n this._SenderID = value\n }\n private _ReceiverID: string | undefined\n public get ReceiverID(): string | undefined {\n return this._ReceiverID\n }\n public set ReceiverID(value: string | undefined) {\n this._ReceiverID = value\n }\n private _Payload: Uint8Array | undefined\n public get Payload(): Uint8Array | undefined {\n return this._Payload\n }\n public set Payload(value: Uint8Array | undefined) {\n this._Payload = value\n }\n private _Extra: Uint8Array = new Uint8Array()\n public GetExtra(): any {\n let b = Buffer.from(this._Extra);\n return {\n Type: b.readUInt8(),\n Action: b.readUInt8(1)\n }\n }\n public SetExtra(type: Types, action: Operations) {\n this._Extra = new Uint8Array([type, action]);\n }\n\n\n Cast() {\n return {\n \"1\": this.SenderID,\n \"2\": this.ReceiverID,\n \"3\": BufferToString(this.Payload!),\n \"4\": this._Extra!,\n }\n }\n\n Parse(inputJ: any) {\n this.SenderID = inputJ[\"1\"];\n this.ReceiverID = inputJ[\"2\"];\n this.Payload = inputJ[\"3\"];\n this._Extra = inputJ[\"4\"]\n }\n\n Export() {\n return {\n SenderID: this.SenderID,\n ReceiverID: this.ReceiverID,\n Payload: BufferToString(this.Payload!),\n Extra: this.GetExtra(),\n }\n }\n\n Serialize(): Uint8Array {\n let haveSenderID = 0x0;\n let haveRecieverID = 0x0;\n let havePayload = 0x0;\n let haveExtra = 0x0;\n\n if (this.SenderID) {\n haveSenderID = 0x1;\n }\n\n if (this.ReceiverID) {\n haveRecieverID = 0x1;\n }\n\n if (this.Payload!.length > 0) {\n havePayload = 0x1;\n }\n\n if (this._Extra) {\n haveExtra = 0x1;\n }\n\n let source = [haveSenderID, haveRecieverID, havePayload, haveExtra];\n\n let ReceiverIDBuff = StringToBuffer(this.ReceiverID!)\n let SenderIDBuff = StringToBuffer(this.SenderID!)\n\n if (haveSenderID > 0) {\n source.push(SenderIDBuff.length);\n }\n\n if (haveRecieverID > 0) {\n source.push(ReceiverIDBuff.length);\n }\n\n if (havePayload > 0) {\n let t = Buffer.alloc(2);\n t.writeUInt16LE(this.Payload?.length!)\n source = [...source, ...t.valueOf()];\n }\n\n if (haveExtra > 0) {\n let t = Buffer.alloc(2);\n t.writeUInt16LE(this._Extra?.length!)\n source = [...source, ...t.valueOf()];\n }\n\n if (haveSenderID > 0) {\n source = [...source, ...SenderIDBuff];\n }\n\n if (haveRecieverID > 0) {\n source = [...source, ...ReceiverIDBuff];\n }\n\n if (havePayload > 0) {\n source = [...source, ...this.Payload!];\n }\n\n if (haveExtra > 0) {\n source = [...source, ...this._Extra!];\n }\n return new Uint8Array(source)\n }\n\n Deserialize(input: Uint8Array) {\n let buff = Buffer.from(input);\n\n let offset = 0;\n\n let senderLen = 0;\n let receiverLen = 0;\n let payloadLen = 0;\n let extraLen = 0;\n\n\n let haveSender = buff.readUInt8(offset++);\n let haveReceiver = buff.readUInt8(offset++);\n let havePayload = buff.readUInt8(offset++);\n let haveExtra = buff.readUInt8(offset++);\n\n if (haveSender > 0) {\n senderLen = buff.readUInt8(offset++);\n }\n\n if (haveReceiver > 0) {\n receiverLen = buff.readUInt8(offset++);\n }\n\n if (havePayload > 0) {\n payloadLen = buff.readUInt16LE(offset)\n offset += 2\n }\n\n if (haveExtra > 0) {\n extraLen = buff.readUInt16LE(offset)\n offset += 2\n }\n if (haveSender > 0) {\n this.SenderID = BufferToString(buff.slice(offset, offset + senderLen))\n offset += senderLen\n }\n\n if (haveReceiver > 0) {\n this.ReceiverID = BufferToString(buff.slice(offset, offset + receiverLen))\n offset += receiverLen\n }\n\n if (havePayload > 0) {\n this.Payload = buff.slice(offset, offset + payloadLen);\n offset += payloadLen\n }\n\n if (haveExtra > 0) {\n this._Extra = buff.slice(offset, offset + extraLen);\n offset += extraLen\n }\n }\n}\n\nexport enum Types {\n Object = 0x1,\n Function = 0x2,\n Property = 0x3\n}\n\nexport enum Operations {\n SetMemberProperty = 0x2,\n DelMemberProperty = 0x3,\n SetRoomProperty = 0x0,\n DelRoomProperty = 0x1,\n\n BufferedFunction = 0x2,\n\n InstanceObject = 0x0,\n DestroyObject = 0x1\n}\n\nexport function StringToBuffer(str: string): Uint8Array {\n let string = unescape(encodeURIComponent(str)),\n charList = string.split(''),\n uintArray = [];\n for (var i = 0; i < charList.length; i++) {\n uintArray.push(charList[i].charCodeAt(0));\n }\n return new Uint8Array(uintArray);\n}\n\nexport function BufferToString(buff: Uint8Array): string {\n var encodedString = String.fromCharCode.apply(null, [].slice.call(buff)),\n decodedString = decodeURIComponent(escape(encodedString));\n return decodedString;\n}\n\nexport class AuthPayload {\n RoomID: string | undefined\n Token: string | undefined\n Hash: string | undefined\n\n Cast() {\n return {\n \"1\": this.RoomID,\n \"2\": this.Token,\n \"3\": this.Hash\n }\n }\n\n Parse(inputJ: any) {\n this.RoomID = inputJ[\"1\"]\n this.Token = inputJ[\"2\"]\n this.Hash = inputJ[\"3\"]\n }\n\n ToString(): string {\n return JSON.stringify(this.Cast())\n }\n\n ToBuffer(): Uint8Array {\n return StringToBuffer(this.ToString())\n }\n}\n\nexport class JoinPayload {\n JoinType: number | undefined\n Room: object | undefined\n UserJoined: object | undefined\n JoinMemberOrder: number | undefined\n\n Cast() {\n return {\n \"1\": this.JoinType,\n \"2\": this.Room,\n \"3\": this.UserJoined,\n \"4\": this.JoinMemberOrder\n }\n }\n\n Parse(inputJ: any) {\n this.JoinType = inputJ[\"1\"]\n let room = new Room();\n room.Parse(inputJ[\"2\"])\n this.Room = room.Export()\n this.UserJoined = inputJ[\"3\"]\n this.JoinMemberOrder = inputJ[\"4\"]\n }\n\n ToString(): string {\n return JSON.stringify(this.Cast())\n }\n\n ToBuffer(): Uint8Array {\n return StringToBuffer(this.ToString())\n }\n\n Export() {\n return {\n JoinType: this.JoinType,\n Room: this.Room,\n UserJoined: this.UserJoined,\n JoinMemberOrder: this.JoinMemberOrder,\n }\n }\n}","import { Actions } from '../../../../Utils/Consts';\nimport { GameService } from '../../../index';\nimport { Payload } from '../Command/models';\nimport { GameResult, JoinDetail, Packet, PropertyChange, Room, VoteDetail } from './models';\nimport nWebSocket from 'ws';\nimport { Log } from '../../../../Utils/Logger';\nimport { JoinPayload } from '../RealTime/models';\n\nexport class TurnBased {\n constructor(public superThis: GameService) { }\n\n turnbasedToken: string = \"\";\n RoomID: string = \"\";\n static Connection: nWebSocket | WebSocket | undefined = undefined\n\n public Initilize(RoomID: string, Endpoint: string, Port: number) {\n this.RoomID = RoomID;\n if (Endpoint == undefined || Port == undefined)\n throw `No valid area returned from Command, ${RoomID}, ${Endpoint}, ${Port}`\n\n if (typeof window === 'undefined') {\n Log(\"[TurnBased]\", `[Node] [Connecting] [ws://${Endpoint}:${Port}]`);\n TurnBased.Connection = new nWebSocket(`ws://${Endpoint}:${Port}`, { maxPayload: 1024 * 2 });\n } else {\n Log(\"[TurnBased]\", `[Browser] [Connecting] [ws://${Endpoint}:${Port}]`);\n TurnBased.Connection = new WebSocket(`ws://${Endpoint}:${Port}`);\n }\n\n TurnBased.Connection!.onopen = this.OnConnect\n TurnBased.Connection!.onmessage = this.OnReceive;\n TurnBased.Connection!.onclose = this.onDisconnect;\n TurnBased.Connection!.onerror = (err: nWebSocket.ErrorEvent) => {\n throw err;\n };\n\n }\n protected OnConnect = (e: nWebSocket.OpenEvent) => {\n // Send Auth pkt\n let payload = new Payload(this.superThis);\n payload.SetGameID(this.RoomID);\n payload.SetToken(this.superThis.Authentication.gameToken);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.TurnBased.ActionAuth);\n pkt.SetData(payload.ToString())\n pkt.Send(false);\n }\n\n protected OnReceive = (event: nWebSocket.MessageEvent) => {\n // Log(\"[TurnBased]\", `[OnReceive]: ${event.data}`);\n\n let packet = new Packet(this.superThis)\n packet.Parse(event.data, this.superThis.GSLive.Cipher != \"\");\n\n switch (packet.GetHead()) {\n case Actions.TurnBased.ActionAuth:\n this.turnbasedToken = packet.GetToken()!;\n break\n case Actions.TurnBased.ActionJoin:\n let joinData = JSON.parse(packet.GetData()!);\n let joinDetail = new JoinDetail();\n joinDetail.Parse(joinData)\n this.superThis.GSLive.TurnBased.OnJoinedRoom(joinDetail.Export())\n break\n case Actions.TurnBased.ActionTakeTurn:\n let turnData = JSON.parse(packet.GetData()!);\n this.superThis.GSLive.TurnBased.OnTakeTurn(turnData[\"1\"], turnData[0])\n break\n case Actions.TurnBased.ActionChooseNext:\n let nextData = JSON.parse(packet.GetData()!);\n this.superThis.GSLive.TurnBased.OnChoosedNext(nextData)\n break\n case Actions.TurnBased.ActionLeave:\n let member = JSON.parse(packet.GetData()!);\n this.superThis.GSLive.TurnBased.OnLeaveRoom(member)\n if (member!.user!.isMe) {\n TurnBased.Connection?.close()\n this.turnbasedToken = \"\"\n this.RoomID = \"\"\n TurnBased.Connection = undefined;\n }\n break\n case Actions.TurnBased.ActionVote:\n let voteDetail = JSON.parse(packet.GetData()!);\n let vote = new VoteDetail();\n vote.Parse(voteDetail);\n this.superThis.GSLive.TurnBased.OnVoteReceived(vote.Member!, vote.Outcome!)\n break\n case Actions.TurnBased.ActionAcceptVote:\n let resultdata = JSON.parse(packet.GetData()!);\n let result = new GameResult();\n result.Parse(resultdata)\n this.superThis.GSLive.TurnBased.OnComplete(result)\n break\n case Actions.TurnBased.ActionGetUsers:\n let members = JSON.parse(packet.GetData()!);\n this.superThis.GSLive.TurnBased.OnRoomMembersDetailReceived(members)\n break\n case Actions.TurnBased.ActionCurrentTurnDetail:\n let currentTurn = JSON.parse(packet.GetData()!);\n this.superThis.GSLive.TurnBased.OnCurrentTurnMember(currentTurn)\n break\n case Actions.TurnBased.ModifyValue:\n let value = JSON.parse(packet.GetData()!);\n let propertyChange = new PropertyChange();\n propertyChange.Parse(value)\n this.superThis.GSLive.TurnBased.OnPropertyUpdated(propertyChange)\n break\n case Actions.TurnBased.GetRoomInfo:\n let roomInfoS = JSON.parse(packet.GetData()!);\n let roomInfo = new Room();\n roomInfo.Parse(roomInfoS);\n this.superThis.GSLive.TurnBased.OnCurrentRoomInfoReceived(roomInfo.Export())\n break\n case Actions.Error:\n console.error(`[Error] [Msg: ${packet.GetMsg()}]`)\n break\n }\n }\n\n private onDisconnect = (event: nWebSocket.CloseEvent) => {\n if (event.wasClean) {\n Log(\"[TurnBased]\", `[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);\n } else {\n // e.g. server process killed or network down event.code is usually 1006 in this case\n Log(\"[TurnBased]\", '[close] Connection died');\n }\n this.turnbasedToken = \"\";\n }\n}","import { TurnBased } from \".\";\nimport { GameService } from '../../../index';\nimport { Member } from \"../../../Player/models\";\nimport { Outcome, PropertyType } from \"../../TurnBased/models\";\nimport { Rc4 } from \"../Command/models\";\n\nexport class Packet {\n constructor(public superThis: GameService) { }\n\n public Parse(input: any, encription: boolean = true) {\n let inputJ = JSON.parse(input)\n\n let data = inputJ[\"2\"];\n let msg = inputJ[\"3\"];\n if (this.superThis.GSLive.isEncriptionActive && encription) {\n if (inputJ[\"2\"]) data = Buffer.from(Rc4(this.superThis.GSLive.Cipher, Buffer.from(inputJ[\"2\"], 'base64').toString(\"latin1\")), \"latin1\").toString(\"utf-8\")\n if (inputJ[\"3\"]) msg = Buffer.from(Rc4(this.superThis.GSLive.Cipher, Buffer.from(inputJ[\"3\"], 'base64').toString(\"latin1\")), \"latin1\").toString(\"utf-8\")\n }\n\n this.SetToken(inputJ[\"0\"]);\n this.SetHead(inputJ[\"1\"]);\n this.SetData(data);\n this.SetMsg(msg);\n }\n\n private Token: string | undefined\n public GetToken(): string | undefined {\n return this.Token;\n }\n public SetToken(Token: string) {\n this.Token = Token;\n }\n\n private Head: number | undefined\n public GetHead(): number | undefined {\n return this.Head;\n }\n public SetHead(Head: number) {\n this.Head = Head;\n }\n\n private Data: string | undefined\n public GetData(): string | undefined {\n return this.Data;\n }\n public SetData(Data: string) {\n this.Data = Data;\n }\n\n private Msg: string | undefined\n public GetMsg(): string | undefined {\n return this.Msg;\n }\n public SetMsg(Msg: string) {\n this.Msg = Msg;\n }\n\n private Cast(encription: boolean = true) {\n if (this.superThis.GSLive.isEncriptionActive && encription) {\n if (this.Data) {\n let rc4 = Rc4(this.superThis.GSLive.Cipher, Buffer.from(this.Data!).toString(\"utf-8\"));\n let data = Buffer.from(rc4, \"latin1\").toString('base64');\n this.Data = data;\n }\n if (this.Msg) {\n let rc4 = Rc4(this.superThis.GSLive.Cipher, Buffer.from(this.Msg!).toString(\"utf-8\"));\n let msg = Buffer.from(rc4, \"latin1\").toString('base64')\n this.Msg = msg;\n }\n }\n return {\n \"0\": this.Token,\n \"1\": this.Head,\n \"2\": this.Data,\n \"3\": this.Msg\n }\n }\n ToString(encription: boolean = true): string {\n return JSON.stringify(this.Cast(encription))\n }\n Send = (encription: boolean = true) => {\n let serilized = this.ToString(encription);\n TurnBased.Connection!.send(serilized);\n }\n}\n\nexport class Room {\n public Parse(inputJ: any) {\n this.ID = inputJ[\"1\"];\n this.Name = inputJ[\"2\"];\n this.Logo = inputJ[\"3\"];\n this.Creator = inputJ[\"4\"];\n this.Min = inputJ[\"5\"];\n this.Max = inputJ[\"6\"];\n this.Role = inputJ[\"7\"];\n this.Private = inputJ[\"8\"];\n this.Status = inputJ[\"9\"];\n this.NumOfMembers = inputJ[\"10\"];\n this.Variables = inputJ[\"11\"];\n this.Persist = inputJ[\"12\"];\n this.CreatedAt = inputJ[\"13\"];\n }\n\n private _ID: string | undefined;\n public get ID(): string {\n return this._ID!;\n }\n public set ID(value: string) {\n this._ID = value;\n }\n private _Name: string | undefined = \"\";\n public get Name(): string {\n return this._Name!;\n }\n public set Name(value: string) {\n this._Name = value;\n }\n private _Logo: string | undefined;\n public get Logo(): string {\n return this._Logo!;\n }\n public set Logo(value: string) {\n this._Logo = value;\n }\n private _Creator: string | undefined;\n public get Creator(): string {\n return this._Creator!;\n }\n public set Creator(value: string) {\n this._Creator = value;\n }\n private _Min: number | undefined;\n public get Min(): number {\n return this._Min!;\n }\n public set Min(value: number) {\n this._Min = value;\n }\n private _Max: number | undefined;\n public get Max(): number {\n return this._Max!;\n }\n public set Max(value: number) {\n this._Max = value;\n }\n private _Role: string | undefined;\n public get Role(): string {\n return this._Role!;\n }\n public set Role(value: string) {\n this._Role = value;\n }\n private _Private: boolean | undefined = false;\n public get Private(): boolean {\n return this._Private!;\n }\n public set Private(value: boolean) {\n this._Private = value;\n }\n private _Status: number | undefined;\n public get Status(): number {\n return this._Status!;\n }\n public set Status(value: number) {\n this._Status = value;\n }\n private _NumOfMembers: number | undefined;\n public get NumOfMembers(): number {\n return this._NumOfMembers!;\n }\n public set NumOfMembers(value: number) {\n this._NumOfMembers = value;\n }\n private _Variables: object | undefined;\n public get Variables(): object {\n return this._Variables!;\n }\n public set Variables(value: object) {\n this._Variables = value;\n }\n private _Persist: boolean | undefined = false;\n public get Persist(): boolean {\n return this._Persist!;\n }\n public set Persist(value: boolean) {\n this._Persist = value;\n }\n private _CreatedAt: string | undefined;\n public get CreatedAt(): string {\n return this._CreatedAt!;\n }\n public set CreatedAt(value: string) {\n this._CreatedAt = value;\n }\n\n Export() {\n return {\n \"ID\": this.ID,\n \"Name\": this.Name,\n \"Logo\": this.Logo,\n \"Creator\": this.Creator,\n \"Min\": this.Min,\n \"Max\": this.Max,\n \"Role\": this.Role,\n \"Private\": this.Private,\n \"Status\": this.Status,\n \"NumOfMembers\": this.NumOfMembers,\n \"Variables\": this.Variables,\n \"Persist\": this.Persist,\n \"CreatedAt\": this.CreatedAt,\n }\n }\n\n Cast() {\n return {\n \"1\": this.ID,\n \"2\": this.Name,\n \"3\": this.Logo,\n \"4\": this.Creator,\n \"5\": this.Min,\n \"6\": this.Max,\n \"7\": this.Role,\n \"8\": this.Private,\n \"9\": this.Status,\n \"10\": this.NumOfMembers,\n \"11\": this.Variables,\n \"12\": this.Persist,\n \"13\": this.CreatedAt,\n }\n }\n ToString(): string {\n return JSON.stringify(this.Cast())\n }\n}\n\nexport class PropertyChange {\n public Parse(inputJ: any) {\n if (inputJ[\"1\"] == 1)\n this.Type = PropertyType.Room;\n else\n this.Type = PropertyType.Member;\n\n if (inputJ[\"2\"] == 3 || inputJ[\"2\"] == 1)\n this.Action = \"SetOtUpdate\";\n else\n this.Action = \"Delete\";\n this.Sender = inputJ[\"3\"];\n this.Name = inputJ[\"4\"];\n this.Value = inputJ[\"5\"];\n }\n\n Type: string | undefined\n Action: string | undefined\n Sender: object | undefined\n Name: string | undefined\n Value: string | undefined\n\n Export() {\n return {\n \"Type\": this.Type,\n \"Action\": this.Action,\n \"Sender\": this.Sender,\n \"Name\": this.Name,\n \"Value\": this.Value,\n }\n }\n}\n\nexport class JoinDetail {\n JoinType: number | undefined\n UserJoined: Member | undefined\n Room: Room | undefined\n JoinOrder: number | undefined\n\n Parse(inputJ: any) {\n let room = new Room();\n room.Parse(inputJ[\"2\"])\n\n this.JoinType = inputJ[\"1\"]\n this.UserJoined = inputJ[\"3\"]\n this.Room = room\n this.JoinOrder = inputJ[\"4\"]\n }\n\n Export() {\n return {\n JoinType: this.JoinType,\n UserJoined: this.UserJoined,\n Room: this.Room?.Export(),\n JoinOrder: this.JoinOrder\n }\n }\n}\n\nexport class VoteDetail {\n Member: object | undefined\n Outcome: { [memberID: string]: Outcome | undefined } | undefined\n\n Parse(inputJ: any) {\n this.Member = inputJ[\"0\"]\n\n let outcomes: any = {};\n for (let memberOutcome in inputJ[\"1\"]) {\n let outcome = new Outcome();\n outcome.Parse(inputJ[\"1\"][memberOutcome]);\n outcomes[memberOutcome] = outcome\n }\n this.Outcome = outcomes\n }\n}\n\nexport class GameResult {\n AcceptCount: number | undefined\n Outcome: Outcome | undefined\n\n Parse(inputJ: any) {\n this.AcceptCount = inputJ[\"Accept\"]\n let outcomes: any = {};\n for (let memberOutcome in inputJ[\"Outcomes\"]) {\n let outcome = new Outcome();\n outcome.Parse(inputJ[\"Outcomes\"][memberOutcome]);\n outcomes[memberOutcome] = outcome\n }\n this.Outcome = outcomes\n }\n}","import { GameService } from '../..';\nimport { Log } from '../../../Utils/Logger';\nimport { Actions } from '../../../Utils/Consts';\nimport { CreateRoomOptions, AutoMatchOptions, GProtocolSendType, EventPayload } from './models';\nimport { Data, Packet, Payload } from '../Controllers/Command/models';\nimport { Packet as RtPacket, Data as RtData, StringToBuffer, Types, Operations } from '../Controllers/RealTime/models';\nexport class RealTime {\n constructor(public superThis: GameService) { }\n\n // Functions\n public async CreateRoom(options: CreateRoomOptions) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n if (this.superThis.GSLive.RealTimeController.RoomID)\n throw \"User is already in game room, please left from it first.\";\n\n let data = new Data(this.superThis);\n data.SetMax(options.maxPlayer);\n data.SetMin(options.minPlayer);\n data.SetName(options.roomName);\n data.SetPassword(options.roomPassword!);\n data.SetRole(options.role);\n data.SetPersist(options.isPersist);\n data.SetPrivate(options.isPrivate);\n data.SetExtra(options.extra!);\n data.SetSyncMode(2);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionCreateRoom);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString())\n pkt.Send()\n }\n\n public async AutoMatch(options: AutoMatchOptions) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n if (this.superThis.GSLive.Command.isInAutoMatchQueue)\n throw \"User is in automatch queue already\";\n if (this.superThis.GSLive.RealTimeController.RoomID)\n throw \"User is already in game room, please left from it first.\";\n\n let data = new Data(this.superThis);\n data.SetMax(options.maxPlayer);\n data.SetMin(options.minPlayer);\n data.SetRole(options.role);\n data.SetPersist(options.isPersist);\n data.SetExtra(options.extra!);\n data.SetSyncMode(2);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionAutoMatch);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString())\n pkt.Send()\n }\n\n public async CancelAutoMatch() {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n if (!this.superThis.GSLive.Command.isInAutoMatchQueue)\n throw \"User is not in automatch queue\";\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.LeftWaitingQ);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.Send()\n }\n\n public async GetAvailableRooms(role: string, limit: number) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n let data = new Data(this.superThis);\n data.SetMax(limit);\n data.SetRole(role);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionGetRooms);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async JoinRoom(roomID: string, extra: string | undefined = undefined, password: string | undefined = undefined) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n if (this.superThis.GSLive.RealTimeController.RoomID)\n throw \"User is already in game room, please left from it first.\";\n\n let data = new Data(this.superThis);\n data.SetID(roomID);\n data.SetExtra(extra!);\n data.SetPassword(password!);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionJoinRoom);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async FindMember(query: string, limit: number) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n let data = new Data(this.superThis);\n data.SetUser(query);\n data.SetMax(limit);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionFindUser);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async InviteUser(roomID: string, userID: string) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n let data = new Data(this.superThis);\n data.SetID(roomID);\n data.SetUser(userID);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionInviteUser);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async GetInviteInbox() {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n let data = new Data(this.superThis);\n data.SetSyncMode(2);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionGetInviteList);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async AcceptInvite(inviteID: string, extra: string) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n if (this.superThis.GSLive.RealTimeController.RoomID)\n throw \"User is already in game room, please left from it first.\";\n\n let data = new Data(this.superThis);\n data.SetInvite(inviteID);\n data.SetExtra(extra)\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionAcceptInvite);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send();\n }\n\n public async GetCurrentRoomInfo() {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionRoomInfo\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Send()\n }\n\n public async GetRoomMembersDetail() {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionMembersDetail\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Send()\n }\n\n public async SendPublicMessage(data: string, sendType: GProtocolSendType) {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionPublicMessage\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Type = sendType\n packet.Payload = StringToBuffer(data);\n packet.Send()\n }\n\n public async SendPrivateMessage(recieverID: string, data: string) {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let payload = new RtData();\n payload.ReceiverID = recieverID;\n payload.Payload = StringToBuffer(data);\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionPrivateMessage\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Payload = payload.Serialize()\n packet.Send()\n }\n\n public async SetOrUpdateMemberProperty(name: string, value: string) {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let ev = new EventPayload();\n ev.Name = name;\n ev.Value = StringToBuffer(value);\n\n let payload = new RtData();\n payload.Payload = ev.Serialize();\n\n let data = new RtData();\n data.SetExtra(Types.Property, Operations.SetMemberProperty);\n data.Payload = ev.Serialize();\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionEventMessage\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Payload = data.Serialize()\n packet.Send()\n }\n\n public async RemoveMemberProperty(propertyName: string) {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let ev = new EventPayload();\n ev.Name = propertyName;\n\n let payload = new RtData();\n payload.Payload = ev.Serialize();\n\n let data = new RtData();\n data.SetExtra(Types.Property, Operations.DelMemberProperty);\n data.Payload = ev.Serialize();\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionEventMessage\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Payload = data.Serialize()\n packet.Send()\n }\n\n public async SetOrUpdateRoomProperty(name: string, value: string) {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let ev = new EventPayload();\n ev.Name = name;\n ev.Value = StringToBuffer(value);\n\n let payload = new RtData();\n payload.Payload = ev.Serialize();\n\n let data = new RtData();\n data.SetExtra(Types.Property, Operations.SetRoomProperty);\n data.Payload = ev.Serialize();\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionEventMessage\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Payload = data.Serialize()\n packet.Send()\n }\n\n public async RemoveRoomProperty(propertyName: string) {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let ev = new EventPayload();\n ev.Name = propertyName;\n\n let payload = new RtData();\n payload.Payload = ev.Serialize();\n\n let data = new RtData();\n data.SetExtra(Types.Property, Operations.DelRoomProperty);\n data.Payload = ev.Serialize();\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionEventMessage\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Payload = data.Serialize()\n packet.Send()\n }\n\n public async GetRoomProperties() {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionGetRoomSnapshot\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Send()\n }\n\n // public async GetRoomProperty(propertyName: string) {\n\n // }\n\n // public async GetMemberProperties(memberID: string) {\n\n // }\n\n // public async GetPropertyValues(propertyName: string) {\n\n // }\n\n // public async GetPropertyAndValueMembers(name: string, value: string) {\n\n // }\n\n // public async GetPropertyMembers(propertyName: string) {\n\n // }\n\n // public async GetRoomMembers() {\n\n // }\n\n public async LeaveRoom() {\n if (this.superThis.GSLive.RealTimeController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let packet = new RtPacket();\n packet.Action = Actions.RealTime.ActionLeave\n packet.Token = this.superThis.GSLive.RealTimeController.realtimeToken;\n packet.Send()\n }\n\n // Event handlers\n public OnReconnected: (sender: object, reconnectStatus: boolean) => void = () => { };\n public OnJoinedRoom: (joinData: any) => void = () => { };\n public OnAutoMatchUpdated: (e: any) => void = () => { };\n public OnAutoMatchCanceled: (e: string) => void = () => { };\n public OnAvailableRoomsReceived: (sender: object, e: object[]) => void = () => { };\n public OnFindMemberReceived: (sender: object, e: object[]) => void = () => { };\n public OnInvitationSent: (sender: object, e: object) => void = () => { };\n\n public CurrentRoomInfoReceived: (roomData: any) => void = () => { }\n public RoomMembersDetailReceived: (members: any[]) => void = () => { }\n public NewMessageReceived: (event: any) => void = () => { }\n public OnLeaveRoom: (member: any) => void = () => { }\n public OnPropertyEvent: (PropertyUpdate: any) => void = () => { }\n}","import { BufferToString, StringToBuffer } from \"../Controllers/RealTime/models\"\n\nexport enum PropertyType {\n Room = \"room\",\n Member = \"member\"\n}\n\nexport class CreateRoomOptions {\n constructor() {\n this.role = \"default\"\n this.minPlayer = 2\n this.maxPlayer = 2\n this.isPersist = false\n this.extra = undefined\n this.isPrivate = false\n this.roomPassword = undefined\n this.roomName = \"default\"\n }\n roomName: string = \"default\"\n role: string = \"default\"\n minPlayer: number = 2\n maxPlayer: number = 2\n isPrivate: boolean = false\n isPersist: boolean = false\n extra: string | undefined\n roomPassword: string | undefined\n}\n\n\nexport class AutoMatchOptions {\n constructor() {\n this.role = \"default\"\n this.minPlayer = 2\n this.maxPlayer = 2\n this.isPersist = false\n this.extra = null\n }\n role: string = \"default\"\n minPlayer: number = 2\n maxPlayer: number = 2\n isPersist: boolean = false\n extra: string | null\n}\n\nexport enum GProtocolSendType {\n UnReliable = 0,\n Reliable = 1,\n}\n\nexport enum MessageType {\n Private = 4,\n Public = 3\n}\n\nexport class EventPayload {\n Name: string = \"\";\n Value: Uint8Array = new Uint8Array();\n\n Serialize(): Uint8Array {\n let b = Buffer.alloc(2);\n b.writeUInt16LE(StringToBuffer(this.Name).length);\n let a = Buffer.alloc(2);\n a.writeUInt16LE(this.Value?.length);\n\n let source = [\n 2,\n 12,\n ...b.valueOf(),\n ...StringToBuffer(this.Name),\n 13,\n ...a.valueOf(),\n ...this.Value\n ]\n\n return new Uint8Array(source);\n }\n\n Deserialize(input: any) {\n let buff = Buffer.from(input);\n let offset = 1\n\n offset++\n let NameLength = buff.readUInt16LE(offset)\n offset += 2\n let name = buff.slice(offset, offset + NameLength);\n offset += NameLength;\n this.Name = BufferToString(name);\n\n offset++\n let ValueLength = buff.readUInt16LE(offset)\n offset += 2\n let value = buff.slice(offset, offset + ValueLength);\n offset += ValueLength;\n this.Value = value;\n }\n\n Export() {\n return {\n Name: this.Name,\n Value: BufferToString(this.Value)\n }\n }\n}","import { GameService } from '../..';\nimport { Actions } from '../../../Utils/Consts';\nimport { PropertyType, CreateRoomOptions, AutoMatchOptions, Data as TurnData, Outcome } from './models';\nimport { JoinDetail, Packet as TurnPacket, PropertyChange } from '../Controllers/ُTurnBased/models';\nimport { Data, Packet } from '../Controllers/Command/models';\nimport { Member } from '../../Player/models';\n\nexport class TurnBased {\n constructor(public superThis: GameService) { }\n\n // Functions\n public async CreateRoom(options: CreateRoomOptions) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n if (this.superThis.GSLive.TurnbasedController.RoomID)\n throw \"User is already in game room, please left from it first.\";\n\n let data = new Data(this.superThis);\n data.SetMax(options.maxPlayer);\n data.SetMin(options.minPlayer);\n data.SetName(options.roomName);\n data.SetPassword(options.roomPassword!);\n data.SetRole(options.role);\n data.SetPersist(options.isPersist);\n data.SetPrivate(options.isPrivate);\n data.SetExtra(options.extra!);\n data.SetSyncMode(1)\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionCreateRoom);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString())\n pkt.Send()\n }\n\n public async AutoMatch(options: AutoMatchOptions) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n if (this.superThis.GSLive.Command.isInAutoMatchQueue)\n throw \"User is in automatch queue already\";\n if (this.superThis.GSLive.TurnbasedController.RoomID)\n throw \"User is already in game room, please left from it first.\";\n\n let data = new Data(this.superThis);\n data.SetMax(options.maxPlayer);\n data.SetMin(options.minPlayer);\n data.SetRole(options.role);\n data.SetPersist(options.isPersist);\n data.SetExtra(options.extra!);\n data.SetSyncMode(1);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionAutoMatch);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString())\n pkt.Send()\n }\n\n public async CancelAutoMatch() {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n if (!this.superThis.GSLive.Command.isInAutoMatchQueue)\n throw \"User is not in automatch queue\";\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.LeftWaitingQ);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.Send()\n }\n\n public async GetAvailableRooms(role: string, limit: number) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n let data = new Data(this.superThis);\n data.SetMax(limit);\n data.SetRole(role);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionGetRooms);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async JoinRoom(roomID: string, extra: string | undefined = undefined, password: string | undefined = undefined) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n if (this.superThis.GSLive.TurnbasedController.RoomID)\n throw \"User is already in game room, please left from it first.\";\n\n let data = new Data(this.superThis);\n data.SetID(roomID);\n data.SetExtra(extra!);\n data.SetPassword(password!);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionJoinRoom);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async FindMember(query: string, limit: number) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n\n let data = new Data(this.superThis);\n data.SetUser(query);\n data.SetMax(limit);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionFindUser);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async InviteUser(roomID: string, userID: string) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n\n let data = new Data(this.superThis);\n data.SetID(roomID);\n data.SetUser(userID);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionInviteUser);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async GetInviteInbox() {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n\n let data = new Data(this.superThis);\n data.SetSyncMode(1);\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionGetInviteList);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send()\n }\n\n public async AcceptInvite(inviteID: string, extra: string) {\n if (this.superThis.GSLive.Command.commandToken == \"\")\n throw \"User not connected to Command Server\";\n\n if (this.superThis.GSLive.TurnbasedController.RoomID)\n throw \"User is already in game room, please left from it first.\";\n\n let data = new Data(this.superThis);\n data.SetInvite(inviteID);\n data.SetExtra(extra)\n\n let pkt = new Packet(this.superThis);\n pkt.SetHead(Actions.Command.ActionAcceptInvite);\n pkt.SetToken(this.superThis.GSLive.Command.commandToken)\n pkt.SetData(data.ToString());\n pkt.Send();\n }\n\n public async GetCurrentRoomInfo() {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.GetRoomInfo);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.Send();\n }\n\n public async GetRoomMembersDetail() {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.ActionGetUsers);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.Send();\n }\n\n public async ChooseNext(whoIsNext: string | undefined = undefined) {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let data = new TurnData(this.superThis);\n if (whoIsNext)\n data.Next = whoIsNext;\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.ActionChooseNext);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.SetData(data.ToString());\n pkt.Send();\n }\n\n public async TakeTurn(data: string | undefined, whoIsNext: string | undefined = undefined) {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let dataIn = new TurnData(this.superThis);\n if (whoIsNext)\n dataIn.Next = whoIsNext;\n dataIn.Data = data;\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.ActionTakeTurn);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.SetData(dataIn.ToString());\n pkt.Send();\n }\n\n public async GetCurrentTurnMember() {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.ActionCurrentTurnDetail);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.Send();\n }\n\n public async Vote(outcomes: { [memberID: string]: Outcome }) {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let dataIn = new TurnData(this.superThis);\n let outcomesS: any = {};\n Object.keys(outcomes).map(key => {\n outcomesS[key] = {\n \"0\": outcomes[key].Rank,\n \"1\": `${outcomes[key].Value}`\n }\n })\n dataIn.Outcomes = outcomesS;\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.ActionVote);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.SetData(dataIn.ToString());\n pkt.Send();\n }\n\n public async AcceptVote(memberID: string) {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let dataIn = new TurnData(this.superThis);\n dataIn.ID = memberID;\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.ActionAcceptVote);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.SetData(dataIn.ToString());\n pkt.Send();\n }\n\n public async SetOrUpdateProperty(type: PropertyType, data: { name: string, value: string }) {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let dataIn = new TurnData(this.superThis);\n\n dataIn.Head = 1;\n if (type === PropertyType.Room)\n dataIn.Head = 3;\n if (!data.name || data.name.length < 5 || data.name.length > 32)\n throw new Error(\"name of value should be between 5-32\");\n\n if (!data.value || data.value.length > 1024)\n throw new Error(\"value of value should less than 1024\");\n\n dataIn.ID = data.name;\n dataIn.Data = data.value;\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.ModifyValue);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.SetData(dataIn.ToString());\n pkt.Send();\n }\n\n public async RemoveProperty(type: PropertyType, name: string) {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let dataIn = new TurnData(this.superThis);\n\n dataIn.Head = 2;\n if (type === PropertyType.Room)\n dataIn.Head = 4;\n if (!name || name.length < 5 || name.length > 32)\n throw new Error(\"name of value should be between 5-32\");\n\n\n dataIn.ID = name;\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.ModifyValue);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.SetData(dataIn.ToString());\n pkt.Send();\n }\n\n public async LeaveRoom(whoIsNext: string | undefined = undefined) {\n if (this.superThis.GSLive.TurnbasedController.RoomID.length < 1)\n throw \"User is not in any game room\";\n\n let data = new TurnData(this.superThis);\n data.Next = whoIsNext;\n\n let pkt = new TurnPacket(this.superThis);\n pkt.SetHead(Actions.TurnBased.ActionLeave);\n pkt.SetToken(this.superThis.GSLive.TurnbasedController.turnbasedToken);\n pkt.SetData(data.ToString());\n pkt.Send();\n }\n\n // Event handlers\n public OnReconnected: (sender: object, reconnectStatus: boolean) => void = () => { };\n public OnJoinedRoom: (join: any) => void = () => { };\n public OnAutoMatchUpdated: (e: any) => void = () => { };\n public OnAutoMatchCanceled: (e: string) => void = () => { };\n public OnAvailableRoomsReceived: (e: object[]) => void = () => { };\n public OnFindMemberReceived: (e: object[]) => void = () => { };\n public NewInviteReceived: (e: any) => void = () => { }\n public OnInvitationSent: (e: object) => void = () => { };\n public OnInviteInboxReceived: (invites: object[]) => void = () => { };\n public OnCurrentRoomInfoReceived: (roomData: any) => void = () => { };\n public OnRoomMembersDetailReceived: (members: any[]) => void = () => { };\n public OnChoosedNext: (whoIsNext: object) => void = () => { };\n public OnTakeTurn: (sender: object, turn: object) => void = () => { };\n public OnCurrentTurnMember: (currentMember: Member) => void = () => { };\n public OnVoteReceived: (sender: object, vote: object) => void = () => { };\n public OnComplete: (gameResult: object) => void = () => { };\n public OnPropertyUpdated: (payload: PropertyChange) => void = () => { };\n public OnLeaveRoom: (member: any) => void = () => { };\n}","import { GameService } from '../../index';\n\nexport class Data {\n constructor(public superThis: GameService) { }\n\n Head: number | undefined\n ID: string | undefined\n Data: string | undefined\n Next: string | undefined\n Outcomes: object | undefined\n Private: boolean | undefined\n\n private Cast() {\n return {\n \"0\": this.Head,\n \"1\": this.ID,\n \"2\": this.Data,\n \"3\": this.Next,\n \"4\": this.Outcomes,\n \"5\": this.Private,\n }\n }\n\n ToString(): string {\n return JSON.stringify(this.Cast())\n }\n}\n\nexport enum PropertyType {\n Room = \"room\",\n Member = \"member\"\n}\n\nexport class CreateRoomOptions {\n constructor() {\n this.role = \"default\"\n this.minPlayer = 2\n this.maxPlayer = 2\n this.isPersist = false\n this.extra = undefined\n this.isPrivate = false\n this.roomPassword = undefined\n this.roomName = \"default\"\n }\n roomName: string = \"default\"\n role: string = \"default\"\n minPlayer: number = 2\n maxPlayer: number = 2\n isPrivate: boolean = false\n isPersist: boolean = false\n extra: string | undefined\n roomPassword: string | undefined\n}\n\nexport class AutoMatchOptions {\n constructor() {\n this.role = \"default\"\n this.minPlayer = 2\n this.maxPlayer = 2\n this.isPersist = false\n this.extra = null\n }\n role: string = \"default\"\n minPlayer: number = 2\n maxPlayer: number = 2\n isPersist: boolean = false\n extra: string | null\n}\n\nexport class Outcome {\n private _Value: number | undefined;\n public get Value(): number | undefined {\n return this._Value;\n }\n public set Value(value: number | undefined) {\n this._Value = value;\n }\n private _Rank: number | undefined;\n public get Rank(): number | undefined {\n return this._Rank;\n }\n public set Rank(value: number | undefined) {\n this._Rank = value;\n }\n\n Parse(inputJ: any) {\n this.Rank = inputJ[0]\n this.Value = inputJ[1]\n }\n}","import { GameService } from '..';\nimport { Chats } from '../GSLive/Chats/index';\nimport { TurnBased } from '../GSLive/TurnBased/index';\nimport { RealTime } from '../GSLive/RealTime/index';\n\nimport { Command } from './Controllers/Command';\nimport { TurnBased as TurnbasedController } from './Controllers/ُTurnBased';\nimport { RealTime as RealTimeController } from './Controllers/RealTime';\n\nimport nWebSocket from 'ws';\n\nexport class GSLive {\n constructor(public superThis: GameService) {\n // controllers\n this.Command = new Command(superThis);\n this.TurnbasedController = new TurnbasedController(superThis);\n this.RealTimeController = new RealTimeController(superThis);\n\n // functions\n this.TurnBased = new TurnBased(superThis);\n this.RealTime = new RealTime(superThis);\n this.Chats = new Chats(superThis);\n }\n\n static CommandConnection: WebSocket | nWebSocket | undefined = undefined\n Cipher: string = \"\";\n isEncriptionActive = false;\n\n IsCommandAvailable(): boolean {\n return true\n }\n IsTurnBasedAvailable(): boolean {\n return true\n }\n IsRealTimeAvailable(): boolean {\n return true\n }\n GetPing(): number {\n return 0\n }\n\n // Functions\n public Chats: Chats\n public TurnBased: TurnBased\n public RealTime: RealTime\n\n // Controllers\n public Command: Command\n public TurnbasedController: TurnbasedController\n public RealTimeController: RealTimeController\n}","import { Leaderboard, SubmitScoreResponse, LeaderBoardDetails, Score } from './models';\nimport axios from 'axios';\nimport { GameService } from '..';\nimport { Url } from '../../Utils/Consts';\nimport { Log } from '../../Utils/Logger';\n\nexport class Leaderboards {\n constructor(public superThis: GameService) { }\n\n async GetLeaderBoards(): Promise<Leaderboard[]> {\n try {\n let { data } = await axios.get(`${Url.Api.Endpoint}${Url.Api.Leaderboard}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetLeaderBoards\", data);\n\n return data.leaderboard;\n } catch (e) {\n console.error(e)\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async SubmitScore(leaderboardId: string, score: number): Promise<SubmitScoreResponse> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.LeaderboardV2}${leaderboardId}`, {\n \"value\": score,\n }, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"SubmitScore\", data);\n\n return data.leaderboard;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async GetLeaderBoardDetails(leaderboardId: string, skip: number = 0, limit: number = 25): Promise<LeaderBoardDetails> {\n try {\n let { data } = await axios.get(`${Url.Api.Endpoint}${Url.Api.LeaderboardV2}${leaderboardId}?skip=${skip}&limit=${limit}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetLeaderBoardDetails\", data);\n\n return { scores: data.scores, leaderboard: data.leaderboard };\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async GetCurrentPlayerScore(leaderboardId: string): Promise<Score> {\n try {\n let { data } = await axios.get(`${Url.Api.Endpoint}${Url.Api.LeaderboardV2}${leaderboardId}/me`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetCurrentPlayerScore\", data);\n\n return data;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n\n}","import { Url } from '../../Utils/Consts';\nimport { Member, MemberInfo, Profile, ActiveDevice } from './models';\nimport { Log } from '../../Utils/Logger';\nimport axios from 'axios';\nimport { GameService } from '..';\nimport { v4 } from 'uuid';\n\nexport class Player {\n constructor(public superThis: GameService) { }\n\n async GetCurrentPlayer(): Promise<Member> {\n try {\n let { data } = await axios.get(`${Url.Api.Endpoint}${Url.Api.GetCurrentPlayer}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetCurrentPlayer\", data);\n\n return data.data;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async GetMemberData(memberId: string): Promise<Member> {\n try {\n let { data } = await axios.get(`${Url.Api.Endpoint}${Url.Api.GetCurrentPlayer}/${memberId}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetCurrentPlayer\", data);\n\n return data;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async GetLastLoginMemberInfo(): Promise<MemberInfo> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.LastLoginInfo}`, {\n \"game\": this.superThis.ClientID,\n \"secret\": this.superThis.ClientSecret,\n \"device_id\": v4()\n }, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetLastLoginMemberInfo\", data);\n let memInfo = new MemberInfo();\n memInfo.Parse(data)\n return memInfo;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async EditCurrentPlayerProfile(input: Profile): Promise<MemberInfo> {\n try {\n let { data } = await axios.put(`${Url.Api.Endpoint}${Url.Api.GetCurrentPlayer}`,\n input.Export(),\n {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n }\n )\n\n // Log(\"EditCurrentPlayerProfile\", data);\n let memInfo = new MemberInfo();\n memInfo.Parse(data)\n return memInfo;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n\n }\n async ChangePassword(currentPassword: string, newPassword: string): Promise<boolean> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.GetCurrentUser}/changepassword`, {\n \"old_password\": currentPassword,\n \"new_password\": newPassword\n }, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"ChangePassword\", data);\n\n return data.data;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async GetActiveDevices(): Promise<ActiveDevice[]> {\n try {\n let { data } = await axios.get(`${Url.Api.Endpoint}${Url.Api.Devices}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetActiveDevices\", data);\n\n return data;\n } catch (e) {\n console.error(e)\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async RevokeActiveDevice(deviceId: string): Promise<boolean> {\n try {\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.Devices}/${deviceId}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"RevokeActiveDevice\", data);\n\n return true;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n}","export interface User {\n _id: string\n logo: string\n name: string\n email: string\n phoneNumber: string\n point: number\n isMe: boolean\n guest: boolean\n}\n\nexport interface Member {\n _id: string\n logo: string\n name: string\n label: string\n tags: string\n global_property: string\n extra: string\n user: User\n online: boolean\n}\n\nexport class MemberInfo {\n Id: string | undefined\n Logo: string | undefined\n Name: string | undefined\n Label: string | undefined\n Tags: string | undefined\n GlobalProperty: string | undefined\n Extra: string | undefined\n Email: string | undefined\n PhoneNumber: string | undefined\n\n Parse = (inputJ: any) => {\n this.Id = inputJ[\"_id\"]\n this.Logo = inputJ[\"logo\"]\n this.Name = inputJ[\"name\"]\n this.Label = inputJ[\"label\"]\n this.Tags = inputJ[\"tags\"]\n this.Extra = inputJ[\"extra\"]\n this.GlobalProperty = inputJ[\"global_property\"]\n this.Email = inputJ[\"email\"]\n this.PhoneNumber = inputJ[\"phonenumber\"]\n }\n}\n\nexport class Profile {\n Name: string | undefined\n Label: string | undefined\n Tags: string[] | undefined\n Extra: string | undefined\n GlobalProperty: string | undefined\n Options: string | undefined\n Email: string | undefined\n Mobile: string | undefined\n\n Export() {\n return {\n \"name\": this.Name,\n \"label\": this.Label,\n \"tags\": this.Tags,\n \"extra\": this.Extra,\n \"global_property\": this.GlobalProperty,\n \"options\": this.Options,\n \"email\": this.Email,\n \"mobile\": this.Mobile,\n }\n }\n}\n\nexport interface ActiveDevice {\n DeviceId: string\n method: string,\n DeviceModel: string\n DeviceName: string\n GraphicsDeviceName: string\n OperatingSystem: string\n is_current: boolean\n last_login: Date\n first_login: Date\n}","import { SaveDetails } from './models';\nimport axios from 'axios';\nimport { GameService } from '..';\nimport { Url } from '../../Utils/Consts';\nimport { Log } from '../../Utils/Logger';\n\nexport class Save {\n constructor(public superThis: GameService) { }\n\n async Set(saveName: string, saveData: string | object): Promise<SaveDetails> {\n try {\n if (typeof saveData === \"object\")\n saveData = JSON.stringify(saveData);\n let { data } = await axios.post(`${Url.Api.Endpoint}${Url.Api.SaveGame}`, {\n \"data\": saveData,\n \"name\": saveName\n }, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"SetSave\", data);\n\n return data.new;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async Get(saveName: string = \"\"): Promise<object | string> {\n try {\n let { data } = await axios.get(`${Url.Api.Endpoint}${Url.Api.SaveGame}${saveName}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetSave\", data);\n\n return data;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async Remove(saveName: string): Promise<boolean> {\n try {\n let { data } = await axios.delete(`${Url.Api.Endpoint}${Url.Api.SaveGame}${saveName}`, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"RemoveSave\", data);\n\n return true;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n}","import { Member } from '../../Player/models';\nimport { FriendData } from './models';\nimport { GameService } from '../..';\nimport { Url } from '../../../Utils/Consts';\nimport { Log } from '../../../Utils/Logger';\nimport axios from 'axios';\n\nexport class Friends {\n constructor(public superThis: GameService) { }\n\n async FindMembers(query: string, skip: number = 0, limit: number = 25): Promise<[number, Member[]]> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Friends}?q=${query}&skip=${skip}&limit=${limit}`\n let { data } = await axios.get(url, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"FindMembers\", data);\n\n return [data.count, data.list];\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async GetMyFriends(skip: number = 0, limit: number = 25): Promise<[number, Member[]]> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Friends}/me?skip=${skip}&limit=${limit}`\n let { data } = await axios.get(url, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetMyFriends\", data);\n\n return [data.count, data.list];\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async GetFriendRequests(skip: number = 0, limit: number = 25): Promise<[number, FriendData[]]> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Friends}/me/pending?skip=${skip}&limit=${limit}`\n let { data } = await axios.get(url, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"GetFriendRequests\", data);\n\n return [data.count, data.list];\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async SendFriendRequest(memberId: string): Promise<boolean> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Friends}/${memberId}`\n let { data } = await axios.post(url, undefined, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"SendFriendRequest\", data);\n\n return data.status;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async AcceptFriendRequest(memberId: string): Promise<boolean> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Friends}/${memberId}`\n let { data } = await axios.put(url, undefined, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"AcceptFriendRequest\", data);\n\n return data.status;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n async DeleteFriend(memberId: string): Promise<boolean> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Friends}/${memberId}`\n let { data } = await axios.put(url, undefined, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n Log(\"AcceptFriendRequest\", data);\n\n return data.status;\n } catch (e) {\n if (e && e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n}","import { Friends } from './Friends/index';\nimport { GameService } from '..';\n\nexport class Social {\n constructor(public superThis: GameService) {\n this.Friends = new Friends(superThis);\n }\n\n public Friends: Friends\n}","import { GetTableItemsOptions } from './models';\nimport axios from 'axios';\nimport { GameService } from '..';\nimport { Url } from '../../Utils/Consts';\nimport { Log } from '../../Utils/Logger';\n\nexport class Table {\n constructor(public superThis: GameService) { }\n\n async GetTableItems(tableId: String, options: GetTableItemsOptions = { skip: 0, limit: 25, find: undefined, rowsOwner: undefined, sort: undefined }): Promise<object[]> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Table}${tableId}?skip=${options.skip}&limit=${options.limit}`\n if (options.rowsOwner && options.rowsOwner != \"\")\n url += `&owner=${options.rowsOwner}`\n if (options.sort && options.sort[0] && options.sort[1] && options.sort[0] != \"\")\n url += `&sort=${options.sort[0]}&sortby=${options.sort[1]}`\n if (options.find && options.find[0] && options.find[1] && options.find[0] != \"\")\n url += `&conditionProperty=${options.find[0]}&conditionValue=${options.find[1]}`\n let { data } = await axios.get(url, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n // Log(\"GetTableItems\", data);\n\n return data;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n\n Aggrigation(aggrigation: object) {\n\n }\n\n async GetTableItem(tableId: string, itemId: number): Promise<object> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Table}${tableId}/${itemId}`\n let { data } = await axios.get(url, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n // Log(\"GetTableItem\", data);\n\n return data.data;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n\n async AddItemToTable(tableId: string, newItem: object) {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Table}${tableId}`\n let { data } = await axios.post(url, newItem, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n // Log(\"AddItemToTable\", data);\n\n return data.data;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n\n async UpdateTableItem(tableId: string, itemId: number, editedItem: object): Promise<object> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Table}${tableId}/${itemId}`\n let { data } = await axios.put(url, editedItem, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n // Log(\"UpdateTableItem\", data);\n\n return data.data;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n\n async DeleteTableItem(tableId: string, itemId: number): Promise<boolean> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Table}${tableId}/${itemId}`\n let { data } = await axios.delete(url, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n // Log(\"DeleteTableItem\", data);\n\n return data.status;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n\n async DeleteAllTableItems(tableId: string): Promise<boolean> {\n try {\n let url = `${Url.Api.Endpoint}${Url.Api.Table}${tableId}`\n let { data } = await axios.delete(url, {\n headers: {\n \"x-access-token\": this.superThis.Authentication.gameToken\n }\n })\n\n // Log(\"DeleteTableItems\", data);\n\n return data.status;\n } catch (e) {\n if (e.response) {\n throw e.response.data.msg\n } else\n throw e\n }\n }\n}","import { Authentication } from \"./Authentication/index\";\nimport Errors from '../Utils/Errors';\nimport { Assets } from \"./Assets/index\";\nimport { Leaderboards } from \"./Leaderboards/index\";\nimport { Achievements } from \"./Achievements/index\";\nimport { Player } from \"./Player/index\";\nimport { Save } from \"./Save/index\";\nimport { Table } from \"./Table/index\";\nimport { GSLive } from \"./GSLive/index\";\nimport { Social } from \"./Social/index\";\n\nexport class GameService {\n\n ClientID: string = \"\";\n ClientSecret: string = \"\";\n Verbose: boolean = false;\n\n constructor(clientId: string, clientSecret: string, Verbose: boolean = true) {\n if (typeof clientId !== 'string' || typeof clientSecret !== 'string')\n throw new Error(Errors.Internal.InvalidInput)\n\n this.ClientID = clientId;\n this.ClientSecret = clientSecret;\n this.Verbose = Verbose;\n\n this.Authentication = new Authentication(this)\n this.Assets = new Assets(this)\n this.Achievements = new Achievements(this)\n this.Leaderboards = new Leaderboards(this)\n this.Player = new Player(this)\n this.Save = new Save(this)\n this.Table = new Table(this)\n this.GSLive = new GSLive(this)\n this.Social = new Social(this)\n }\n\n IsAuthenticated(): boolean {\n return this.Authentication.gameToken != \"\"\n }\n\n\n IsCommandAvailabe(): boolean {\n return GSLive.CommandConnection?.readyState === WebSocket.OPEN && this.GSLive.Command.commandToken != \"\"\n }\n\n // Functions \n Authentication: Authentication\n Assets: Assets\n Achievements: Achievements\n Leaderboards: Leaderboards\n Player: Player\n Save: Save\n Table: Table\n GSLive: GSLive\n Social: Social\n\n // Events\n onReady: Function = () => { }\n}\n","enum ApiUrls {\n Endpoint = \"https://api.gamesservice.ir\",\n // Endpoint = \"http://localhost:4001\",\n\n Login = \"/auth/app/login\",\n Start = \"/auth/start\",\n SMSAuth = \"/auth/phone\",\n SMSAuthCallback = \"/Auth/phone/callback\",\n GetCurrentPlayer = \"/v1/member/\",\n GetCurrentUser = \"/v1/User\",\n LastLoginInfo = \"/auth/app/login/info\",\n Devices = \"/v1/devices\",\n GetAchievements = \"/v1/achievement\",\n GetAchievementsv2 = \"/v2/achievement\",\n DownloadAssets = \"/game/\",\n SaveGame = \"/v1/savegame/\",\n Leaderboard = \"/v1/leaderboard/\",\n LeaderboardV2 = \"/v2/leaderboard/\",\n Table = \"/v1/bucket/\",\n Friends = \"/v1/friends\"\n}\n\nenum DBaaSUrls {\n Endpoint = \"https://dbaas.gamesservice.ir\",\n}\n\nenum CommandUrls {\n // Endpoint = \"wss://command-ws.gamesservice.ir\",\n Endpoint = \"ws://localhost:3004\",\n}\n\n\nlet Url = {\n Api: ApiUrls,\n DBaaS: DBaaSUrls,\n Command: CommandUrls,\n}\n\nenum CommandActions {\n ActionAuth = 0,\n ActionAutoMatch = 1,\n ActionCreateRoom = 2,\n ActionGetRooms = 3,\n ActionJoinRoom = 4,\n ActionPing = 5,\n ActionInviteUser = 6,\n ActionKickUser = 7,\n ActionGetInviteList = 8,\n ActionAcceptInvite = 9,\n ActionFindUser = 10,\n ActionNotification = 11,\n ActionInviteNotif = 15,\n ActionMirror = 99,\n LeftWaitingQ = 16,\n\n // chat service\n ActionSubscribe = 12,\n ActionPrivateChat = 18,\n ActionChat = 13,\n ActionUnSubscribe = 14,\n ActionGetSubscribedChannels = 17,\n ActionGetMembersOfChannel = 19,\n ActionGetLastGroupMessages = 20,\n ActionGetPendingMessages = 21,\n}\n\nenum TurnBasedActions {\n ActionAuth = 1,\n ActionPing = 2,\n ActionCreate = 10,\n ActionJoin = 11,\n ActionTakeTurn = 4,\n ActionChooseNext = 5,\n ActionLeave = 6,\n ActionVote = 7,\n ActionAcceptVote = 8,\n ActionGetUsers = 9,\n ActionCurrentTurnDetail = 12,\n ModifyValue = 13,\n ModifyRoomValue = 16,\n GetRoomInfo = 14,\n GetMemberSnapShot = 15,\n}\n\nenum RealTimeActions {\n ActionAuth = 1,\n ActionData = 2,\n ActionPublicMessage = 3,\n ActionPrivateMessage = 4,\n ActionJoin = 5,\n ActionMembersDetail = 6,\n ActionLeave = 7,\n ActionDestroy = 8,\n ActionStatus = 9,\n ActionMirror = 10,\n ActionEventMessage = 11,\n ActionGetRoomSnapshot = 12,\n ActionObserver = 13,\n ActionRoomInfo = 14,\n}\n\nlet Actions = {\n Command: CommandActions,\n TurnBased: TurnBasedActions,\n RealTime: RealTimeActions,\n Error: 100\n}\n\nexport { Url, Actions };\n","\nenum Internal {\n InvalidInput = \"Check input parameters of function\"\n}\n\nenum Command{\n INVALID_ID = \"Request input's are not valid\"\n}\n\nexport default {\n Internal,\n Command\n}","export function Log(location: string, input: any) {\n console.log(location, input);\n}","import { v4 } from 'uuid';\n\nexport function get() {\n let statis = {\n // PackageName:,\n // SDKVersion:,\n // VersionName:,\n // VersionCode:,\n // OSAPILevel:,\n // Device:,\n DeviceID: v4(),\n // From:,\n // Model:,\n // Product:,\n // CarrierName:,\n // Manufacturer:,\n // OtherTAGS:,\n // ScreenWidth:,\n // ScreenHeight:,\n // SDCardState:,\n // GameOrientation:,\n // NetworkType:,\n // MACAddress:,\n // IPAddress:,\n // DeviceName:,\n // DeviceModel:,\n // DeviceType:,\n // OperatingSystem:,\n // ProcessorType:,\n // ProcessorCount:,\n // ProcessorFrequency:,\n // GraphicsDeviceName:,\n // GraphicsDeviceVendor:,\n // GraphicsMemorySize:\n };\n return JSON.stringify(statis);\n}","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","'use strict';\n\nmodule.exports = function () {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","import { GameService } from './GameService/index';\nexport default GameService"],"sourceRoot":""}