def sendAuth(ws): momoid = random.randint(1, 1000) msg = PackArgument() json = '{"token":"%s"}' % (momoid) print json msg.append(json) buff = initPack(2, 1, msg.content) ws.send(buff)
def sendPing(ws): msg = PackArgument() msg.append('{}') buff = initPack(1, 1, msg.content) ws.send(buff)
def sendMatchRoom(ws): msg = PackArgument() msg.append('{"roomType":3}') buff = initPack(3, 4, msg.content) ws.send(buff)
def sendWolfKill(ws): msg = PackArgument() msg.append('{"op":1,"slot":%d}' % aliveSeat[-1]) buff = initPack(4, 6, msg.content) ws.send(buff)
def sendStartGame(ws): msg = PackArgument() msg.append('{}') buff = initPack(4, 5, msg.content) ws.send(buff)
def sendpassLastWords(ws): msg = PackArgument() msg.append('{}') buff = initPack(4, 22, msg.content) ws.send(buff)
def sendDayPass(ws): msg = PackArgument() msg.append('{}') buff = initPack(4, 16, msg.content) ws.send(buff)
def sendReady(ws): msg = PackArgument() msg.append('{"op":2}') buff = initPack(4, 19, msg.content) ws.send(buff)