Wubing 1 долоо хоног өмнө
parent
commit
2d7132819c

+ 3 - 3
app/controllers/shuiguo.js

@@ -58,7 +58,7 @@ proto._createUser = function (player, table) {
 };
 
 // 创建桌子  cell底分 round局数
-proto._createTable = function (cPlayerId,cUserId,cName,cHead,cell, round, type,gameKindTL,playerAllCount,upId,other,agentId,yxndlbTime,yxndlbTip,nowcell) {
+proto._createTable = function (cPlayerId,cUserId,cName,cHead,cell, round, type,gameKindTL,playerAllCount,upId,other,agentId,yxndlbTime,yxndlbTip,roomType) {
     // this.lastId += _.random(1, 100);////在区间[1,100]内随机取整数 TL++zs yl
     this.lastId += 1;
     if(this.lastId>=80000)
@@ -70,7 +70,7 @@ proto._createTable = function (cPlayerId,cUserId,cName,cHead,cell, round, type,g
     //console.warn("创建桌子",prefix,serverId);
     // var str3 = "shuiguo 创建桌子Id:"+prefix
     // logger.info(str3);////cssj
-    var table = new Table(cPlayerId,cUserId,cName,cHead,this, prefix , cell, round, type,gameKindTL,playerAllCount,upId,other,agentId,yxndlbTime,yxndlbTip,nowcell);
+    var table = new Table(cPlayerId,cUserId,cName,cHead,this, prefix , cell, round, type,gameKindTL,playerAllCount,upId,other,agentId,yxndlbTime,yxndlbTip,roomType);
     this.tables.push(table);
     return table;
 };
@@ -641,7 +641,7 @@ proto.createTableAsync = P.coroutine(function* (playerId, round, type,gameKind,p
     if(whdata && whdata.yxndlbTip) yxndlbTip = whdata.yxndlbTip;
     let nowcell = 0.1
     if (roomType == 2) nowcell = 1
-    var table = this._createTable(playerId,cUserId,cName,cHead,cell, round, type,gameKind,playerAllCount,upId,other,agentId,yxndlbTime,yxndlbTip,nowcell);
+    var table = this._createTable(playerId,cUserId,cName,cHead,cell, round, type,gameKind,playerAllCount,upId,other,agentId,yxndlbTime,yxndlbTip,roomType);
 
     var gametable = new this.app.models.GameTable({
         _id: table.recordid,//记录

+ 1 - 0
app/models/game.js

@@ -181,6 +181,7 @@ module.exports = function (app) {
         tableNo: { type: String , default: ''},		// ts++房间号
         ownerId: { type: String, default: '' },		// 玩家标识
         agentId: { type: String, default: '' },		// 代理ID
+        roomType: { type: Number, set: function(value) {return Number(Number(value).toFixed(2));}, default: 0 },		// 代理ID
         over: { type: Number , default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },		// 游戏局数
         time: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));}  },		// 结束时间
         gameCost: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },		// 游戏消耗(本局下注总额)

+ 9 - 3
app/shuiguo/table.js

@@ -61,7 +61,7 @@ var checkVersion = function () {
     // }
 }
 // 构造方法
-var Table = function (cPlayerId,cUserId,cName,cHead,game, id, cell, round, type,gameKindTL,playerAllCount,upId,other,agentId,yxndlbTime,yxndlbTip,nowcell) {
+var Table = function (cPlayerId,cUserId,cName,cHead,game, id, cell, round, type,gameKindTL,playerAllCount,upId,other,agentId,yxndlbTime,yxndlbTip,roomType) {
     let str3 = "table构造方法.......id:  "+id + " type " + type+"  game  "+game.id;
     logger.warn(str3);////cssj
     checkVersion();
@@ -92,11 +92,16 @@ var Table = function (cPlayerId,cUserId,cName,cHead,game, id, cell, round, type,
     this.ownerUid = cUserId;//房主的userID
     this.ownerName = cName;
     this.ownerHeadUrl = cHead;
-
+    this.roomType = roomType
     // 数据
     var logic = new Logic(type,gameKindTL,playerAllCount,other);
-    this.logic.nowCell = nowcell
+    
     this.logic = logic;
+    this.logic.nowCell = 0.1
+    if (roomType == 2){
+        this.logic.nowCell = 1
+    }
+    
     // this.logic.testFloat();
     // this.logic.testSendCards();
     this.score = new Score(this);
@@ -1425,6 +1430,7 @@ proto.startGameAsync = cor(function* (yazhus) {
         _id: this.yxjlid,//ts++游戏记录id,
         tableNo: this.id,     // ts++房间号
         ownerId: this.ownerId,     // 玩家标识
+        roomType: this.roomType,
         agentId: this.agentId,     // 代理ID
         over: this.over,        // 游戏局数
         time: nowTime,        // 结束时间