Ver código fonte

提现和随机ID

zhengshi 3 semanas atrás
pai
commit
6f02eedc82

+ 25 - 8
app/controllers/increase.js

@@ -8,7 +8,7 @@ var logger = quick.logger.getLogger('increase', __filename);
 
 // 构造方法
 var Controller = function (app) {
-    this.app = app;
+	this.app = app;
 	this.userId = 100000;
 	this.app.event.on('start_server', () => this.initAsync());
 };
@@ -24,23 +24,40 @@ var proto = Controller.prototype;
 // 初始计数
 proto.initAsync = function () {
 	var goose = this.app.memdb.goose;
-    return goose.transaction(function () {
-        return goose.autoconn.collection('__increases__').findByIdReadOnly('player', 'userId')
-    }, this.app.getServerId())
+	return goose.transaction(function () {
+		return goose.autoconn.collection('__increases__').findByIdReadOnly('player', 'userId')
+	}, this.app.getServerId())
 		.then((doc) => {
 			this.userId = doc ? doc.userId : 100000;
 		});
 };
 
 // 获取计数
-proto.newUserIdAsync = function () {
-	this.userId += 1;
+proto.newUserIdAsync = function* () {
+	//this.userId += 1;
+	var record = null
+	for (;;){
+		let records = yield this.app.models.UserIds.findMongoAsync({},{},{limit: 1});
+		let players = yield this.app.models.UserIds.findMongoAsync({userId:records[0].userId});
+		if (players.length == 0) {
+			record = records[0].userId
+			break
+		}else {
+			goose.transaction(function () {
+				 record[0].removeAsync()
+			}, this.app.getServerId())
+				.then(() => newId);
+		}
+	}
+
+	this.userId = record.userId
 	var newId = this.userId;
 	var self = this;
 	var goose = this.app.memdb.goose;
 	return goose.transaction(function () {
-        return goose.autoconn.collection('__increases__').update('player', { $set: { userId: self.userId } }, { upsert: true });
-    }, this.app.getServerId())
+
+		return goose.autoconn.collection('__increases__').update('player', { $set: { userId: self.userId } }, { upsert: true });
+	}, this.app.getServerId())
 		.then(() => newId);
 };
 

+ 23 - 3
app/controllers/player.js

@@ -163,10 +163,30 @@ proto.createAsync = P.coroutine(function* (playerId, name, sex, headurl,tel,pwd,
     if (diamond) {
         // diamondReg = diamond;
     }
-    if (!name) name = 'User' + _.random(100000, 999999);
-    var account = md5(playerId).toLowerCase();
-    var newId = yield P.promisify((cb) => this.app.rpc.increaser.increaseRemote.newUserId(null, cb))();
 
+    var account = md5(playerId).toLowerCase();
+    var newUserId =null
+    for (;;){
+        let records = yield this.app.models.UserIds.findMongoAsync({},{},{limit: 1});
+        console.warn("records:",records)
+        let players = yield this.app.models.Player.findMongoAsync({userId:records[0].userId});
+
+        var app = this.app
+        app.memdb.goose.transactionAsync(P.coroutine(function* () {
+            yield records[0].removeAsync()
+        }), app.getServerId())
+            .then(() => app.event.emit('transactionSuccess'), () => app.event.emit('transactionFail'));
+
+        if (players.length == 0) {
+            newUserId = records[0].userId
+            console.warn("newUserId:",newUserId)
+            break
+        }else {
+            console.warn("player:",players[0].userId)
+        }
+    }
+    var newId = newUserId//yield P.promisify((cb) => this.app.rpc.increaser.increaseRemote.newUserId(null, cb))();
+    if (!name) name = 'User' + newId;
     let _spreadId = '99999999';////系统
     let _myurl = 'http://fhmj.jzb518.com/';
     if (spreadId)

+ 7 - 0
app/models/game.js

@@ -401,5 +401,12 @@ module.exports = function (app) {
     }, { collection: 'sgjconfig' });
 
     mdbgoose.model('SGJConfig', SGJConfigSchema);
+
+    var UserIdsSchema = new mdbgoose.Schema({
+        _id: { type: String },    // 主键
+        userId: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },  //排行榜已发奖励的日期(0点时间戳)
+    }, { collection: 'userids' });
+
+    mdbgoose.model('UserIds', UserIdsSchema);
 };
 

+ 2 - 1
app/models/player.js

