Some Small Updates :)
This commit is contained in:
parent
eb6fdc4922
commit
1c2851e36b
17
core.py
17
core.py
@ -65,7 +65,7 @@ class GMCLCore(object):
|
|||||||
''':Path The path of the dir you want to create'''
|
''':Path The path of the dir you want to create'''
|
||||||
if(os.path.isdir(Path)==False):
|
if(os.path.isdir(Path)==False):
|
||||||
os.mkdir(Path)
|
os.mkdir(Path)
|
||||||
return self.Log("info","Successful.","MakeDir")
|
self.Log("info","Successful.","MakeDir")
|
||||||
else:
|
else:
|
||||||
return self.Log("warn","Exist.","MakeDir")
|
return self.Log("warn","Exist.","MakeDir")
|
||||||
def SearchFile(self,Path,Tag,Num=1):
|
def SearchFile(self,Path,Tag,Num=1):
|
||||||
@ -83,6 +83,7 @@ class GMCLCore(object):
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
self.Log("info","Success.","SearchFile")
|
||||||
return List
|
return List
|
||||||
def GetUUID(self,Account="Steve"):
|
def GetUUID(self,Account="Steve"):
|
||||||
'''The function which was used to generate UUID'''
|
'''The function which was used to generate UUID'''
|
||||||
@ -91,17 +92,21 @@ class GMCLCore(object):
|
|||||||
result="OfflinePlayer:"+Account
|
result="OfflinePlayer:"+Account
|
||||||
md5=hashlib.md5()
|
md5=hashlib.md5()
|
||||||
md5.update(result.encode(encoding='utf-8'))
|
md5.update(result.encode(encoding='utf-8'))
|
||||||
|
self.Log("info","Success.","GetUUID")
|
||||||
return md5.hexdigest()
|
return md5.hexdigest()
|
||||||
else:
|
else:
|
||||||
return "Error:Wrong Auth Way."
|
return self.Log("warn","Wrong auth way","GetUUID")
|
||||||
def GetJavaPath(self,Num=1):
|
def GetJavaPath(self,Num=1):
|
||||||
'''The function which was used to search java'''
|
'''The function which was used to search java'''
|
||||||
''':Num How much result you want to get,you should set as "all" if you want to return all result,the default value is 1'''
|
''':Num How much result you want to get,you should set as "all" if you want to return all result,the default value is 1'''
|
||||||
if(platform.system()=="Windows"):
|
if(platform.system()=="Windows"):
|
||||||
|
self.Log("info","Success.","GetJavaPath")
|
||||||
return self.SearchFile('C:\\','javaw.exe',Num)
|
return self.SearchFile('C:\\','javaw.exe',Num)
|
||||||
elif(platform.system()=="Linux"):
|
elif(platform.system()=="Linux"):
|
||||||
|
self.Log("info","Success.","GetJavaPath")
|
||||||
return self.SearchFile('\\','java',Num)
|
return self.SearchFile('\\','java',Num)
|
||||||
else:
|
else:
|
||||||
|
self.Log("info","Success.","GetJavaPath")
|
||||||
return self.SearchFile('\\','java',Num)
|
return self.SearchFile('\\','java',Num)
|
||||||
def SetAccount(self,Account="Steve",Password=""):
|
def SetAccount(self,Account="Steve",Password=""):
|
||||||
'''The function which was used to set game account data'''
|
'''The function which was used to set game account data'''
|
||||||
@ -114,17 +119,19 @@ class GMCLCore(object):
|
|||||||
self.__Token=result['accessToken']
|
self.__Token=result['accessToken']
|
||||||
self.__UUID=result['selectedProfile']['id']
|
self.__UUID=result['selectedProfile']['id']
|
||||||
self.__ID=result['selectedProfile']['name']
|
self.__ID=result['selectedProfile']['name']
|
||||||
|
self.Log("info","Success.","GetAccount")
|
||||||
else:
|
else:
|
||||||
return "Error:Fail to request Mojang\'s Auth Server."
|
return Log("warn","Fail to request Mojang\'s auth server.","SetAccount")
|
||||||
else:
|
else:
|
||||||
return "Error:Wrong Account."
|
return Log("warn","Wrong Account.","SetAccount")
|
||||||
elif(self.__AuthWay=="offline"):
|
elif(self.__AuthWay=="offline"):
|
||||||
if(Account.count("@")==1):
|
if(Account.count("@")==1):
|
||||||
return "Error:Wrong Account."
|
return Log("warn","Wrong Account.","SetAccount")
|
||||||
else:
|
else:
|
||||||
self.__ID=Account
|
self.__ID=Account
|
||||||
self.__UUID=self.GetUUID(Account)
|
self.__UUID=self.GetUUID(Account)
|
||||||
self.__Token=""
|
self.__Token=""
|
||||||
|
self.Log("info","Success.","GetAccount")
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
def SetAuthWay(self,AuthWay):
|
def SetAuthWay(self,AuthWay):
|
||||||
|
Reference in New Issue
Block a user