|
@@ -122,7 +122,7 @@ var Table = function (cPlayerId,cUserId,cName,cHead,game, id, cell, round, type,
|
|
|
this.ydxwin = 0; //所有玩家押大小总赢得
|
|
this.ydxwin = 0; //所有玩家押大小总赢得
|
|
|
this.ydxxh = 0; //所有玩家押大小总消耗(总下注-总赢得)
|
|
this.ydxxh = 0; //所有玩家押大小总消耗(总下注-总赢得)
|
|
|
this.ydxzcs = 0; //该日押大小总次数
|
|
this.ydxzcs = 0; //该日押大小总次数
|
|
|
- this.allrwq = 0; //所有奖券产生总量
|
|
|
|
|
|
|
+ this.allrwq = 0; //所有奖券产生总量
|
|
|
this.rwxhjq1 = 0; //钻石任务消耗奖券总量(领任务时记录)
|
|
this.rwxhjq1 = 0; //钻石任务消耗奖券总量(领任务时记录)
|
|
|
this.rwxhjq2 = 0; //RMB任务消耗奖券总量(领任务时记录)
|
|
this.rwxhjq2 = 0; //RMB任务消耗奖券总量(领任务时记录)
|
|
|
this.rwdcze1 = 0; //钻石任务兑出总额(领奖时记录)
|
|
this.rwdcze1 = 0; //钻石任务兑出总额(领奖时记录)
|
|
@@ -241,7 +241,7 @@ proto.isOnline = function () {
|
|
|
|
|
|
|
|
// 重置本局
|
|
// 重置本局
|
|
|
proto.resetRound = function () {
|
|
proto.resetRound = function () {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 发送消息
|
|
// 发送消息
|
|
@@ -313,7 +313,7 @@ proto.getTableInfo = function () {
|
|
|
yxndlbTime:this.yxndlbTime,
|
|
yxndlbTime:this.yxndlbTime,
|
|
|
yxndlbTip:this.yxndlbTip,
|
|
yxndlbTip:this.yxndlbTip,
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 桌上玩家
|
|
// 桌上玩家
|
|
|
for (let i = 0; i < this.users.length; ++i) {
|
|
for (let i = 0; i < this.users.length; ++i) {
|
|
|
let user = this.users[i];
|
|
let user = this.users[i];
|
|
@@ -323,7 +323,7 @@ proto.getTableInfo = function () {
|
|
|
let score = 0;
|
|
let score = 0;
|
|
|
let uinfo = {
|
|
let uinfo = {
|
|
|
account: user.account, name: user.name, sex: user.sex, headurl: user.headurl,
|
|
account: user.account, name: user.name, sex: user.sex, headurl: user.headurl,
|
|
|
- diamond:user.diamond, state: user.state2, taskQuan: user.taskQuan,
|
|
|
|
|
|
|
+ diamond:user.diamond, state: user.state2, taskQuan: user.taskQuan,
|
|
|
drCount: user.drCount,chairId: user.chairId
|
|
drCount: user.drCount,chairId: user.chairId
|
|
|
};
|
|
};
|
|
|
console.warn("uinfo:",uinfo)
|
|
console.warn("uinfo:",uinfo)
|
|
@@ -551,7 +551,7 @@ proto.joinAsync = cor(function* (user) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
console.warn("500")
|
|
console.warn("500")
|
|
@@ -565,7 +565,7 @@ proto.joinAsync = cor(function* (user) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
user.diamond = user.diamond.toFixed(2)
|
|
user.diamond = user.diamond.toFixed(2)
|
|
|
- let str3 = "加入水果 "+ this.nowDiamond2 +" ud "+user.diamond + " drCount " + drCount;
|
|
|
|
|
|
|
+ let str3 = "加入水果 "+ this.nowDiamond2 +" ud "+user.diamond + " drCount " + drCount;
|
|
|
if(this.users.length == 0) {
|
|
if(this.users.length == 0) {
|
|
|
this.users[0] = user;
|
|
this.users[0] = user;
|
|
|
// this.score.addUser(user.id,0,user.userId, user.name, user.sex, user.headurl,user.diamond,this.gameKindTL);
|
|
// this.score.addUser(user.id,0,user.userId, user.name, user.sex, user.headurl,user.diamond,this.gameKindTL);
|
|
@@ -577,7 +577,7 @@ proto.joinAsync = cor(function* (user) {
|
|
|
// console.warn("加入桌子 user.taskQuan222 ",user.taskQuan,user.diamond);
|
|
// console.warn("加入桌子 user.taskQuan222 ",user.taskQuan,user.diamond);
|
|
|
this.nowDiamond = user.diamond;//玩家目前游戏内的钻石(带入的)
|
|
this.nowDiamond = user.diamond;//玩家目前游戏内的钻石(带入的)
|
|
|
this.nowDiamond2 = user.diamond;//玩家目前游戏外的钻石(所有的减去带入的)
|
|
this.nowDiamond2 = user.diamond;//玩家目前游戏外的钻石(所有的减去带入的)
|
|
|
- str3 += "这里赋值 "+ this.nowDiamond2 +" ud2 "+user.diamond;
|
|
|
|
|
|
|
+ str3 += "这里赋值 "+ this.nowDiamond2 +" ud2 "+user.diamond;
|
|
|
}
|
|
}
|
|
|
logger.warn(str3);////cssj
|
|
logger.warn(str3);////cssj
|
|
|
// 加入桌子之后
|
|
// 加入桌子之后
|
|
@@ -708,7 +708,7 @@ proto.zsbgjlAsync = cor(function* (user, chairId) {
|
|
|
ydxwin: this.ydxwin, //所有玩家押大小总赢得
|
|
ydxwin: this.ydxwin, //所有玩家押大小总赢得
|
|
|
ydxxh: this.ydxxh, //所有玩家押大小总消耗(总赢得 - 总下注)
|
|
ydxxh: this.ydxxh, //所有玩家押大小总消耗(总赢得 - 总下注)
|
|
|
ydxzcs: this.ydxzcs, //该日押大小总次数
|
|
ydxzcs: this.ydxzcs, //该日押大小总次数
|
|
|
- allrwq: this.allrwq, //所有奖券产生总量
|
|
|
|
|
|
|
+ allrwq: this.allrwq, //所有奖券产生总量
|
|
|
rwxhjq1: this.rwxhjq1, //钻石任务消耗奖券总量(领任务时记录)
|
|
rwxhjq1: this.rwxhjq1, //钻石任务消耗奖券总量(领任务时记录)
|
|
|
rwxhjq2: this.rwxhjq2, //RMB任务消耗奖券总量(领任务时记录)
|
|
rwxhjq2: this.rwxhjq2, //RMB任务消耗奖券总量(领任务时记录)
|
|
|
rwdcze1: this.rwdcze1, //钻石任务兑出总额(领奖时记录)
|
|
rwdcze1: this.rwdcze1, //钻石任务兑出总额(领奖时记录)
|
|
@@ -752,8 +752,8 @@ proto.zsbgjlAsync = cor(function* (user, chairId) {
|
|
|
let allydze = [];
|
|
let allydze = [];
|
|
|
let gxzydze = [];
|
|
let gxzydze = [];
|
|
|
let gxcxzcs = [];
|
|
let gxcxzcs = [];
|
|
|
- let tsxzydze = [];
|
|
|
|
|
- let tsxcxzcs = [];
|
|
|
|
|
|
|
+ let tsxzydze = [];
|
|
|
|
|
+ let tsxcxzcs = [];
|
|
|
// 下面这两个数据是长度为8的数组,分别代表[苹果,橙子,芒果,铃铛,西瓜,星星,七七,王王]
|
|
// 下面这两个数据是长度为8的数组,分别代表[苹果,橙子,芒果,铃铛,西瓜,星星,七七,王王]
|
|
|
for (var i = 0; i < sgjztj.allyzze.length; i++) {
|
|
for (var i = 0; i < sgjztj.allyzze.length; i++) {
|
|
|
allyzze[i] = sgjztj.allyzze[i] + this.allyzze[i];
|
|
allyzze[i] = sgjztj.allyzze[i] + this.allyzze[i];
|
|
@@ -806,7 +806,7 @@ proto.zsbgjlAsync = cor(function* (user, chairId) {
|
|
|
ydxCost: this.ydxCost, //所有玩家押大小总下注
|
|
ydxCost: this.ydxCost, //所有玩家押大小总下注
|
|
|
ydxwin: this.ydxwin, //所有玩家押大小总赢得
|
|
ydxwin: this.ydxwin, //所有玩家押大小总赢得
|
|
|
ydxxh: this.ydxxh, //所有玩家押大小总消耗(总赢得 - 总下注)
|
|
ydxxh: this.ydxxh, //所有玩家押大小总消耗(总赢得 - 总下注)
|
|
|
- allrwq: this.allrwq, //所有奖券产生总量
|
|
|
|
|
|
|
+ allrwq: this.allrwq, //所有奖券产生总量
|
|
|
rwxhjq1: this.rwxhjq1, //钻石任务消耗奖券总量(领任务时记录)
|
|
rwxhjq1: this.rwxhjq1, //钻石任务消耗奖券总量(领任务时记录)
|
|
|
rwxhjq2: this.rwxhjq2, //RMB任务消耗奖券总量(领任务时记录)
|
|
rwxhjq2: this.rwxhjq2, //RMB任务消耗奖券总量(领任务时记录)
|
|
|
rwxhjq3: 0, //备用任务1消耗奖券总量(领任务时记录)
|
|
rwxhjq3: 0, //备用任务1消耗奖券总量(领任务时记录)
|
|
@@ -894,7 +894,7 @@ proto.beforeLeaveAsync = cor(function* (user) {
|
|
|
|
|
|
|
|
// 离开桌子之后
|
|
// 离开桌子之后
|
|
|
proto.afterLeaveAsync = cor(function* (user) {
|
|
proto.afterLeaveAsync = cor(function* (user) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 离开通知
|
|
// 离开通知
|
|
|
/////TL++zsyl 在此之前离开玩家已经从玩家列表或者旁观者列表中删除了所以把下面这句提到前面去了
|
|
/////TL++zsyl 在此之前离开玩家已经从玩家列表或者旁观者列表中删除了所以把下面这句提到前面去了
|
|
|
return this.pushMsgAsync(-1, 'shuiguo_event', { type: M.LEAVE, data: { account: user.account } });
|
|
return this.pushMsgAsync(-1, 'shuiguo_event', { type: M.LEAVE, data: { account: user.account } });
|
|
@@ -935,21 +935,21 @@ proto.overTableAsync = cor(function* (user) {
|
|
|
// 得到战绩
|
|
// 得到战绩
|
|
|
proto.getRecordAsync = P.coroutine(function* (user) {
|
|
proto.getRecordAsync = P.coroutine(function* (user) {
|
|
|
// console.warn("得到战绩 "+user.id);
|
|
// console.warn("得到战绩 "+user.id);
|
|
|
- var opts = {
|
|
|
|
|
|
|
+ var opts = {
|
|
|
ownerId:user.id//time: { $gte: startTime, $lt: endTime },
|
|
ownerId:user.id//time: { $gte: startTime, $lt: endTime },
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
var list = yield this.app.models.SGJTables.findMongoAsync(opts, 'ownerId time gameCost yazhuList resultList winsList win bsIndex scoreBefore scoreEnd', { sort: { time: -1 } ,limit:25});
|
|
var list = yield this.app.models.SGJTables.findMongoAsync(opts, 'ownerId time gameCost yazhuList resultList winsList win bsIndex scoreBefore scoreEnd', { sort: { time: -1 } ,limit:25});
|
|
|
// console.warn("战绩-------------------length",list.length);
|
|
// console.warn("战绩-------------------length",list.length);
|
|
|
let records = [];
|
|
let records = [];
|
|
|
- let nowTime = Date.now();//当前时间戳
|
|
|
|
|
|
|
+ let nowTime = Date.now();//当前时间戳
|
|
|
for (let i = 0; i < list.length; ++i) {
|
|
for (let i = 0; i < list.length; ++i) {
|
|
|
// console.warn("战绩条目 "+i+" "+JSON.stringify(list[i]));
|
|
// console.warn("战绩条目 "+i+" "+JSON.stringify(list[i]));
|
|
|
if(list[i].time + 8000 > nowTime) continue;
|
|
if(list[i].time + 8000 > nowTime) continue;
|
|
|
let item = {
|
|
let item = {
|
|
|
time:list[i].time,
|
|
time:list[i].time,
|
|
|
gameCost:list[i].gameCost,
|
|
gameCost:list[i].gameCost,
|
|
|
- yazhuList:list[i].yazhuList,
|
|
|
|
|
|
|
+ yazhuList:list[i].yazhuList,
|
|
|
resultList:list[i].resultList,
|
|
resultList:list[i].resultList,
|
|
|
win:list[i].scoreEnd - list[i].scoreBefore,
|
|
win:list[i].scoreEnd - list[i].scoreBefore,
|
|
|
bsIndex:list[i].bsIndex
|
|
bsIndex:list[i].bsIndex
|
|
@@ -969,7 +969,7 @@ proto.getjzjrldzcz = cor(function* () {
|
|
|
if (player) totalMoney = player.totalMoney;
|
|
if (player) totalMoney = player.totalMoney;
|
|
|
if(totalMoney > 0){
|
|
if(totalMoney > 0){
|
|
|
let jrgwjzcz = 0;//今日该玩家总充值
|
|
let jrgwjzcz = 0;//今日该玩家总充值
|
|
|
- let opts3 = {
|
|
|
|
|
|
|
+ let opts3 = {
|
|
|
playerId: this.ownerId,
|
|
playerId: this.ownerId,
|
|
|
paystate: 1,
|
|
paystate: 1,
|
|
|
time: { $gte: jrStart, $lt: jrStart+86400000}
|
|
time: { $gte: jrStart, $lt: jrStart+86400000}
|
|
@@ -1010,7 +1010,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
|
|
|
this.ydxwin = 0; //所有玩家押大小总赢得
|
|
this.ydxwin = 0; //所有玩家押大小总赢得
|
|
|
this.ydxxh = 0; //所有玩家押大小总消耗(总下注-总赢得)
|
|
this.ydxxh = 0; //所有玩家押大小总消耗(总下注-总赢得)
|
|
|
this.ydxzcs = 0; //该日押大小总次数
|
|
this.ydxzcs = 0; //该日押大小总次数
|
|
|
- this.allrwq = 0; //所有奖券产生总量
|
|
|
|
|
|
|
+ this.allrwq = 0; //所有奖券产生总量
|
|
|
this.rwxhjq1 = 0; //钻石任务消耗奖券总量(领任务时记录)
|
|
this.rwxhjq1 = 0; //钻石任务消耗奖券总量(领任务时记录)
|
|
|
this.rwxhjq2 = 0; //RMB任务消耗奖券总量(领任务时记录)
|
|
this.rwxhjq2 = 0; //RMB任务消耗奖券总量(领任务时记录)
|
|
|
this.rwdcze1 = 0; //钻石任务兑出总额(领奖时记录)
|
|
this.rwdcze1 = 0; //钻石任务兑出总额(领奖时记录)
|
|
@@ -1018,7 +1018,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
|
|
|
this.allCost = 0; //所有玩家总下注
|
|
this.allCost = 0; //所有玩家总下注
|
|
|
this.allwin = 0; //所有玩家总赢得
|
|
this.allwin = 0; //所有玩家总赢得
|
|
|
this.allxh = 0; //所有玩家总消耗(总下注-总赢得)
|
|
this.allxh = 0; //所有玩家总消耗(总下注-总赢得)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 下面这两个数据是长度为8的数组,分别代表[苹果,橙子,芒果,铃铛,西瓜,星星,七七,王王]
|
|
// 下面这两个数据是长度为8的数组,分别代表[苹果,橙子,芒果,铃铛,西瓜,星星,七七,王王]
|
|
|
this.allyzze = []; //总押注总额列表
|
|
this.allyzze = []; //总押注总额列表
|
|
|
this.allydze = []; //总赢得总额列表(不包含特殊项)
|
|
this.allydze = []; //总赢得总额列表(不包含特殊项)
|
|
@@ -1053,7 +1053,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
|
|
|
// console.warn("创建水果机排行榜已发奖励的日期 ");
|
|
// console.warn("创建水果机排行榜已发奖励的日期 ");
|
|
|
}
|
|
}
|
|
|
this.wjrwxylb = _.fill(Array(this.logic.cardKindCount), 0);//玩家已领未完成任务需要的任务要求列表
|
|
this.wjrwxylb = _.fill(Array(this.logic.cardKindCount), 0);//玩家已领未完成任务需要的任务要求列表
|
|
|
- let opts0 = {
|
|
|
|
|
|
|
+ let opts0 = {
|
|
|
playerId: playerId,
|
|
playerId: playerId,
|
|
|
state:0,//已领未完成
|
|
state:0,//已领未完成
|
|
|
};
|
|
};
|
|
@@ -1071,7 +1071,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
|
|
|
// console.warn("玩家已领未完成任务需要的任务要求列表 ",ylwwcrwList.length,this.wjrwxylb);
|
|
// console.warn("玩家已领未完成任务需要的任务要求列表 ",ylwwcrwList.length,this.wjrwxylb);
|
|
|
//统计数据赋初始值结束
|
|
//统计数据赋初始值结束
|
|
|
if(this.over > 0){
|
|
if(this.over > 0){
|
|
|
- var data = {
|
|
|
|
|
|
|
+ var data = {
|
|
|
diamond: this.nowDiamond2,
|
|
diamond: this.nowDiamond2,
|
|
|
drCount: user.drCount - this.win,
|
|
drCount: user.drCount - this.win,
|
|
|
}
|
|
}
|
|
@@ -1079,7 +1079,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
|
|
|
return { code: C.OK, data: data };
|
|
return { code: C.OK, data: data };
|
|
|
}
|
|
}
|
|
|
let drCount = Number(0);
|
|
let drCount = Number(0);
|
|
|
- let nowTime = Date.now();//当前时间戳
|
|
|
|
|
|
|
+ let nowTime = Date.now();//当前时间戳
|
|
|
let jrStart = this.logic.getTodaySJC();////今日0时的时间戳
|
|
let jrStart = this.logic.getTodaySJC();////今日0时的时间戳
|
|
|
var sgjUser = yield this.app.models.SGJUser.findByIdAsync(this.ownerId, 'jrkbcdrs drCount drTime jzjrldzcz jzjrldzczjlsj lastJoinTime');
|
|
var sgjUser = yield this.app.models.SGJUser.findByIdAsync(this.ownerId, 'jrkbcdrs drCount drTime jzjrldzcz jzjrldzczjlsj lastJoinTime');
|
|
|
if (sgjUser) {
|
|
if (sgjUser) {
|
|
@@ -1117,7 +1117,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
|
|
|
yield sgjUser.saveAsync();
|
|
yield sgjUser.saveAsync();
|
|
|
// console.warn("带入函数222=== drCount "+drCount+" ssbkdrdd "+ssbkdrdd+" sgjUser.jrkbcdrs "+sgjUser.jrkbcdrs);
|
|
// console.warn("带入函数222=== drCount "+drCount+" ssbkdrdd "+ssbkdrdd+" sgjUser.jrkbcdrs "+sgjUser.jrkbcdrs);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
else{
|
|
else{
|
|
|
drCount = Math.floor(user.diamond / this.logic.nowCell)*this.logic.nowCell;//1分=10钻石,每日上限1w分)
|
|
drCount = Math.floor(user.diamond / this.logic.nowCell)*this.logic.nowCell;//1分=10钻石,每日上限1w分)
|
|
|
sgjUser.drCount = drCount;
|
|
sgjUser.drCount = drCount;
|
|
@@ -1194,7 +1194,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
|
|
|
}
|
|
}
|
|
|
console.warn("this.nowDiamond2:",this.nowDiamond2)
|
|
console.warn("this.nowDiamond2:",this.nowDiamond2)
|
|
|
console.warn("drCount:",drCount)
|
|
console.warn("drCount:",drCount)
|
|
|
- var data = {
|
|
|
|
|
|
|
+ var data = {
|
|
|
diamond: this.nowDiamond2.toFixed(2),
|
|
diamond: this.nowDiamond2.toFixed(2),
|
|
|
drCount: drCount,
|
|
drCount: drCount,
|
|
|
}
|
|
}
|
|
@@ -1251,7 +1251,7 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
this.win = 0;//本局结果赢得分数(不包含下注的即winsList元素总和)用于判断用户是否可以押分
|
|
this.win = 0;//本局结果赢得分数(不包含下注的即winsList元素总和)用于判断用户是否可以押分
|
|
|
this.yxjlid = uuid.v1()+'_'+this.id;//ts++游戏记录id
|
|
this.yxjlid = uuid.v1()+'_'+this.id;//ts++游戏记录id
|
|
|
//ts++设置为游戏状态
|
|
//ts++设置为游戏状态
|
|
|
- for (let user of this.users)
|
|
|
|
|
|
|
+ for (let user of this.users)
|
|
|
{
|
|
{
|
|
|
if (user) {
|
|
if (user) {
|
|
|
user.state = User.STATE.PLAYING
|
|
user.state = User.STATE.PLAYING
|
|
@@ -1273,12 +1273,12 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
// this.pjhffileName[this.pjhffileName.length] = this.PJHF.getjsonFileName(0,this.recordid,this.ctime);/////TL++,用于记录玩家牌局回放的json文件名
|
|
// this.pjhffileName[this.pjhffileName.length] = this.PJHF.getjsonFileName(0,this.recordid,this.ctime);/////TL++,用于记录玩家牌局回放的json文件名
|
|
|
// // console.error("000HHHHHHHHHHHHHHHHHHHHHH",this.pjhffileName.length,this.pjhffileName);
|
|
// // console.error("000HHHHHHHHHHHHHHHHHHHHHH",this.pjhffileName.length,this.pjhffileName);
|
|
|
// this.PJHF.writePJHFJson(this.getTableInfo(),0,this.id);////在开始第一局的时候将桌子信息写入本地的json文件
|
|
// this.PJHF.writePJHFJson(this.getTableInfo(),0,this.id);////在开始第一局的时候将桌子信息写入本地的json文件
|
|
|
- // }
|
|
|
|
|
- let nowTime = Date.now();//当前时间戳
|
|
|
|
|
|
|
+ // }
|
|
|
|
|
+ let nowTime = Date.now();//当前时间戳
|
|
|
let jrStart = this.logic.getTodaySJC();////今日0时的时间戳
|
|
let jrStart = this.logic.getTodaySJC();////今日0时的时间戳
|
|
|
this.stime = nowTime;
|
|
this.stime = nowTime;
|
|
|
let scoreBefore = Number(this.nowDiamond) + Number(this.nowDiamond2);//下注之前玩家的钻石
|
|
let scoreBefore = Number(this.nowDiamond) + Number(this.nowDiamond2);//下注之前玩家的钻石
|
|
|
- this.over++;
|
|
|
|
|
|
|
+ this.over++;
|
|
|
this.yazhus = this.logic.deepCloneTL(yazhus)//玩家本场押注情况
|
|
this.yazhus = this.logic.deepCloneTL(yazhus)//玩家本场押注情况
|
|
|
let bczxz = _.sum(this.yazhus);//本次总下注
|
|
let bczxz = _.sum(this.yazhus);//本次总下注
|
|
|
console.warn("bczxz:",bczxz)
|
|
console.warn("bczxz:",bczxz)
|
|
@@ -1289,7 +1289,7 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
cjjcsjk = 2;
|
|
cjjcsjk = 2;
|
|
|
if(jcPools.levels && jcPools.levels.length > 0){
|
|
if(jcPools.levels && jcPools.levels.length > 0){
|
|
|
cjjcsjk = 3;
|
|
cjjcsjk = 3;
|
|
|
- mqdw = this.logic.getMQDW(bczxz,jcPools.levels);//得到目前挡位
|
|
|
|
|
|
|
+ mqdw = this.logic.getMQDW((bczxz/this.logic.nowCell).toFixed(2),jcPools.levels);//得到目前挡位
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(cjjcsjk < 3){
|
|
if(cjjcsjk < 3){
|
|
@@ -1335,7 +1335,7 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
ydxLowRate1: [20,20,20], // 押大小各个挡位对应的牌下限1调控比例(奖池分为几个等级,数组就有几个元素)
|
|
ydxLowRate1: [20,20,20], // 押大小各个挡位对应的牌下限1调控比例(奖池分为几个等级,数组就有几个元素)
|
|
|
ydxLowRate2: [50,50,50], // 押大小各个挡位对应的牌下限2调控比例(奖池分为几个等级,数组就有几个元素)
|
|
ydxLowRate2: [50,50,50], // 押大小各个挡位对应的牌下限2调控比例(奖池分为几个等级,数组就有几个元素)
|
|
|
ydxLowRate3: [80,80,80] // 押大小各个挡位对应的牌下限3调控比例(奖池分为几个等级,数组就有几个元素)
|
|
ydxLowRate3: [80,80,80] // 押大小各个挡位对应的牌下限3调控比例(奖池分为几个等级,数组就有几个元素)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
mqdw = this.logic.getMQDW(bczxz,sgjjc.levels);//得到目前挡位
|
|
mqdw = this.logic.getMQDW(bczxz,sgjjc.levels);//得到目前挡位
|
|
|
yield sgjjc.saveAsync();
|
|
yield sgjjc.saveAsync();
|
|
@@ -1379,7 +1379,7 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
this.users[0].drCount = this.nowDiamond.toFixed(2);
|
|
this.users[0].drCount = this.nowDiamond.toFixed(2);
|
|
|
// 水果机战绩
|
|
// 水果机战绩
|
|
|
var sgjtable = new this.app.models.SGJTables({
|
|
var sgjtable = new this.app.models.SGJTables({
|
|
|
- _id: this.yxjlid,//ts++游戏记录id,
|
|
|
|
|
|
|
+ _id: this.yxjlid,//ts++游戏记录id,
|
|
|
tableNo: this.id, // ts++房间号
|
|
tableNo: this.id, // ts++房间号
|
|
|
ownerId: this.ownerId, // 玩家标识
|
|
ownerId: this.ownerId, // 玩家标识
|
|
|
agentId: this.agentId, // 代理ID
|
|
agentId: this.agentId, // 代理ID
|
|
@@ -1432,7 +1432,7 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
sgjUser.taskQuan = this.logic.jisuanFloat(sgjUser.taskQuan,addTaskQuan,1);
|
|
sgjUser.taskQuan = this.logic.jisuanFloat(sgjUser.taskQuan,addTaskQuan,1);
|
|
|
this.users[0].taskQuan = sgjUser.taskQuan;
|
|
this.users[0].taskQuan = sgjUser.taskQuan;
|
|
|
// sgjUser.taskQuan = 0;//测试时使用
|
|
// sgjUser.taskQuan = 0;//测试时使用
|
|
|
- nowTaskQuan = sgjUser.taskQuan;
|
|
|
|
|
|
|
+ nowTaskQuan = sgjUser.taskQuan;
|
|
|
if(!this.logic.getListIsSame(sgjUser.yazhuList,this.yazhus)){
|
|
if(!this.logic.getListIsSame(sgjUser.yazhuList,this.yazhus)){
|
|
|
// console.warn("下注列表和之前不一样======== ",sgjUser.yazhuList,this.yazhus);
|
|
// console.warn("下注列表和之前不一样======== ",sgjUser.yazhuList,this.yazhus);
|
|
|
sgjUser.yazhuList = this.logic.deepCloneTL(this.yazhus)
|
|
sgjUser.yazhuList = this.logic.deepCloneTL(this.yazhus)
|
|
@@ -1447,7 +1447,7 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
// sgjUser.zfbAcc = "18511090980";
|
|
// sgjUser.zfbAcc = "18511090980";
|
|
|
// sgjUser.zfbName = "张明";
|
|
// sgjUser.zfbName = "张明";
|
|
|
// sgjUser.zfbBindTime = 1698422400000;
|
|
// sgjUser.zfbBindTime = 1698422400000;
|
|
|
- // sgjUser.taskQuan = 100000;
|
|
|
|
|
|
|
+ // sgjUser.taskQuan = 100000;
|
|
|
// }
|
|
// }
|
|
|
sgjUser.getTime = nowTime; // 获得列表更新的时间
|
|
sgjUser.getTime = nowTime; // 获得列表更新的时间
|
|
|
sgjUser.drCount = this.nowDiamond;
|
|
sgjUser.drCount = this.nowDiamond;
|
|
@@ -1579,7 +1579,7 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
this.zqqCost += bczxz; //所有玩家游戏转圈总下注
|
|
this.zqqCost += bczxz; //所有玩家游戏转圈总下注
|
|
|
this.zqqwin += win; //所有玩家游戏转圈总赢得
|
|
this.zqqwin += win; //所有玩家游戏转圈总赢得
|
|
|
this.zqqxh += bcsy*-1; //所有玩家游戏转圈总消耗(总下注-总赢得)
|
|
this.zqqxh += bcsy*-1; //所有玩家游戏转圈总消耗(总下注-总赢得)
|
|
|
- this.allrwq = this.logic.jisuanFloat(this.allrwq,addTaskQuan,1); //所有奖券产生总量
|
|
|
|
|
|
|
+ this.allrwq = this.logic.jisuanFloat(this.allrwq,addTaskQuan,1); //所有奖券产生总量
|
|
|
this.allCost += bczxz; //所有玩家总下注
|
|
this.allCost += bczxz; //所有玩家总下注
|
|
|
this.allwin += win; //所有玩家总赢得
|
|
this.allwin += win; //所有玩家总赢得
|
|
|
this.allxh += bcsy*-1; //所有玩家总消耗(总下注-总赢得)
|
|
this.allxh += bcsy*-1; //所有玩家总消耗(总下注-总赢得)
|
|
@@ -1587,11 +1587,11 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
if(!this.allyzze [i]) this.allyzze [i] = 0;
|
|
if(!this.allyzze [i]) this.allyzze [i] = 0;
|
|
|
this.allyzze [i] += this.yazhus[i]
|
|
this.allyzze [i] += this.yazhus[i]
|
|
|
console.warn("1589 this.allyzze:",this.allyzze)
|
|
console.warn("1589 this.allyzze:",this.allyzze)
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
for (var i = 0; i < winList.length; i++) {
|
|
for (var i = 0; i < winList.length; i++) {
|
|
|
if(!this.allydze [i]) this.allydze [i] = 0;
|
|
if(!this.allydze [i]) this.allydze [i] = 0;
|
|
|
this.allydze [i] += winList[i]
|
|
this.allydze [i] += winList[i]
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
if(tspx == 0){//特殊牌型,0:没有,1:小三元,2:大三元,3:大四喜
|
|
if(tspx == 0){//特殊牌型,0:没有,1:小三元,2:大三元,3:大四喜
|
|
|
this.logic.getGXXXYDZEList(this.gxzydze,xxydList);//总赢得总额列表(不包含特殊项)
|
|
this.logic.getGXXXYDZEList(this.gxzydze,xxydList);//总赢得总额列表(不包含特殊项)
|
|
|
if(handCards[0] == 9 || handCards[0] == 21) {
|
|
if(handCards[0] == 9 || handCards[0] == 21) {
|
|
@@ -1637,7 +1637,7 @@ proto.startGameAsync = cor(function* (yazhus) {
|
|
|
//
|
|
//
|
|
|
proto.taskReward = cor(function* (playerId,zfbAcc,zfbName,_getList) {
|
|
proto.taskReward = cor(function* (playerId,zfbAcc,zfbName,_getList) {
|
|
|
// if(!zfbAcc || !zfbName) return { code: C.OK };//该玩家没有支付宝信息
|
|
// if(!zfbAcc || !zfbName) return { code: C.OK };//该玩家没有支付宝信息
|
|
|
- let opts0 = {
|
|
|
|
|
|
|
+ let opts0 = {
|
|
|
playerId: playerId,
|
|
playerId: playerId,
|
|
|
state:0,
|
|
state:0,
|
|
|
wcTime:0
|
|
wcTime:0
|
|
@@ -1675,7 +1675,7 @@ proto.taskReward = cor(function* (playerId,zfbAcc,zfbName,_getList) {
|
|
|
let str4 = "table 任务要求出错---id:"+this.id +" 当前局 "+ this.over+" cd "+this.wjrwxylb.length+" playerId "+playerId;
|
|
let str4 = "table 任务要求出错---id:"+this.id +" 当前局 "+ this.over+" cd "+this.wjrwxylb.length+" playerId "+playerId;
|
|
|
logger.error(str4);////cssj
|
|
logger.error(str4);////cssj
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
logger.error("任务主键出错了没有找到记录: "+zj);
|
|
logger.error("任务主键出错了没有找到记录: "+zj);
|
|
@@ -1693,7 +1693,7 @@ proto.taskReward = cor(function* (playerId,zfbAcc,zfbName,_getList) {
|
|
|
// console.warn("发奖成功信息 ",JSON.stringify(fjres));
|
|
// console.warn("发奖成功信息 ",JSON.stringify(fjres));
|
|
|
// if(fjres.code == C.OK && fjres.data.success == true){
|
|
// if(fjres.code == C.OK && fjres.data.success == true){
|
|
|
// //发奖成功
|
|
// //发奖成功
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// for (var i = 0; i < overTaskRes.overList.length; i++) {
|
|
// for (var i = 0; i < overTaskRes.overList.length; i++) {
|
|
|
// let xb = overTaskRes.overList[i];
|
|
// let xb = overTaskRes.overList[i];
|
|
|
// let zj = ylrwList[i]._id;
|
|
// let zj = ylrwList[i]._id;
|
|
@@ -1738,7 +1738,8 @@ proto.huafenAsync = cor(function* (type,value) {
|
|
|
let jcPools = yield this.app.models.SGJJC.findByIdAsync('sgjjcs');
|
|
let jcPools = yield this.app.models.SGJJC.findByIdAsync('sgjjcs');
|
|
|
if (jcPools) {
|
|
if (jcPools) {
|
|
|
if(jcPools.ydxpools && jcPools.ydxpools.length > 0){
|
|
if(jcPools.ydxpools && jcPools.ydxpools.length > 0){
|
|
|
- mqdw = this.logic.getMQDW(value,jcPools.ydxlevels);//得到目前挡位
|
|
|
|
|
|
|
+ console.warn("value:",value)
|
|
|
|
|
+ mqdw = this.logic.getMQDW((value/this.logic.nowCell).toFixed(2),jcPools.ydxlevels);//得到目前挡位
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
let res = this.logic.getHuafenRes(type,value,mqdw,jcPools);
|
|
let res = this.logic.getHuafenRes(type,value,mqdw,jcPools);
|
|
@@ -1789,7 +1790,7 @@ proto.huafenAsync = cor(function* (type,value) {
|
|
|
let newlb = _.cloneDeep(sgjtable.huafenList);
|
|
let newlb = _.cloneDeep(sgjtable.huafenList);
|
|
|
newlb[newlb.length] = huafenItem;
|
|
newlb[newlb.length] = huafenItem;
|
|
|
sgjtable.huafenList = _.cloneDeep(newlb);
|
|
sgjtable.huafenList = _.cloneDeep(newlb);
|
|
|
- yield sgjtable.saveAsync();
|
|
|
|
|
|
|
+ yield sgjtable.saveAsync();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let nowTaskQuan = 0;
|
|
let nowTaskQuan = 0;
|
|
@@ -1836,7 +1837,7 @@ proto.huafenAsync = cor(function* (type,value) {
|
|
|
this.allrwq = this.logic.jisuanFloat(this.allrwq,addTaskQuan,1).toFixed(2); //所有奖券产生总量
|
|
this.allrwq = this.logic.jisuanFloat(this.allrwq,addTaskQuan,1).toFixed(2); //所有奖券产生总量
|
|
|
this.allCost += value; //所有玩家总下注
|
|
this.allCost += value; //所有玩家总下注
|
|
|
if(res.win >= 0) this.allwin += res.win*2; //所有玩家总赢得
|
|
if(res.win >= 0) this.allwin += res.win*2; //所有玩家总赢得
|
|
|
- this.allxh += res.win*-1; //所有玩家总消耗(总下注-总赢得)
|
|
|
|
|
|
|
+ this.allxh += res.win*-1; //所有玩家总消耗(总下注-总赢得)
|
|
|
|
|
|
|
|
let phdata = {
|
|
let phdata = {
|
|
|
bczxz: value.toFixed(2),//本次总下注
|
|
bczxz: value.toFixed(2),//本次总下注
|
|
@@ -1890,7 +1891,7 @@ proto.tjbjlmryxrs = cor(function* () {
|
|
|
let opts1 = { registerTime: { $gte: zrStart, $lt: jrStart}};
|
|
let opts1 = { registerTime: { $gte: zrStart, $lt: jrStart}};
|
|
|
let grzcrs = yield this.app.models.SGJUser.countMongoAsync(opts1);
|
|
let grzcrs = yield this.app.models.SGJUser.countMongoAsync(opts1);
|
|
|
let opts2 = { registerTime: { $gte: zrStart, $lt: jrStart},
|
|
let opts2 = { registerTime: { $gte: zrStart, $lt: jrStart},
|
|
|
- lastPlayTime: { $gte: zrStart, $lt: jrStart}};
|
|
|
|
|
|
|
+ lastPlayTime: { $gte: zrStart, $lt: jrStart}};
|
|
|
let xzyxrs = yield this.app.models.SGJUser.countMongoAsync(opts2);
|
|
let xzyxrs = yield this.app.models.SGJUser.countMongoAsync(opts2);
|
|
|
let opts3 = { lastPlayTime: { $gte: zrStart, $lt: jrStart}};
|
|
let opts3 = { lastPlayTime: { $gte: zrStart, $lt: jrStart}};
|
|
|
let grzqrs = yield this.app.models.SGJUser.countMongoAsync(opts3);
|
|
let grzqrs = yield this.app.models.SGJUser.countMongoAsync(opts3);
|
|
@@ -1956,9 +1957,9 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
|
|
|
return true;
|
|
return true;
|
|
|
} else {
|
|
} else {
|
|
|
//不是就返回false
|
|
//不是就返回false
|
|
|
- return false;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
catch (e) {
|
|
catch (e) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -1967,84 +1968,84 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
|
|
|
}
|
|
}
|
|
|
// var player = yield this.app.models.sgjUser.findByIdAsync(this.ownerId, 'zfbAcc zfbName');
|
|
// var player = yield this.app.models.sgjUser.findByIdAsync(this.ownerId, 'zfbAcc zfbName');
|
|
|
// if (player) {
|
|
// if (player) {
|
|
|
- let p = this.ownerId; //用户id
|
|
|
|
|
- // let idsList = _.cloneDeep(ywcrwzjlist);//任务主键列表数组
|
|
|
|
|
- let idsStr = "";//JSON.stringify(ywcrwzjlist);//任务主键列表字符串
|
|
|
|
|
- for (var i = 0; i < ywcrwzjlist.length; i++) {
|
|
|
|
|
- let sss = ""+ywcrwzjlist[i];
|
|
|
|
|
- if(i < ywcrwzjlist.length - 1) sss+=",";
|
|
|
|
|
- idsStr+=sss;
|
|
|
|
|
- }
|
|
|
|
|
- let t = type; // 类型 1:绑定支付宝,2:水果游戏任务奖励
|
|
|
|
|
- let r=""; // 说明
|
|
|
|
|
- let tsT = Date.now();
|
|
|
|
|
-
|
|
|
|
|
- let key = "xxxxxxx"
|
|
|
|
|
- let str1 = ""+p+idsStr+key+t+r+tsT;
|
|
|
|
|
- let md51 = md5(str1).toUpperCase();
|
|
|
|
|
- let str2 = ""+md51+tsT;
|
|
|
|
|
- let md52 = md5(str2).toUpperCase();
|
|
|
|
|
- let sign = md52;
|
|
|
|
|
- let post_data={
|
|
|
|
|
- p: p,
|
|
|
|
|
- idsStr:idsStr,
|
|
|
|
|
- t: t,
|
|
|
|
|
- r: r,
|
|
|
|
|
- tsT: tsT,
|
|
|
|
|
- s: sign
|
|
|
|
|
- };//请求数据
|
|
|
|
|
- // console.warn("任务发奖 post_data "+post_data);
|
|
|
|
|
- let reqdata = JSON.stringify(post_data);
|
|
|
|
|
- let options = {
|
|
|
|
|
- hostname: 'aa.bb.cc.com',
|
|
|
|
|
- port: '',
|
|
|
|
|
- path: '/sfM/giveOut',
|
|
|
|
|
- method: 'POST',
|
|
|
|
|
- rejectUnauthorized: false,
|
|
|
|
|
- requestCert: true,
|
|
|
|
|
- headers: {
|
|
|
|
|
- 'Content-Type': 'Application/json',
|
|
|
|
|
- "Content-Length":reqdata.length
|
|
|
|
|
|
|
+ let p = this.ownerId; //用户id
|
|
|
|
|
+ // let idsList = _.cloneDeep(ywcrwzjlist);//任务主键列表数组
|
|
|
|
|
+ let idsStr = "";//JSON.stringify(ywcrwzjlist);//任务主键列表字符串
|
|
|
|
|
+ for (var i = 0; i < ywcrwzjlist.length; i++) {
|
|
|
|
|
+ let sss = ""+ywcrwzjlist[i];
|
|
|
|
|
+ if(i < ywcrwzjlist.length - 1) sss+=",";
|
|
|
|
|
+ idsStr+=sss;
|
|
|
|
|
+ }
|
|
|
|
|
+ let t = type; // 类型 1:绑定支付宝,2:水果游戏任务奖励
|
|
|
|
|
+ let r=""; // 说明
|
|
|
|
|
+ let tsT = Date.now();
|
|
|
|
|
+
|
|
|
|
|
+ let key = "xxxxxxx"
|
|
|
|
|
+ let str1 = ""+p+idsStr+key+t+r+tsT;
|
|
|
|
|
+ let md51 = md5(str1).toUpperCase();
|
|
|
|
|
+ let str2 = ""+md51+tsT;
|
|
|
|
|
+ let md52 = md5(str2).toUpperCase();
|
|
|
|
|
+ let sign = md52;
|
|
|
|
|
+ let post_data={
|
|
|
|
|
+ p: p,
|
|
|
|
|
+ idsStr:idsStr,
|
|
|
|
|
+ t: t,
|
|
|
|
|
+ r: r,
|
|
|
|
|
+ tsT: tsT,
|
|
|
|
|
+ s: sign
|
|
|
|
|
+ };//请求数据
|
|
|
|
|
+ // console.warn("任务发奖 post_data "+post_data);
|
|
|
|
|
+ let reqdata = JSON.stringify(post_data);
|
|
|
|
|
+ let options = {
|
|
|
|
|
+ hostname: 'aa.bb.cc.com',
|
|
|
|
|
+ port: '',
|
|
|
|
|
+ path: '/sfM/giveOut',
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ rejectUnauthorized: false,
|
|
|
|
|
+ requestCert: true,
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ 'Content-Type': 'Application/json',
|
|
|
|
|
+ "Content-Length":reqdata.length
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ var req = https.request(options, function (res) {
|
|
|
|
|
+ });
|
|
|
|
|
+ req.write(reqdata);
|
|
|
|
|
+ req.on('response', function (response2) {
|
|
|
|
|
+ // console.warn("请求到这里了???222 response2.headers "+JSON.stringify(response2.headers) );
|
|
|
|
|
+ req.end();
|
|
|
|
|
+ let body2 = "";
|
|
|
|
|
+ response2.on('data', function (chunk) {
|
|
|
|
|
+ body2 = chunk.toString();
|
|
|
|
|
+ // console.warn("请求到这里了???555 chunk "+body2);
|
|
|
|
|
+ if(!getIsAJsonStr22(body2)){
|
|
|
|
|
+ console.error("接口返回值非json字符串 "+body2);
|
|
|
|
|
+ return {code: C.ERROR, msg: 114 };//"验证码发送失败"
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
- var req = https.request(options, function (res) {
|
|
|
|
|
- });
|
|
|
|
|
- req.write(reqdata);
|
|
|
|
|
- req.on('response', function (response2) {
|
|
|
|
|
- // console.warn("请求到这里了???222 response2.headers "+JSON.stringify(response2.headers) );
|
|
|
|
|
- req.end();
|
|
|
|
|
- let body2 = "";
|
|
|
|
|
- response2.on('data', function (chunk) {
|
|
|
|
|
- body2 = chunk.toString();
|
|
|
|
|
- // console.warn("请求到这里了???555 chunk "+body2);
|
|
|
|
|
- if(!getIsAJsonStr22(body2)){
|
|
|
|
|
- console.error("接口返回值非json字符串 "+body2);
|
|
|
|
|
- return {code: C.ERROR, msg: 114 };//"验证码发送失败"
|
|
|
|
|
- }
|
|
|
|
|
- let result = JSON.parse(body2);
|
|
|
|
|
- // console.warn("请求到这里了???56 chunk "+result.success);
|
|
|
|
|
- if(result.success){
|
|
|
|
|
- // console.warn("任务发奖成功 "+this.ownerId+" "+JSON.stringify(result) );
|
|
|
|
|
-
|
|
|
|
|
- return { code: C.OK, data: result};
|
|
|
|
|
- }
|
|
|
|
|
- else{
|
|
|
|
|
- console.error("任务发奖出错了 "+body2);
|
|
|
|
|
- return {code: C.ERROR, msg: 115 };//"验证码发送失败"
|
|
|
|
|
- }
|
|
|
|
|
- // console.warn("这里都到返回值了222 ")
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
- // console.warn("请求到这里了???666 body2 "+body2)
|
|
|
|
|
- });
|
|
|
|
|
- req.on('error', function (e) {
|
|
|
|
|
- req.end();
|
|
|
|
|
- console.error(new Error('request FJ error: ' + e.message));
|
|
|
|
|
- return { code: C.ERROR, msg: 116 };//"请求验证码失败"
|
|
|
|
|
|
|
+ let result = JSON.parse(body2);
|
|
|
|
|
+ // console.warn("请求到这里了???56 chunk "+result.success);
|
|
|
|
|
+ if(result.success){
|
|
|
|
|
+ // console.warn("任务发奖成功 "+this.ownerId+" "+JSON.stringify(result) );
|
|
|
|
|
+
|
|
|
|
|
+ return { code: C.OK, data: result};
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ console.error("任务发奖出错了 "+body2);
|
|
|
|
|
+ return {code: C.ERROR, msg: 115 };//"验证码发送失败"
|
|
|
|
|
+ }
|
|
|
|
|
+ // console.warn("这里都到返回值了222 ")
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
|
|
+ // console.warn("请求到这里了???666 body2 "+body2)
|
|
|
|
|
+ });
|
|
|
|
|
+ req.on('error', function (e) {
|
|
|
|
|
+ req.end();
|
|
|
|
|
+ console.error(new Error('request FJ error: ' + e.message));
|
|
|
|
|
+ return { code: C.ERROR, msg: 116 };//"请求验证码失败"
|
|
|
|
|
+ });
|
|
|
// }
|
|
// }
|
|
|
// console.warn("请求支付宝完成了 ")
|
|
// console.warn("请求支付宝完成了 ")
|
|
|
- var data = {
|
|
|
|
|
|
|
+ var data = {
|
|
|
// renwuPool: allRenWuInfo,
|
|
// renwuPool: allRenWuInfo,
|
|
|
}
|
|
}
|
|
|
return { code: C.OK, data: data };
|
|
return { code: C.OK, data: data };
|
|
@@ -2063,7 +2064,7 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
|
|
|
// //ts++写分 endtype = { 正常: 0,局数完成: 1, 房主解散: 2, 申请解散: 3 ,超时解散: 4 };
|
|
// //ts++写分 endtype = { 正常: 0,局数完成: 1, 房主解散: 2, 申请解散: 3 ,超时解散: 4 };
|
|
|
// proto.writeResultAsync2 = cor(function* (endmode) {
|
|
// proto.writeResultAsync2 = cor(function* (endmode) {
|
|
|
// logger.warn("牌局写入-------------- " + this.id );
|
|
// logger.warn("牌局写入-------------- " + this.id );
|
|
|
-// // console.warn("ts++---------牌局写入writeResultAsync",this.id);
|
|
|
|
|
|
|
+// // console.warn("ts++---------牌局写入writeResultAsync",this.id);
|
|
|
// let gameCost=0;//游戏消耗
|
|
// let gameCost=0;//游戏消耗
|
|
|
// let giftCost = 0;////道具消耗
|
|
// let giftCost = 0;////道具消耗
|
|
|
// this.etime = Date.now();
|
|
// this.etime = Date.now();
|
|
@@ -2079,9 +2080,9 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
|
|
|
// giftCost+=scorer.giftCost;
|
|
// giftCost+=scorer.giftCost;
|
|
|
// let userscore=scorer.score;
|
|
// let userscore=scorer.score;
|
|
|
// // if(this.gameKindTL == 2) userscore -= 200;
|
|
// // if(this.gameKindTL == 2) userscore -= 200;
|
|
|
-// users.push({_id: scorer.playerId,chairId:scorer.chairId,userId: scorer.userId, name: scorer.name, sex: scorer.sex, headurl: scorer.headurl,over: scorer.over, score: userscore});
|
|
|
|
|
|
|
+// users.push({_id: scorer.playerId,chairId:scorer.chairId,userId: scorer.userId, name: scorer.name, sex: scorer.sex, headurl: scorer.headurl,over: scorer.over, score: userscore});
|
|
|
// //, gameCost: scorer.gameCost,giftCost: scorer.giftCost,diamond: scorer.diamond
|
|
// //, gameCost: scorer.gameCost,giftCost: scorer.giftCost,diamond: scorer.diamond
|
|
|
-// localUsers.push({_id: scorer.playerId,userId: scorer.userId, name: scorer.name, gameCost: scorer.gameCost,giftCost: scorer.giftCost,});
|
|
|
|
|
|
|
+// localUsers.push({_id: scorer.playerId,userId: scorer.userId, name: scorer.name, gameCost: scorer.gameCost,giftCost: scorer.giftCost,});
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
// // if(this.isGameOk)////以前是解散的不算返利
|
|
// // if(this.isGameOk)////以前是解散的不算返利
|
|
@@ -2107,7 +2108,7 @@ proto.sendTaskRecord = cor(function* (type,ywcrwzjlist) {
|
|
|
// this.lconfigCommon = new configCommon(this.app);
|
|
// this.lconfigCommon = new configCommon(this.app);
|
|
|
// }
|
|
// }
|
|
|
// yield this.lconfigCommon.yxActivityAsync(scorers,this.etime);
|
|
// yield this.lconfigCommon.yxActivityAsync(scorers,this.etime);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// logger.warn("战绩写入结束--",this.id);
|
|
// logger.warn("战绩写入结束--",this.id);
|
|
|
// // return { code: C.OK };
|
|
// // return { code: C.OK };
|
|
|
|
|
|
|
@@ -2150,19 +2151,19 @@ proto.endResultAsync = cor(function* (endmode) {
|
|
|
{
|
|
{
|
|
|
yield this.pushMsgAsync(-1, 'shuiguo_event', { type: M.TABLE_JIESAN });
|
|
yield this.pushMsgAsync(-1, 'shuiguo_event', { type: M.TABLE_JIESAN });
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if(this.leaveUsers.length>0)
|
|
if(this.leaveUsers.length>0)
|
|
|
{
|
|
{
|
|
|
- this.app.timer.setTimeout(() => this.leaveUserTimeAsync(), 100);
|
|
|
|
|
|
|
+ this.app.timer.setTimeout(() => this.leaveUserTimeAsync(), 100);
|
|
|
}
|
|
}
|
|
|
var gametable = yield this.app.models.GameTable.findByIdAsync(this.recordid, '_id tableNo agentId endMode');
|
|
var gametable = yield this.app.models.GameTable.findByIdAsync(this.recordid, '_id tableNo agentId endMode');
|
|
|
if(gametable){
|
|
if(gametable){
|
|
|
gametable.endMode = 1;
|
|
gametable.endMode = 1;
|
|
|
yield gametable.saveAsync();
|
|
yield gametable.saveAsync();
|
|
|
}
|
|
}
|
|
|
- this.game.deleteTable(this.id);//ts++删除房间
|
|
|
|
|
|
|
+ this.game.deleteTable(this.id);//ts++删除房间
|
|
|
// let str5 = "table 结束信息22 关闭-id:"+this.id +"结算模式"+endmode;
|
|
// let str5 = "table 结束信息22 关闭-id:"+this.id +"结算模式"+endmode;
|
|
|
- // logger.info(str5);////cssj
|
|
|
|
|
|
|
+ // logger.info(str5);////cssj
|
|
|
}
|
|
}
|
|
|
else//普通结束
|
|
else//普通结束
|
|
|
{
|
|
{
|
|
@@ -2183,10 +2184,10 @@ proto.endResultAsync = cor(function* (endmode) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
let str7 = "table end 结束信息---id:%s "+this.id +" 结算模式 "+endmode;
|
|
let str7 = "table end 结束信息---id:%s "+this.id +" 结算模式 "+endmode;
|
|
|
logger.warn(str7);////cssj
|
|
logger.warn(str7);////cssj
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
//ts++离开用户退出定时器
|
|
//ts++离开用户退出定时器
|
|
@@ -2203,19 +2204,19 @@ proto.leaveUserTimeAsync = cor(function* () {
|
|
|
|
|
|
|
|
if(this.leaveUsers.length>0)
|
|
if(this.leaveUsers.length>0)
|
|
|
{
|
|
{
|
|
|
- this.app.timer.setTimeout(() => this.leaveUserTimeAsync(), 100);
|
|
|
|
|
|
|
+ this.app.timer.setTimeout(() => this.leaveUserTimeAsync(), 100);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 玩家信息,里面包含任务信息
|
|
// 玩家信息,里面包含任务信息
|
|
|
proto.roleInfoAsync = cor(function* (playerId,chairId) {
|
|
proto.roleInfoAsync = cor(function* (playerId,chairId) {
|
|
|
- // console.log("玩家信息玩家信息玩家信息");
|
|
|
|
|
|
|
+ // console.log("玩家信息玩家信息玩家信息");
|
|
|
var user = this.users[chairId];
|
|
var user = this.users[chairId];
|
|
|
if (!user) {
|
|
if (!user) {
|
|
|
return { code: C.FAILD, msg: C.GAME_PARAM_ERROR };
|
|
return { code: C.FAILD, msg: C.GAME_PARAM_ERROR };
|
|
|
}
|
|
}
|
|
|
- var data = {
|
|
|
|
|
|
|
+ var data = {
|
|
|
cost:0,
|
|
cost:0,
|
|
|
win:0,
|
|
win:0,
|
|
|
zfbAcc:"",
|
|
zfbAcc:"",
|
|
@@ -2256,7 +2257,7 @@ proto.setPaiHangData = cor(function* (data) {
|
|
|
if (paihang) {
|
|
if (paihang) {
|
|
|
if(data.jrStart == paihang.time1){
|
|
if(data.jrStart == paihang.time1){
|
|
|
let newcost1 = Number(paihang.cost1) + Number(data.bczxz);
|
|
let newcost1 = Number(paihang.cost1) + Number(data.bczxz);
|
|
|
- let newQuan = this.logic.jisuanFloat(paihang.quan1,data.addTaskQuan,1);
|
|
|
|
|
|
|
+ let newQuan = this.logic.jisuanFloat(paihang.quan1,data.addTaskQuan,1);
|
|
|
paihang.cost1 = newcost1;
|
|
paihang.cost1 = newcost1;
|
|
|
paihang.quan1 = newQuan;
|
|
paihang.quan1 = newQuan;
|
|
|
}
|
|
}
|
|
@@ -2302,7 +2303,7 @@ proto.setPaiHangData = cor(function* (data) {
|
|
|
}
|
|
}
|
|
|
let limit = 10;//前10名上榜
|
|
let limit = 10;//前10名上榜
|
|
|
let zrStart = data.jrStart - 86400000;////更新今日0时的时间戳
|
|
let zrStart = data.jrStart - 86400000;////更新今日0时的时间戳
|
|
|
- var opts = {
|
|
|
|
|
|
|
+ var opts = {
|
|
|
time1: zrStart,
|
|
time1: zrStart,
|
|
|
quan1: { $gt: 0}
|
|
quan1: { $gt: 0}
|
|
|
};
|
|
};
|
|
@@ -2357,7 +2358,7 @@ proto.sendPHBJL = cor(function* (list,_index) {
|
|
|
proto.getPaiHangAsync = cor(function* (playerId) {
|
|
proto.getPaiHangAsync = cor(function* (playerId) {
|
|
|
let limit = 10;//前10名上榜
|
|
let limit = 10;//前10名上榜
|
|
|
let jrStart = this.logic.getTodaySJC();////更新今日0时的时间戳
|
|
let jrStart = this.logic.getTodaySJC();////更新今日0时的时间戳
|
|
|
- var opts = {
|
|
|
|
|
|
|
+ var opts = {
|
|
|
time1: jrStart,
|
|
time1: jrStart,
|
|
|
quan1: { $gt: 0}
|
|
quan1: { $gt: 0}
|
|
|
};
|
|
};
|
|
@@ -2395,7 +2396,7 @@ proto.getPaiHangAsync = cor(function* (playerId) {
|
|
|
|
|
|
|
|
// 上传真实姓名支付宝账号
|
|
// 上传真实姓名支付宝账号
|
|
|
proto.upZFBInfoAsync = cor(function* (playerId,realName,zfbAcc) {
|
|
proto.upZFBInfoAsync = cor(function* (playerId,realName,zfbAcc) {
|
|
|
- // console.log("上传真实姓名支付宝账号");
|
|
|
|
|
|
|
+ // console.log("上传真实姓名支付宝账号");
|
|
|
let opts = { zfbAcc: zfbAcc,zfbName: realName};
|
|
let opts = { zfbAcc: zfbAcc,zfbName: realName};
|
|
|
let fields = 'zfbAcc zfbName';
|
|
let fields = 'zfbAcc zfbName';
|
|
|
var sgjUserList = yield this.app.models.SGJUser.findMongoAsync(opts, fields, { limit: 1 });
|
|
var sgjUserList = yield this.app.models.SGJUser.findMongoAsync(opts, fields, { limit: 1 });
|
|
@@ -2408,7 +2409,7 @@ proto.upZFBInfoAsync = cor(function* (playerId,realName,zfbAcc) {
|
|
|
yield sgjUser.saveAsync();
|
|
yield sgjUser.saveAsync();
|
|
|
}
|
|
}
|
|
|
yield this.sendTaskRecord(1,[]);
|
|
yield this.sendTaskRecord(1,[]);
|
|
|
- var data = {
|
|
|
|
|
|
|
+ var data = {
|
|
|
zfbAcc:zfbAcc,
|
|
zfbAcc:zfbAcc,
|
|
|
zfbName:realName
|
|
zfbName:realName
|
|
|
}
|
|
}
|
|
@@ -2417,22 +2418,22 @@ proto.upZFBInfoAsync = cor(function* (playerId,realName,zfbAcc) {
|
|
|
|
|
|
|
|
// 得到任务列表
|
|
// 得到任务列表
|
|
|
proto.getTaskInfoAsync = cor(function* (playerId,chairId) {
|
|
proto.getTaskInfoAsync = cor(function* (playerId,chairId) {
|
|
|
- console.log("玩家信息玩家信息玩家信息");
|
|
|
|
|
|
|
+ console.log("玩家信息玩家信息玩家信息");
|
|
|
var user = this.users[chairId];
|
|
var user = this.users[chairId];
|
|
|
if (!user) {
|
|
if (!user) {
|
|
|
return { code: C.FAILD, msg: C.GAME_PARAM_ERROR };
|
|
return { code: C.FAILD, msg: C.GAME_PARAM_ERROR };
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// var xxxrw = yield this.app.models.SGJTask.findByIdAsync("7abfd0a0-fe1a-11ee-996a-93780804e29f", 'fjTime state');
|
|
// var xxxrw = yield this.app.models.SGJTask.findByIdAsync("7abfd0a0-fe1a-11ee-996a-93780804e29f", 'fjTime state');
|
|
|
// if(xxxrw){
|
|
// if(xxxrw){
|
|
|
// xxxrw.state = 1;
|
|
// xxxrw.state = 1;
|
|
|
// xxxrw.fjTime = 0;
|
|
// xxxrw.fjTime = 0;
|
|
|
// yield xxxrw.saveAsync();
|
|
// yield xxxrw.saveAsync();
|
|
|
// console.warn("dakmaijfnaisfnainijn");
|
|
// console.warn("dakmaijfnaisfnainijn");
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// // yield this.app.models.SGJTask.removeAsync({_id : "abce01f0-31f8-11ef-abd5-954f4bbeb2b1"});
|
|
// // yield this.app.models.SGJTask.removeAsync({_id : "abce01f0-31f8-11ef-abd5-954f4bbeb2b1"});
|
|
|
// }
|
|
// }
|
|
|
- let opts0 = {
|
|
|
|
|
|
|
+ let opts0 = {
|
|
|
playerId: playerId,
|
|
playerId: playerId,
|
|
|
// state:0,//已领未完成
|
|
// state:0,//已领未完成
|
|
|
// wcTime:0,
|
|
// wcTime:0,
|
|
@@ -2441,7 +2442,7 @@ proto.getTaskInfoAsync = cor(function* (playerId,chairId) {
|
|
|
var ylwwcrwList = yield this.app.models.SGJTask.findMongoAsync(opts0, 'des cost reachs reachC rewardt rewards state');
|
|
var ylwwcrwList = yield this.app.models.SGJTask.findMongoAsync(opts0, 'des cost reachs reachC rewardt rewards state');
|
|
|
// console.warn("该wanjia已领取未完成或未发奖的列表 length "+ylwwcrwList.length+" ylrwList "+JSON.stringify(ylwwcrwList))
|
|
// console.warn("该wanjia已领取未完成或未发奖的列表 length "+ylwwcrwList.length+" ylrwList "+JSON.stringify(ylwwcrwList))
|
|
|
let jrStart = this.logic.getTodaySJC();////更新今日0时的时间戳
|
|
let jrStart = this.logic.getTodaySJC();////更新今日0时的时间戳
|
|
|
- let opts1 = {
|
|
|
|
|
|
|
+ let opts1 = {
|
|
|
playerId: playerId,
|
|
playerId: playerId,
|
|
|
state:3,
|
|
state:3,
|
|
|
wcTime:{ $gte: jrStart, $lt: jrStart+86400000}
|
|
wcTime:{ $gte: jrStart, $lt: jrStart+86400000}
|
|
@@ -2473,7 +2474,7 @@ proto.getTaskInfoAsync = cor(function* (playerId,chairId) {
|
|
|
sgjwjjrrwc.time = jrStart;
|
|
sgjwjjrrwc.time = jrStart;
|
|
|
yield sgjwjjrrwc.saveAsync();
|
|
yield sgjwjjrrwc.saveAsync();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
rwcList = this.logic.getWJJRRWC(ylrwList,klqhbjl);
|
|
rwcList = this.logic.getWJJRRWC(ylrwList,klqhbjl);
|
|
@@ -2485,7 +2486,7 @@ proto.getTaskInfoAsync = cor(function* (playerId,chairId) {
|
|
|
yield newsgjwjjrrwc.saveAsync();
|
|
yield newsgjwjjrrwc.saveAsync();
|
|
|
}
|
|
}
|
|
|
let allRenWuInfo = this.logic.getTasksInfo(ylrwList,rwcList)//该任务最多领取次数
|
|
let allRenWuInfo = this.logic.getTasksInfo(ylrwList,rwcList)//该任务最多领取次数
|
|
|
- var data = {
|
|
|
|
|
|
|
+ var data = {
|
|
|
renwuPool: allRenWuInfo,
|
|
renwuPool: allRenWuInfo,
|
|
|
}
|
|
}
|
|
|
return { code: C.OK, data: data };
|
|
return { code: C.OK, data: data };
|
|
@@ -2506,7 +2507,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
|
|
|
if(sgjwjjrrwc.rwcList.length > 0) {
|
|
if(sgjwjjrrwc.rwcList.length > 0) {
|
|
|
alltasks = this.logic.deepCloneTL2(sgjwjjrrwc.rwcList);
|
|
alltasks = this.logic.deepCloneTL2(sgjwjjrrwc.rwcList);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
let allCountInfo = this.logic.getATaskAllCount(item,alltasks)//该任务最多领取次数
|
|
let allCountInfo = this.logic.getATaskAllCount(item,alltasks)//该任务最多领取次数
|
|
@@ -2528,7 +2529,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
|
|
|
// if(!zfbAcc || !zfbName || !zfbBindTime){
|
|
// if(!zfbAcc || !zfbName || !zfbBindTime){
|
|
|
// return { code: C.FAILD, msg: "未绑定支付宝信息" };//领任务的时候绑定支付宝信息
|
|
// return { code: C.FAILD, msg: "未绑定支付宝信息" };//领任务的时候绑定支付宝信息
|
|
|
// }
|
|
// }
|
|
|
- let opts0 = {
|
|
|
|
|
|
|
+ let opts0 = {
|
|
|
playerId: playerId,
|
|
playerId: playerId,
|
|
|
cost: item.cost,
|
|
cost: item.cost,
|
|
|
// reachs: item.reachs,
|
|
// reachs: item.reachs,
|
|
@@ -2542,7 +2543,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
|
|
|
var ylwwcrwList = yield this.app.models.SGJTask.findMongoAsync(opts0, 'playerId cost reachs reachC rewards state ');
|
|
var ylwwcrwList = yield this.app.models.SGJTask.findMongoAsync(opts0, 'playerId cost reachs reachC rewards state ');
|
|
|
if(ylwwcrwList.length > 0) return { code: C.FAILD, msg: "请完成该任务之后再领取" };
|
|
if(ylwwcrwList.length > 0) return { code: C.FAILD, msg: "请完成该任务之后再领取" };
|
|
|
let jrStart = this.logic.getTodaySJC();////今日0时的时间戳
|
|
let jrStart = this.logic.getTodaySJC();////今日0时的时间戳
|
|
|
- let opts1 = {
|
|
|
|
|
|
|
+ let opts1 = {
|
|
|
playerId: playerId,
|
|
playerId: playerId,
|
|
|
cost: item.cost,
|
|
cost: item.cost,
|
|
|
// reachs: item.reachs,
|
|
// reachs: item.reachs,
|
|
@@ -2621,7 +2622,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
|
|
|
SGJUserTongji = SGJUserTongjis[0]
|
|
SGJUserTongji = SGJUserTongjis[0]
|
|
|
console.warn("SGJUserTongji:",SGJUserTongji)
|
|
console.warn("SGJUserTongji:",SGJUserTongji)
|
|
|
//SGJUserTongji.usdt = user.diamond,
|
|
//SGJUserTongji.usdt = user.diamond,
|
|
|
- SGJUserTongji.taskquanlose = (Number(SGJUserTongji.taskquanlose) +Number(cost)).toFixed(2)//下注
|
|
|
|
|
|
|
+ SGJUserTongji.taskquanlose = (Number(SGJUserTongji.taskquanlose) +Number(cost)).toFixed(2)//下注
|
|
|
SGJUserTongji.nowtaskquan = nowTaskQuan
|
|
SGJUserTongji.nowtaskquan = nowTaskQuan
|
|
|
yield SGJUserTongji.saveAsync()
|
|
yield SGJUserTongji.saveAsync()
|
|
|
}
|
|
}
|
|
@@ -2635,7 +2636,7 @@ proto.dealRenWuAsync = cor(function* (playerId,chairId,item) {
|
|
|
}
|
|
}
|
|
|
// console.warn("领取任务 玩家已领未完成任务需要的任务要求列表 ",this.wjrwxylb);
|
|
// console.warn("领取任务 玩家已领未完成任务需要的任务要求列表 ",this.wjrwxylb);
|
|
|
ylcs++;
|
|
ylcs++;
|
|
|
- var data = {
|
|
|
|
|
|
|
+ var data = {
|
|
|
nowTaskQuan:nowTaskQuan.toFixed(2),
|
|
nowTaskQuan:nowTaskQuan.toFixed(2),
|
|
|
ylcs : ylcs,//该任务已领取的次数
|
|
ylcs : ylcs,//该任务已领取的次数
|
|
|
renwuInfo: item
|
|
renwuInfo: item
|
|
@@ -2661,7 +2662,7 @@ proto.renWuLingjiangAsync = cor(function* (playerId,chairId,item) {
|
|
|
zfbName = sgjUser.zfbName;
|
|
zfbName = sgjUser.zfbName;
|
|
|
zfbBindTime = sgjUser.zfbBindTime;
|
|
zfbBindTime = sgjUser.zfbBindTime;
|
|
|
}
|
|
}
|
|
|
- let opts0 = {
|
|
|
|
|
|
|
+ let opts0 = {
|
|
|
playerId: playerId,
|
|
playerId: playerId,
|
|
|
cost: item.cost,
|
|
cost: item.cost,
|
|
|
reachs: { $all: item.reachs},
|
|
reachs: { $all: item.reachs},
|
|
@@ -2706,8 +2707,8 @@ proto.renWuLingjiangAsync = cor(function* (playerId,chairId,item) {
|
|
|
}
|
|
}
|
|
|
let fjres = yield this.sendTaskRecord(2,[ywcrwList[0]._id]);
|
|
let fjres = yield this.sendTaskRecord(2,[ywcrwList[0]._id]);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- var data = {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ var data = {
|
|
|
rewardt:rewardt,
|
|
rewardt:rewardt,
|
|
|
renwuInfo: item
|
|
renwuInfo: item
|
|
|
}
|
|
}
|
|
@@ -2716,7 +2717,7 @@ proto.renWuLingjiangAsync = cor(function* (playerId,chairId,item) {
|
|
|
|
|
|
|
|
// 得到玩家已完成的任务列表
|
|
// 得到玩家已完成的任务列表
|
|
|
proto.getOverTasksAsync = cor(function* (playerId,chairId) {
|
|
proto.getOverTasksAsync = cor(function* (playerId,chairId) {
|
|
|
- // console.log("玩家信息玩家信息玩家信息");
|
|
|
|
|
|
|
+ // console.log("玩家信息玩家信息玩家信息");
|
|
|
var user = this.users[chairId];
|
|
var user = this.users[chairId];
|
|
|
if (!user) {
|
|
if (!user) {
|
|
|
return { code: C.FAILD, msg: C.GAME_PARAM_ERROR };
|
|
return { code: C.FAILD, msg: C.GAME_PARAM_ERROR };
|
|
@@ -2736,14 +2737,14 @@ proto.getOverTasksAsync = cor(function* (playerId,chairId) {
|
|
|
// yield sgjwjjrrwc.saveAsync();
|
|
// yield sgjwjjrrwc.saveAsync();
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
- let opts0 = {
|
|
|
|
|
|
|
+ let opts0 = {
|
|
|
playerId: playerId,
|
|
playerId: playerId,
|
|
|
state: { $gt: 2 },
|
|
state: { $gt: 2 },
|
|
|
wcTime:{ $gt: 2 }
|
|
wcTime:{ $gt: 2 }
|
|
|
};
|
|
};
|
|
|
var ywcrwList = yield this.app.models.SGJTask.findMongoAsync(opts0, 'cost reachs reachC rewardt rewards state lqTime wcTime fjTime',{sort: { lqTime: -1 },limit:30});
|
|
var ywcrwList = yield this.app.models.SGJTask.findMongoAsync(opts0, 'cost reachs reachC rewardt rewards state lqTime wcTime fjTime',{sort: { lqTime: -1 },limit:30});
|
|
|
// console.warn("该wanjia已经完成的列表 length "+ywcrwList.length+" ywcrwList "+JSON.stringify(ywcrwList))
|
|
// console.warn("该wanjia已经完成的列表 length "+ywcrwList.length+" ywcrwList "+JSON.stringify(ywcrwList))
|
|
|
- var data = {
|
|
|
|
|
|
|
+ var data = {
|
|
|
ywcrwList: ywcrwList,
|
|
ywcrwList: ywcrwList,
|
|
|
}
|
|
}
|
|
|
return { code: C.OK, data: data };
|
|
return { code: C.OK, data: data };
|