def joinroom(self,roomid=-1, tableid=3): res=Buffer() res.write_ushort(1032) res.write_short(roomid) res.write_byte(tableid) res.write_string('') self.ro.sendData(res.getValue())
def GM_login(): res=Buffer() res.write_ushort(1025) res.write_string(gm.id) res.write_string(gm.pwd) print 'GM_login_request:', gm.id, gm.pwd gm.ro.sendData(res.getValue())
def login(self, u, p): self.id=u res=Buffer() res.write_ushort(1025) res.write_string(u) res.write_string(p) print 'login_request:', u, p self.ro.sendData(res.getValue())
def drop(self): res=Buffer() res.write_ushort(1058) i=random.choice(range(len(self.pai))) pai=self.pai[i] self.pai=self.pai[:i]+self.pai[i+1:] print '=======================================================' print '->my_pai[%s]: %s' % (self.tableid, self.pai) res.write_byte(ord(pai)) self.ro.sendData(res.getValue())
def GM_register(u): res=Buffer() res.write_ushort(1024) res.write_string(u.id) res.write_string(u.pwd) res.write_string(u.nick) res.write_string(u.mail) res.write_short(u.sex) res.write_short(u.avata) print 'GM_register_request:' gm.ro.sendData(res.getValue())
def register(self): res=Buffer() res.write_ushort(1024) res.write_string(self.id) res.write_string(self.pwd) res.write_string(self.nick) res.write_string(self.mail) res.write_short(self.sex) res.write_short(self.avata) print 'register_request:', self.id, self.pwd self.ro.sendData(res.getValue())
def GM_list_rooms(): res=Buffer() res.write_ushort(1030) res.write_short(1) res.write_short(1) gm.ro.sendData(res.getValue())
def zua(self): res=Buffer() res.write_ushort(1054) self.ro.sendData(res.getValue())
def paipass(self): res=Buffer() res.write_ushort(1067) self.ro.sendData(res.getValue())
def standby(self): res=Buffer() res.write_ushort(1050) self.ro.sendData(res.getValue())
def lobby(self): res=Buffer() res.write_ushort(1030) res.write_short(1) res.write_short(1) self.ro.sendData(res.getValue())