64 lines
1.4 KiB
JavaScript
Executable File
64 lines
1.4 KiB
JavaScript
Executable File
|
|
var httpclient = require('../common/httpclient');
|
|
var urlbuilder = require('../common/urlbuilder');
|
|
|
|
module.exports = {
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {},
|
|
|
|
// start () {},
|
|
|
|
// update (dt) {},
|
|
_heart(){
|
|
this.urlbd.clear();
|
|
this.urlbd.addKV('c', 'Stat')
|
|
.addKV('a', 'updateSession')
|
|
.addKV('session_id', this.sessionid)
|
|
.addKV('account_id', this.accountid);
|
|
httpclient.httpGet(this.urlbd.baseurl, (res) => {
|
|
if(!this.isoffical){
|
|
//console.log('[stat.heart]'+res);
|
|
}
|
|
}, (err, errmsg) => {
|
|
if(!this.isoffical){
|
|
//console.log('[stat.heart]Err:'+err+'|'+errmsg);
|
|
}
|
|
});
|
|
},
|
|
|
|
init(channelid, gameid, isoffical, owner, url){
|
|
this.owner = owner;
|
|
this.gameid = gameid;
|
|
this.channelid = channelid;
|
|
this.isoffical = isoffical;
|
|
this.urlbd = new urlbuilder(url);
|
|
//console.log("[jcstat]init:"+gameid + "|" + channelid + "|" + isoffical);
|
|
},
|
|
|
|
setAccountID(accountid, sessionid){
|
|
this.accountid = accountid;
|
|
this.sessionid = sessionid;
|
|
this._heart();
|
|
setInterval(() => {
|
|
this._heart();
|
|
}, 300000);
|
|
},
|
|
|
|
setNickName(nickname){
|
|
this.nickname = nickname;
|
|
},
|
|
|
|
setFromAppID(appid){
|
|
this.fromid = appid;
|
|
},
|
|
|
|
setLocalUUID(uuid){
|
|
this.localid = uuid;
|
|
},
|
|
|
|
setSystemInfo(info){
|
|
|
|
},
|
|
};
|