jacksplwxy / wechat-weapp-Game-TNFB

一款基于腾讯云wafer2方案的实时在线答题微信小程序,类似头脑王者
627 stars 206 forks source link

好友对战功能 #21

Closed monkeyjie closed 6 years ago

monkeyjie commented 6 years ago

好友匹配功能无法测试成功,我和测试的好友房间号输出的结果也相同,但是无法正常对战,请问作者是哪里的问题呢?不胜感谢!

DesignerXY commented 6 years ago

你的排位赛成功了吗?我的不管好友对战还是排位赛从来没匹配成功过

monkeyjie commented 6 years ago

排位匹配成功了

chykun commented 6 years ago

@monkeyjie 可以检查一下日志中你分享链接的friendsFightingRoom

DesignerXY commented 6 years ago

你排位匹配成功有需要修改什么吗?

monkeyjie commented 6 years ago

不需要修改

DesignerXY commented 6 years ago

那你直接两个微信号就能匹配上?还是要几个?我现在开发环境,死活匹配不上,看小程序打印有都正常,后台服务器又不知道怎么查看

monkeyjie commented 6 years ago

检查了,发现friendsFightingRoom号是一样的。

chykun commented 6 years ago

wx20180323-162838 日志在这里看

DesignerXY commented 6 years ago

@chykun 看到日志了,不胜感谢!

DesignerXY commented 6 years ago

排位赛正常了,但是好友对战有错误

{ Error: ER_BAD_NULL_ERROR: Column 'id' cannot be null at Query.Sequence._packetToError (/data/release/node-weapp-demo/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14) at Query.ErrorPacket (/data/release/node-weapp-demo/node_modules/mysql/lib/protocol/sequences/Query.js:77:18) at Protocol._parsePacket (/data/release/node-weapp-demo/node_modules/mysql/lib/protocol/Protocol.js:279:23) at Parser.write (/data/release/node-weapp-demo/node_modules/mysql/lib/protocol/Parser.js:76:12) at Protocol.write (/data/release/node-weapp-demo/node_modules/mysql/lib/protocol/Protocol.js:39:16) at Socket. (/data/release/node-weapp-demo/node_modules/mysql/lib/Connection.js:103:28) at emitOne (events.js:115:13) at Socket.emit (events.js:210:7) at addChunk (_stream_readable.js:252:12) at readableAddChunk (_stream_readable.js:239:11) at Socket.Readable.push (_stream_readable.js:197:10) at TCP.onread (net.js:589:20)

at Protocol._enqueue (/data/release/node-weapp-demo/node_modules/mysql/lib/protocol/Protocol.js:145:48)
at Connection.query (/data/release/node-weapp-demo/node_modules/mysql/lib/Connection.js:208:25)
at /data/release/node-weapp-demo/node_modules/knex/lib/dialects/mysql/index.js:152:18
at Promise._execute (/data/release/node-weapp-demo/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/data/release/node-weapp-demo/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/data/release/node-weapp-demo/node_modules/bluebird/js/release/promise.js:79:10)
at Client_MySQL._query (/data/release/node-weapp-demo/node_modules/knex/lib/dialects/mysql/index.js:146:12)
at Client_MySQL.query (/data/release/node-weapp-demo/node_modules/knex/lib/client.js:197:17)
at Runner.<anonymous> (/data/release/node-weapp-demo/node_modules/knex/lib/runner.js:146:36)
at Runner.tryCatcher (/data/release/node-weapp-demo/node_modules/bluebird/js/release/util.js:16:23)
at Runner.query (/data/release/node-weapp-demo/node_modules/bluebird/js/release/method.js:15:34)
at /data/release/node-weapp-demo/node_modules/knex/lib/runner.js:65:21
at tryCatcher (/data/release/node-weapp-demo/node_modules/bluebird/js/release/util.js:16:23)
at /data/release/node-weapp-demo/node_modules/bluebird/js/release/using.js:185:26
at tryCatcher (/data/release/node-weapp-demo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/data/release/node-weapp-demo/node_modules/bluebird/js/release/promise.js:512:31)

code: 'ER_BAD_NULL_ERROR', errno: 1048, sqlMessage: 'Column \'id\' cannot be null', sqlState: '23000', index: 0, sql: 'insert into fighting_record (id, open_id_loser, open_id_winner, room_name, run_away, score_loser, score_winner, time) values (NULL, \'oVVFJ5BOqcTo6MMSeeNddFNTqP7s\', \'oVVFJ5CMMEMl5sZ-UGHTRrq4-q8w\', \'15217945053312609042\', false, 70, 90, NULL)' }

monkeyjie commented 6 years ago

很奇怪的是日志中只有一个玩家的信息,另一个玩家的信息是不在日志里面的。

LUIEE commented 6 years ago

试试把\server\controllers\tunnel.js的49行的this删掉

monkeyjie commented 6 years ago

好的,我试一试,谢谢!

monkeyjie commented 6 years ago

可以了,谢谢大佬指点!

LUIEE commented 6 years ago

我在本地测试的时候,排位赛无法匹配成功,您后来匹配成功是怎么解决的?@EdenXY

DesignerXY commented 6 years ago

我一直就是本地开发环境测试,删了代码重新下载新的就成功了 @LUIEE

kingonwind commented 6 years ago

好友对战匹配后不能获取对方头像,无法进入对战,请教提示一下