def login(self, rid, cookie): #type@=loginreq/username@=51425727/ct@=0/password@=870d8d6853e0843895ea6b477d64d8d7/ #roomid@=210008/devid@=2B3F65BB2B06D73B542A5F13BD0FBFA8/rt@=1471601814/vk@=7d816a706dcd99dc9555d7656c16a557/ #ver@=20150929/aver@=2016081801/ltkid@=98727346/biz@=1/stk@=abde9a6102dcff12/ # Send AUTH request # devid = str(uuid.uuid4()).replace("-", "").upper() # rt = str(int(time.time())) # devid = '2B3F65BB2B06D73B542A5F13BD0FBFA8' # strs = rt + '7oE9nPEG9xXV69phU31FYCLUagKeYtsF' + devid # vk = hashlib.md5(strs).hexdigest() swfapi = Swfapi(SWFAPI_IP, SWFAPI_PORT) swf_req = { "func": "xxUserLogin", "username": cookie['acf_username'], "password": cookie['acf_auth'], "devid": cookie.get('acf_devid', ''), "ltkid": cookie['acf_ltkid'], "biz": cookie['acf_biz'], "stk": cookie['acf_stk'], "roomid": str(rid), "ct": cookie['acf_ct'], "ver": self.ver, "aver": self.aver, } swf_rst = swfapi.xxSwfApi(swf_req) self.client.send_text(swf_rst['text'])
def keep_live_fun(auth): vbw = 0 swfapi = Swfapi(SWFAPI_IP, SWFAPI_PORT) # keepliveStr : keeplive respone packet if auth.keepliveStr != "": swf_req = { "func": "xxKeepGu", "vbw": vbw, "keepliveStr": auth.keepliveStr } swf_rst = swfapi.xxSwfApi(swf_req) auth.client.send_text(swf_rst['text']) auth.keepliveStr = "" else: swf_req = {"func": "xxKeepLive", "vbw": vbw} swf_rst = swfapi.xxSwfApi(swf_req) auth.client.send_text(swf_rst['text'])
def logout(self, rid, cookie): swfapi = Swfapi(SWFAPI_IP, SWFAPI_PORT) swf_req = { "func": "xxUserLogin", "username": cookie['acf_username'], "password": cookie['acf_auth'], "devid": cookie.get('acf_devid', ''), "ltkid": cookie['acf_ltkid'], "biz": cookie['acf_biz'], "stk": cookie['acf_stk'], "roomid": str(rid), "ct": cookie['acf_ct'], "ver": self.ver, "aver": self.aver, } swf_rst = swfapi.xxSwfApi(swf_req) self.client.send_text(swf_rst['text'])
def msg_vq_hdlr(self, str): swfapi = Swfapi(SWFAPI_IP, SWFAPI_PORT) swf_req = {"func": "xxVq", "str": str} swf_rst = swfapi.xxSwfApi(swf_req) self.client.send_text(swf_rst['text'])
def msg_suq_hdlr(self, str): swfapi = Swfapi(SWFAPI_IP, SWFAPI_PORT) swf_req = {"func": "xxSuq", "pwd": self.cookie['acf_stk'], "str": str} swf_rst = swfapi.xxSwfApi(swf_req) self.client.send_text(swf_rst['text'])