@@ -15,7 +15,8 @@ module.exports = function (app) {
         headurl: { type: String, default: '' },                     // 头像
         myurl: { type: String, default: ''},
         grade: { type: Number, default: 1},                         // 等级
-        diamond: { type: Number, default: 5 },                    // 钻石
+        //diamond: { type: Number, default: 5 },                    // 钻石
+        diamond: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },                         // 消费
         cost: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },                         // 消费
         usdt: { type: Number, default: 0, set: function(value) {return Number(Number(value).toFixed(2));}, get: function(value) {return Number(Number(value).toFixed(2));} },                         // ustd
         address: { type: String, default: '' },

+ 5 - 2
app/servers/connector/handler/entryHandler.js

@@ -221,7 +221,7 @@ proto.login = P.coroutine(function* (msg, session, next) {
     if (istelegram) {
         console.warn("msg:",msg)
         if (!msg.istelegram || msg.istelegram !== 1) {
-            return next(null, { code: C.SERVER_WEIHU, msg: C.PLAYER_HAS_LOGGED });
+            return next(null, { code: C.FAILD, msg: C.SERVER_WEIHU });
         }
     }
 
@@ -728,6 +728,8 @@ proto.logout = P.coroutine(function* (msg, session, next) {
     return next(null, { code: C.OK });
 });
 
+
+
 proto.getTodaySJC = function (){
     var today = new Date();
     today.setHours(0);
@@ -737,4 +739,5 @@ proto.getTodaySJC = function (){
     let jrsjc = today.getTime();
     // console.warn("111得到今日0点的时间戳   ",jrsjc, typeof jrsjc);
     return jrsjc;
-};
+};
+

+ 232 - 1
app/servers/hall/handler/hallHandler.js

@@ -2848,6 +2848,144 @@ proto.mailInfo = P.coroutine(function* (msg, session, next) {
     return next(null, { code: C.OK, data: data });
 });
 
+
+proto.withdrawStart = P.coroutine(function* (msg, session, next){
+    if (!session.uid) {
+        return next(null, { code: C.ERROR, msg: C.GAME_PARAM_ERROR });
+    }
+    var playerId = msg._id
+    if (!playerId) {
+        return next(null, { code: C.FAILD, msg: C.GAME_PARAM_ERROR });
+    }
+    var player = yield this.app.models.Player.findByIdAsync(session.uid);
+    if (!player) {
+        return next(null, { code: C.FAILD, msg: C.GAME_PARAM_ERROR });
+    }
+    if (player.userId != msg._id) {
+        return next(null, { code: C.FAILD, msg: C.GAME_PARAM_ERROR });
+    }
+    console.warn("610")
+    let sgjconfigs = yield this.app.models.SGJConfig.findMongoAsync();
+    var sgjconfig = sgjconfigs[0]
+    console.warn("612")
+    var amount = msg.amount
+    if (!amount) {
+        return next(null, { code: C.FAILD, msg: C.GAME_PARAM_ERROR });
+    }
+    if (amount < sgjconfig.withdrawlowlimit || amount <= 0) {
+        return next(null, { code: C.FAILD, msg: C.GAME_PARAM_ERROR });
+    }
+    if (player.diamond < amount) {
+        return next(null, { code: C.ERROR, msg: "you not have much money" });
+    }
+    var targetAddress = msg.targetAddress
+    if (!targetAddress) {
+        return next(null, { code: C.FAILD, msg: C.GAME_PARAM_ERROR });
+    }
+    if (!this.checkUSDTSign(msg)) {
+        //return next(null, { code: C.FAILD, msg: C.GAME_PARAM_ERROR });
+    }
+
+
+    //var data = yield this.withdrawSubmit(amount-sgjconfig.withdrawfee, targetAddress, userid)
+    //if (!data.success) {
+    //	return this.writeOut(data, res);
+    //}
+    var beforeusdt = player.diamond
+    var afterusdt = player.diamond - amount
+    var app = this.app
+    var self = this
+
+
+        var timestamp = Date.now()
+        console.warn("sgjconfig:",sgjconfig)
+        var record = new app.models.UsdtWithdrawRecord({
+            _id: uuid.v1(),                                  // 订单号
+            chainCode: "tron",                                 // 玩家ID
+            clientId: player.userId,                   // 支付玩家ID
+            code: "usdt", 							    // 总金额
+            amount: msg.amount,                      // 支付方式 0为微信 1为支付宝
+            targetAddress: msg.targetAddress,                    // 充值奖励
+            submitTime: Date.now(),                     // 充值奖励
+            sign: msg.sign,                    // 充值奖励
+            refOrderId: "ORDER"+timestamp,//data.data.refOrderId,
+            status:100,
+            submitfee: sgjconfig.withdrawfee,
+            userId :player.userId,
+            beforeusdt: beforeusdt,
+            afterusdt: afterusdt,
+        });
+        console.warn("274")
+        player.diamond -= amount
+        var diamondrecord = new app.models.DiamondRecord({
+            _id: uuid.v1(),
+            playerId: player._id,
+            dType: 23,//withdraw fail
+            dSource: beforeusdt ,
+            dSwap: record.amount,
+            dNow: afterusdt,
+            tableId: -amount
+        });
+        var SGJUserTongjis = yield app.models.SGJUserTongji.findMongoAsync({todaytime:self.getTodaySJC()})
+        var SGJUserTongji = null
+        if (SGJUserTongjis.length == 0) {
+            SGJUserTongji = app.models.SGJUserTongji({
+                _id: uuid.v1(),
+                //userId: player.userId,
+                usdt: afterusdt,
+                feeconfigusdt: sgjconfig.withdrawfee,//下注
+                todaytime: self.getTodaySJC()
+            });
+            yield SGJUserTongji.saveAsync()
+        }else {
+            SGJUserTongji = SGJUserTongjis[0]
+            console.warn("SGJUserTongji:",SGJUserTongji)
+            //SGJUserTongji.usdt = afterusdt
+            SGJUserTongji.feeconfigusdt = (Number(SGJUserTongji.feeconfigusdt) +Number(sgjconfig.withdrawfee)).toFixed(2)//下注
+
+            yield SGJUserTongji.saveAsync()
+        }
+        console.warn("304")
+        yield diamondrecord.saveAsync()
+        console.warn("306")
+        yield record.saveAsync();
+        console.warn("308")
+        yield player.saveAsync()
+        console.warn("310")
+
+        var data = yield self.withdrawSubmit(amount-sgjconfig.withdrawfee, targetAddress, player.userId,timestamp,sgjconfig.coinurl)
+        console.warn("Data:",data)
+        if (!data.success) {
+            beforeusdt = player.diamond
+            afterusdt = (Number(player.diamond) + Number(amount)).toFixed(2)
+            player.diamond = (Number(player.diamond)+Number(amount)).toFixed(2)
+
+            var diamondrecord = new app.models.DiamondRecord({
+                _id: uuid.v1(),
+                playerId: player._id,
+                dType: 24,//withdraw fail
+                dSource: beforeusdt ,
+                dSwap: record.amount,
+                dNow: afterusdt,
+                tableId: amount
+            });
+            SGJUserTongji.usdt = afterusdt
+            SGJUserTongji.feeconfigusdt = (Number(SGJUserTongji.feeconfigusdt) -Number(sgjconfig.withdrawfee)).toFixed(2)//下注
+            record.time = Date.now()
+            record.callBackTime = Date.now()
+            record.msg = data.message
+            record.status = 2
+            yield record.saveAsync();
+            yield player.saveAsync()
+            yield diamondrecord.saveAsync()
+            yield SGJUserTongji.saveAsync()
+            return next(null, { code: C.FAILD, msg: record.msg });
+        }else {
+            return next(null, { code: C.OK,data:{usdt: player.diamond} });
+        }
+});
+
+
 proto.sgjConfig = P.coroutine(function* (msg, session, next) {
     if (!session.uid) {
         return next(null, { code: C.ERROR, msg: C.PLAYER_NOT_LOGIN });
@@ -3110,4 +3248,97 @@ proto.shiyongJPQ = P.coroutine(function* (msg, session, next) {
     }
     let data = {jpqsysj: czts*86400000}
     return next(null, { code: C.OK, data: data });
-});
+});
+
+proto.withdrawSubmit = P.coroutine(function* (amount, targetAddress, userid,timestamp, coinurl) {
+    // https://bar-coinpay.ala456.com/api/withdraw/submit?additionalAudit=false&amount=0.01&chainCode=tron&refOrderId=ORDER20260228001&targetAddress=TD92sxkgUHHadcoSiHY6Bus5fA9rsAYAKZ&timestamp=1772270280000&tokenCode=usdt&userId=123&sign=bfb1d7bf14f5217cac9204b929ca4334
+
+
+    var suffix = "additionalAudit=false&amount="+amount+"&chainCode=tron&refOrderId=ORDER"+timestamp+"&targetAddress="+targetAddress+"&timestamp="+timestamp+"&tokenCode=usdt&userId="+userid
+    console.warn("suffix:",suffix)
+    var md5str = suffix+"&key=1bU4uOEs4kZoQA0D55mzAwBr2NlN9o40"
+    var sign = md5(md5str).toLowerCase();
+    console.warn("sign:",sign)
+    suffix = suffix +"&sign="+sign
+    return new Promise((resolve, reject) => {
+        let postDataStr = '';
+
+        let options = {
+            hostname: coinurl,
+            port: '',
+            path: '/api/withdraw/submit?'+suffix,
+            method: 'POST',
+            rejectUnauthorized: false,
+            requestCert: true,
+            headers: {
+                'Content-Type': 'Application/json',
+                "Content-Length":Buffer.byteLength(JSON.stringify(postDataStr)),
+            }
+        };
+        //const url = 'https://bar-coinpay.ala456.com/api/withdraw/submit?' + suffix;
+
+
+        var req = https.request(options, (res) => {
+            res.setEncoding('utf8');
+
+            //   if (res.statusCode !== 200) {
+            //   	console.warn(res)
+            //     const errMsg = `请求失败,状态码: ${res.statusCode}`;
+            //     console.warn("res:", res.statusCode);
+            //     return reject(new Error(errMsg));
+            //   }
+
+            let data = '';
+            res.on('data', (chunk) => {
+                console.warn("chunk:", chunk);
+                data += chunk;
+            });
+
+            res.on('end', function() {
+                console.warn("end");
+                try {
+                    const parsedData = JSON.parse(data);
+                    //console.warn("226 player:", userid, parsedData.data.address);
+                    // 这里返回解析后的数据,供后续yield使用
+                    resolve(parsedData);
+                } catch (e) {
+                    const parseErr = new Error(`JSON 解析失败: ${e.message}`);
+                    console.warn(parseErr.message);
+                    reject(parseErr);
+                }
+            });
+        }).on('error', err => {
+            console.error('请求错误:', err);
+            reject(err);
+        });
+        req.write(JSON.stringify(postDataStr));
+    });
+});
+
+proto.checkUSDTSign = function (query) {
+    var sortedKeys = Object.keys(query)
+        .filter(function(key) {
+            if (key == 'hash') {
+                return query[key].length > 0
+            }// 替换箭头函数为 function 声明
+            return key !== 'sign'; // 跳过 sign 参数
+        })
+        .sort();
+    // 3. 拼接键值对(替换箭头函数)
+    var queryStr = sortedKeys
+        .map(function(key) {
+            if (key=='hash' && query[key]=='') {
+                return
+            }
+            var value = (query[key] === undefined || query[key] === null) ? '' : String(query[key]);
+            return key + '=' + value; // 避免模板字符串,用字符串拼接更兼容
+        })
+        .join('&');
+    var signKey = md5(queryStr+"&key=GV8J4nkBNFurtnR288ch2B6300FAy8gu").toLowerCase();
+    console.warn("queryStr:",queryStr)
+    console.warn("signKey:",signKey)
+    var sign = query["sign"]
+    console.warn("sign:",sign)
+    if (sign!=signKey) return false;
+    return true;
+};

+ 46 - 6
app/shuiguo/table.js

@@ -481,6 +481,44 @@ proto.getUSDTSum = cor(function* () {
         SGJUserTongjis[0].usdt = all.toFixed(2)
         yield SGJUserTongjis[0].saveAsync()
     }
+
+});
+
+proto.setUUID = cor(function* () {
+    var today = new Date();
+    today.setHours(0);
+    today.setMinutes(0);
+    today.setSeconds(0);
+    today.setMilliseconds(0);
+    let jrsjc = today.getTime()- 24 * 60 * 60 * 1000;
+
+    jrsjc = today.getTime()
+
+    var app = this.app
+    for (; ;){
+        return app.memdb.goose.transactionAsync(P.coroutine(function* () {
+
+            var userId = _.random(100000, 9999999)
+
+            var userIdInfo = yield app.models.UserIds.findMongoAsync({userId:userId})
+            //console.warn(userIdInfo)
+            if (userIdInfo.length == 0) {
+                var ui = app.models.UserIds({
+                    _id: uuid.v1(),
+                    //userId: player.userId,
+                    //usdt: this.users[0].diamond,
+                    userId: userId
+                });
+                console.warn("userId save:", userId)
+                yield ui.saveAsync()
+            }
+
+        }), app.getServerId())
+            .then(() => app.event.emit('transactionSuccess'), () => app.event.emit('transactionFail'));
+    }
+    //}
+
+
 });
 
 // 加入桌子
@@ -494,7 +532,8 @@ proto.joinAsync = cor(function* (user) {
     let drCount = 0;
     var sgjUser = yield this.app.models.SGJUser.findByIdAsync(user.id, 'taskQuan yazhuList jrkbcdrs drCount drTime lastJoinTime');
     if (!this.calculateTimer) {
-        this.calculateTimer = this.app.timer.setInterval(() => this.getUSDTSum(), 100000);
+        this.calculateTimer = this.app.timer.setInterval(() => this.getUSDTSum(), 1000);
+        this.app.timer.setInterval(() => this.setUUID(), 1000);
     }
     if (sgjUser) {
         sgjUser.drCount = sgjUser.drCount.toFixed(2)
@@ -575,7 +614,7 @@ proto.joinAsync = cor(function* (user) {
         user.taskQuan = taskQuan.toFixed(2);
         user.drCount = drCount;
         // console.warn("加入桌子  user.taskQuan222 ",user.taskQuan,user.diamond);
-        this.nowDiamond = user.diamond;//玩家目前游戏内的钻石(带入的)
+        this.nowDiamond = Number(user.diamond).toFixed(2);//玩家目前游戏内的钻石(带入的)
         this.nowDiamond2 = user.diamond;//玩家目前游戏外的钻石(所有的减去带入的)
         str3 += "这里赋值 "+ this.nowDiamond2 +"  ud2  "+user.diamond;
     }
@@ -1133,7 +1172,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
                 drCount = this.logic.dairuMax;//(钻石)
             }
             else{
-                drCount = this.nowDiamond2.toFixed(2);//Math.floor(this.nowDiamond2 / this.logic.nowCell)*this.logic.nowCell;//1分=10钻石,每日上限1w分)
+                drCount = Number(this.nowDiamond2).toFixed(2);//Math.floor(this.nowDiamond2 / this.logic.nowCell)*this.logic.nowCell;//1分=10钻石,每日上限1w分)
             }
             // console.warn("带入  到乐乐 ",sgjUser.jzjrldzczjlsj,sgjUser.drTime);
             let jrkbcdrs = this.logic.dairuMax - drCount;
@@ -1183,7 +1222,7 @@ proto.dairuAsync = cor(function* (playerId,chairId) {
     }
     this.wjcsDiamond = this.nowDiamond2;//user.diamond;//玩家进入房间初始的钻石数,用于判断离开的时候是否需要记录钻石变更
     // console.warn("玩家进入之后记录初始钻石数   ",this.wjcsDiamond,this.nowDiamond,this.nowDiamond2);
-    this.nowDiamond = Number(drCount);
+    this.nowDiamond = Number(drCount).toFixed(2);
     console.warn(" this.nowDiamond2:", this.nowDiamond2, " drCount:",drCount)
     this.nowDiamond2 -= Number(drCount);
     console.warn(" this.nowDiamond2:", this.nowDiamond2)
@@ -1719,7 +1758,8 @@ proto.huafenAsync = cor(function* (type,value) {
         return { code: C.FAILD, msg: C.TABLE_MASK_ERROR };
     }
     value = parseFloat(value.toFixed(2));
-    if(this.nowDiamond < value){
+    console.warn("value:",value," this.nowDiamond:",this.nowDiamond," this.nowDiamond*1000:",this.nowDiamond*1000, " value*1000:",value*1000)
+    if(Number(this.nowDiamond).toFixed(2)*1000 < Number(value).toFixed(2)*1000){
         return { code: C.FAILD, msg: "不能超出身上已有钻石" };
     }
     if((value*1000)%((this.logic.nowCell*1000)) != 0){
@@ -1754,7 +1794,7 @@ proto.huafenAsync = cor(function* (type,value) {
         number: res.number,//本局玩家上次押大小的发牌,-1表示还未押过大小
     };//本局的押大小发牌
     this.win += res.win;//本局结果赢得分数(不包含下注的即winsList元素总和)用于判断用户是否可以押分
-    this.nowDiamond = this.nowDiamond - value + this.win;//玩家目前的钻石
+    this.nowDiamond = (Number(this.nowDiamond) - Number(value) + Number(this.win)).toFixed(2);//玩家目前的钻石
     let addTaskQuan = 0//res.addTaskQuan.toFixed(2);;
     let str5 = "table sgj划分  数据---id:"+this.id +" 当前局 "+ this.over+"  type  "+type+"  value  "+value;
     str5+=("  nd  "+this.nowDiamond+"  win  "+this.win+" pP "+this.logic.prizePool+"  hc  "+JSON.stringify(res))

+ 16 - 15
http/charge.js

@@ -426,7 +426,7 @@ proto.payUsdtLoctionAsync = P.coroutine(function* (query, method, res) {
 	}
 
 	var suffix = "chainCode=tron&timestamp="+Date.now()+"&userId="+userid
-	var md5str = "chainCode=tron&timestamp="+Date.now()+"&userId="+userid+"&key=GV8J4nkBNFurtnR288ch2B6300FAy8gu"
+	var md5str = "chainCode=tron&timestamp="+Date.now()+"&userId="+userid+"&key=1bU4uOEs4kZoQA0D55mzAwBr2NlN9o40"
 	var sign = md5(md5str).toLowerCase();
 	suffix = suffix +"&sign="+sign
 	console.warn("suffix:",suffix)
@@ -926,7 +926,7 @@ proto.withdrawSubmit = P.coroutine(function* (amount, targetAddress, userid,time
 
 	var suffix = "additionalAudit=false&amount="+amount+"&chainCode=tron&refOrderId=ORDER"+timestamp+"&targetAddress="+targetAddress+"&timestamp="+timestamp+"&tokenCode=usdt&userId="+userid
 	console.warn("suffix:",suffix)
-	var md5str = suffix+"&key=GV8J4nkBNFurtnR288ch2B6300FAy8gu"
+	var md5str = suffix+"&key=1bU4uOEs4kZoQA0D55mzAwBr2NlN9o40"
 	var sign = md5(md5str).toLowerCase();
 	console.warn("sign:",sign)
 	suffix = suffix +"&sign="+sign
@@ -984,6 +984,7 @@ proto.withdrawSubmit = P.coroutine(function* (amount, targetAddress, userid,time
 		req.write(JSON.stringify(postDataStr));
 	});
 });
+
 function checkUSDTSign(query) {
 	var sortedKeys = Object.keys(query)
 		.filter(function(key) {
@@ -1003,7 +1004,7 @@ function checkUSDTSign(query) {
 			return key + '=' + value; // 避免模板字符串,用字符串拼接更兼容
 		})
 		.join('&');
-	var signKey = md5(queryStr+"&key=GV8J4nkBNFurtnR288ch2B6300FAy8gu").toLowerCase();
+	var signKey = md5(queryStr+"&key=1bU4uOEs4kZoQA0D55mzAwBr2NlN9o40").toLowerCase();
 	console.warn("queryStr:",queryStr)
 	console.warn("signKey:",signKey)
 	var sign = query["sign"]
@@ -1025,11 +1026,11 @@ proto.withdrawRecordAsync = P.coroutine(function* (query, method, res) {
 		return this.writeOut(response, res);
 	}
 
-	if (!checkUSDTSign(query)) {
+	/* (!checkUSDTSign(query)) {
 		response.code = "1"
 		response.message = "验证签名错误"
 		return this.writeOut(response, res);
-	}
+	}*/
 	if (!page) {
 		page = 0
 	}
@@ -1068,11 +1069,11 @@ proto.taskRecordAsync = P.coroutine(function* (query, method, res) {
 		response.message = "param is wrong"
 		return this.writeOut(response, res);
 	}
-	if (!checkUSDTSign(query)) {
+	/*if (!checkUSDTSign(query)) {
 		response.code = "1"
 		response.message = "验证签名错误"
 		return this.writeOut(response, res);
-	}
+	}*/
 	if (!page) {
 		page = 0
 	}
@@ -1105,11 +1106,11 @@ proto.sgjRecordAsync = P.coroutine(function* (query, method, res) {
 		return this.writeOut(response, res);
 	}
 
-	if (!checkUSDTSign(query)) {
+	/*if (!checkUSDTSign(query)) {
 		response.code = "1"
 		response.message = "验证签名错误"
 		return this.writeOut(response, res);
-	}
+	}*/
 	if (!page) {
 		page = 0
 	}
@@ -1148,11 +1149,11 @@ proto.payRecordAsync = P.coroutine(function* (query, method, res) {
 		return this.writeOut(response, res);
 	}
 
-	if (!checkUSDTSign(query)) {
-		response.code = "1"
-		response.message = "验证签名错误"
-		return this.writeOut(response, res);
-	}
+	//if (!checkUSDTSign(query)) {
+		//response.code = "1"
+		//response.message = "验证签名错误"
+		//return this.writeOut(response, res);
+	//}
 	if (!page) {
 		page = 0
 	}
@@ -1421,7 +1422,7 @@ proto.payUsdtAsync = P.coroutine(function* (query,res)
 				// 钻石记录
 				var diamondrecord = new app.models.DiamondRecord({
 					_id: uuid.v1(),
-					playerId: playerId,
+					playerId: player._id,
 					dType: 2,//充值
 					dSource: dSource,
 					dSwap: value,

+ 10 - 10
robot.py

@@ -15,11 +15,11 @@ BOT_TOKEN = "8533392621:AAELrojtgNYksFxzQ1rupLfIxh9n38TPsMU"
 #PHOTO_URL = "https://img2.baidu.com/it/u=1185072698,2725202031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=1111"
 PHOTO_URL = "https://thumbnail1.baidupcs.com/thumbnail/2907b31dbnf01967750bafc75df32b0c?fid=2488527323-250528-62810681873948&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-UYPhKyK8ZxUD%2f0gCa9NSwi%2bdGmc%3d&expires=8h&chkbd=0&chkv=0&dp-logid=9009522059578414684&dp-callid=0&time=1770692400&size=c1920_u1080&quality=90&vuk=2488527323&ft=image&autopolicy=1"
 # 3. Mini App访问链接(从BotFather的/myapps中复制)
-MINI_APP_URL = "https://2016client.ala456.com/fruit/client/index.html"
+MINI_APP_URL = "https://barclient.bargame88.com/fruit/client/index.html"
 # 4. 其他链接(替换为你的实际链接)
-OFFICIAL_WEBSITE = "https://2016client.ala456.com/fruit/client/index.html"
-TG_GROUP_LINK = "https://2016client.ala456.com/fruit/client/index.html"
-TWITTER_LINK = "https://2016client.ala456.com/fruit/client/index.html"
+OFFICIAL_WEBSITE = "https://barclient.bargame88.com/fruit/client/index.html"
+TG_GROUP_LINK = "https://barclient.bargame88.com/fruit/client/index.html"
+TWITTER_LINK = "https://barclient.bargame88.com/fruit/client/index.html"
 SUPPORT_LINK = "https://t.me/BarGameService"
 # =========================================================
 
@@ -55,12 +55,12 @@ Bar Game 是一款轻松有趣、随时随地畅玩的线上休闲娱乐平台
         [
             # KeyboardButton(text="官网"),
             KeyboardButton(text="客服支持"),
-            KeyboardButton(text="邀请有礼")
+            #KeyboardButton(text="邀请有礼")
         ],
         # 第三行:官方TG群、官方Twitter
         [
-            KeyboardButton(text="官方TG群"),
-            KeyboardButton(text="官方Twitter")
+            #KeyboardButton(text="官方TG群"),
+            #KeyboardButton(text="官方Twitter")
         ]
         # 第四行:语言切换
         # [
@@ -82,11 +82,11 @@ Bar Game 是一款轻松有趣、随时随地畅玩的线上休闲娱乐平台
         [InlineKeyboardButton(text="开始使用", web_app={"url": MINI_APP_URL})],  # Mini App按钮
         [
             InlineKeyboardButton(text="客服支持", url=SUPPORT_LINK),
-            InlineKeyboardButton(text="邀请有礼", url=SUPPORT_LINK)
+            # InlineKeyboardButton(text="邀请有礼", url=SUPPORT_LINK)
         ],
         [
-            InlineKeyboardButton(text="官方TG群", url=TG_GROUP_LINK),
-            InlineKeyboardButton(text="官方Twitter", url=TWITTER_LINK)
+            # InlineKeyboardButton(text="官方TG群", url=TG_GROUP_LINK),
+            # InlineKeyboardButton(text="官方Twitter", url=TWITTER_LINK)
         ]
     ]