Exemple #1
0
 def doLandDownload(self):
     self.checkLogined()
     data = self.doRequest("GET", CT_PROTOBUF, URL_SIMPSONS,
                           "/mh/games/bg_gameserver_plugin/protoland/%s/" % self.mUid, True)
     self.mLandMessage = ld_pb2.LandMessage()
     self.mLandMessage.ParseFromString(data)
     self.mPrompt = "%s@tsto > " % self.mLandMessage.friendData.name
     # make backup
     self.doFileSave(('save', "%s.%f" % (self.mUid, time.time())))
Exemple #2
0
 def doTokenDelete(self):
     self.checkLogined()
     dtr = ld_pb2.DeleteTokenRequest()
     dtr.token = self.mUpdateToken
     data = dtr.SerializeToString()
     data = self.doRequest("POST", CT_PROTOBUF, URL_SIMPSONS,
                           "/mh/games/bg_gameserver_plugin/deleteToken/%s/protoWholeLandToken/" % (self.mUid), True, data)
     dtr = ld_pb2.DeleteTokenResponse()
     dtr.ParseFromString(data)
     if dtr.result == False:
         print("FAIL")
     else:
         self.mLandMessageExtra = None
         self.mLandMessage = ld_pb2.LandMessage()
         self.mLogined = False
         self.mPrompt = "tsto > "
         print("OK")
Exemple #3
0
 def __init__(self):
     logging.basicConfig(level=logging.DEBUG)
     self.dataVerison = int(VERSION_LAND)
     self.mLogined = False
     self.mLandMessage = ld_pb2.LandMessage()
     self.mLandMessageExtra = None
     self.headers = dict()
     self.headers["Accept"] = "*/*"
     self.headers["Accept-Encoding"] = "gzip"
     self.headers["client_version"] = VERSION_APP
     self.headers["server_api_version"] = "4.0.0"
     self.headers["EA-SELL-ID"] = "857120"
     self.headers["platform"] = "android"
     self.headers["os_version"] = "15.0.0"
     self.headers["hw_model_id"] = "0 0.0"
     self.headers["data_param_1"] = "2633815347"
     self.mMhClientVersion = "Android." + VERSION_APP
     self.mSesSimpsons = requests.Session()
     self.mSesOther = requests.Session()
     self.mUid = None
     self.mPrompt = "tsto > "
     self.tokenLoadDefault()
Exemple #4
0
 def doFileOpen(self, args):
     self.mLandMessage = self.messageLoadFromFile(
         args[1], ld_pb2.LandMessage())
     self.mUid = self.mLandMessage.id
     self.mPrompt = "%s@tsto > " % self.mLandMessage.friendData.name