Example #1
0
 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())
Example #2
0
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())
Example #3
0
 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())
Example #4
0
 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())
Example #5
0
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())
Example #6
0
 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())
Example #7
0
def GM_list_rooms():
    res=Buffer()
    res.write_ushort(1030)
    res.write_short(1)
    res.write_short(1)
    gm.ro.sendData(res.getValue())
Example #8
0
 def zua(self):
     res=Buffer()
     res.write_ushort(1054)
     self.ro.sendData(res.getValue())
Example #9
0
 def paipass(self):
     res=Buffer()
     res.write_ushort(1067)
     self.ro.sendData(res.getValue())
Example #10
0
 def standby(self):
     res=Buffer()
     res.write_ushort(1050)
     self.ro.sendData(res.getValue())
Example #11
0
 def lobby(self):
     res=Buffer()
     res.write_ushort(1030)
     res.write_short(1)
     res.write_short(1)
     self.ro.sendData(res.getValue())