Some small updates :)

This commit is contained in:
Bigsk 2020-11-15 12:30:26 +08:00
parent 7c0d50a6e7
commit 38463871a1
11 changed files with 25 additions and 108 deletions

28
main.py
View File

@ -26,13 +26,16 @@ class GMCLCore(object):
self.__GamePath=GamePath
self.__Version=Version
'''
def __init__(self,LauncherName="GMCLCore",LauncherVersion="A0.2.0"):
def __init__(self,LauncherName="GMCLCore",LauncherVersion="A0.2.0",LogOutput=False):
'''The global variable set function'''
''':LauncherName The name of your launcher,default value is "GMCLCore".'''
''':LauncherVersion The version of your launcher,default value is the version of core.'''
''':LauncherName The name of your launcher,the default value is "GMCLCore"'''
''':LauncherVersion The version of your launcher,the default value is the version of core'''
''':LogOutput The switch of the log output function,the default value is False'''
self.__LauncherName=LauncherName
self.__LauncherVersion=LauncherVersion
self.__LogOutput=LogOutput
self.__UserAgent={'User-Agent':LauncherName+'/'+LauncherVersion+' ((GMCL Core Alpha 0.2.0;Alpha))'}
self.__Log=[]
def SearchFile(self,Path,Tag,Num=1):
'''The function which was used to search files'''
''':Path The root path you want to search'''
@ -49,6 +52,25 @@ class GMCLCore(object):
else:
pass
return List
def MakeDir(self,Path):
'''The function which was used to create a dir with determination'''
''':Path The path of the dir you want to create'''
if(os.path.isdir(Path)==False):
os.mkdir(Path)
def Log(self,Type,Text):
'''The function which was used to manager the log output system'''
''':Type Type of the log info'''
''':Text The main text of log info'''
if(Text!="" or None):
if(Type=="info"):
self.__Log.append(("INFO",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Text))
elif(Type=="warn"):
self.__Log.append(("WARN",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Text))
elif(Type=="error"):
self.__Log.append(("ERROR",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Text))
else:
self.__Log.append(("OTHER",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Text))
return Text
def GetUUID(self,Account="Steve"):
'''The function which was used to generate UUID'''
''':Account Your account,the default value is "Steve"'''

Binary file not shown.

View File

@ -1,9 +0,0 @@
[Logs Output]
[Program][2020-08-19 17:17:41][INFO]Starting to read config file.
[Ghink Minecraft Launcher Core][2020-08-19 17:17:41][INFO]Read config successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:17:41][INFO]The dir temp does not exist.The Ghink Minecraft Launcher Core will create one.
[Ghink Minecraft Launcher Core][2020-08-19 17:17:44][INFO]Start to deal the tasks that need to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:17:44][INFO]Starting to save logs.
[Ghink Minecraft Launcher Core][2020-08-19 17:17:44][INFO]The dir logs does not exist.The Ghink Minecraft Launcher Core will create one.
[Ghink Minecraft Launcher Core][2020-08-19 17:17:44][INFO]Save logs successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:17:44][INFO]The task has done successfully.

View File

@ -1,9 +0,0 @@
[Logs Output]
[Program][2020-08-19 17:18:15][INFO]Starting to read config file.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:15][INFO]Read config successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:15][INFO]The dir temp has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:15][INFO]Start to deal the tasks that need to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:15][INFO]Starting to save logs.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:15][INFO]The dir logs has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:15][INFO]Save logs successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:15][INFO]The task has done successfully.

View File

@ -1,10 +0,0 @@
[Logs Output]
[Program][2020-08-19 17:18:38][INFO]Starting to read config file.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:38][INFO]Read config successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:38][INFO]The dir temp has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:38][INFO]Start to deal the tasks that need to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:38][INFO]Get game versions list mode.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:39][INFO]Starting to save logs.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:39][INFO]The dir logs has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:39][INFO]Save logs successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:39][INFO]The task has done successfully.

View File

@ -1,10 +0,0 @@
[Logs Output]
[Program][2020-08-19 17:18:40][INFO]Starting to read config file.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:40][INFO]Read config successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:40][INFO]The dir temp has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:40][INFO]Start to deal the tasks that need to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:40][INFO]Get system java environment path mode.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:41][INFO]Starting to save logs.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:41][INFO]The dir logs has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:41][INFO]Save logs successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:41][INFO]The task has done successfully.

View File

@ -1,16 +0,0 @@
[Logs Output]
[Program][2020-08-19 17:18:33][INFO]Starting to read config file.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:33][INFO]Read config successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:33][INFO]The dir temp has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:33][INFO]Start to deal the tasks that need to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:33][INFO]Launcher game mode.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:33][INFO]Checking game dir.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:33][INFO]Checking game copyright.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:37][INFO]Checking game version(s).
[Ghink Minecraft Launcher Core][2020-08-19 17:18:39][INFO]Checking game files.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:39][INFO]Checking java environment.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:41][INFO]Checking memory parameter.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:42][INFO]Starting to save logs.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:42][INFO]The dir logs has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:42][INFO]Save logs successfully.
[Ghink Minecraft Launcher Core][2020-08-19 17:18:42][INFO]The task has done successfully.

View File

@ -1,10 +0,0 @@
[Logs Output]
[Program][2020-08-19 18:14:34][INFO]Starting to read config file.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]Read config successfully.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]The dir temp has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:35][INFO]Start to deal the tasks that need to do.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:35][INFO]Get game versions list mode.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:35][INFO]Starting to save logs.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:35][INFO]The dir logs has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:35][INFO]Save logs successfully.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:35][INFO]The task has done successfully.

View File

@ -1,10 +0,0 @@
[Logs Output]
[Program][2020-08-19 18:14:36][INFO]Starting to read config file.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:36][INFO]Read config successfully.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:36][INFO]The dir temp has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:36][INFO]Start to deal the tasks that need to do.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:36][INFO]Get system java environment path mode.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:37][INFO]Starting to save logs.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:37][INFO]The dir logs has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:37][INFO]Save logs successfully.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:37][INFO]The task has done successfully.

View File

@ -1,18 +0,0 @@
[Logs Output]
[Program][2020-08-19 18:14:34][INFO]Starting to read config file.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]Read config successfully.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]The dir temp has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]Start to deal the tasks that need to do.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]Launcher game mode.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]Checking game dir.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]Checking game copyright.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]Checking player uuid.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:34][INFO]Checking game version(s).
[Ghink Minecraft Launcher Core][2020-08-19 18:14:35][INFO]Checking game files.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:35][INFO]The dir C:\Users\Bigsk\Desktop\.minecraft\versions\1.7.10\natives does not exist.The Ghink Minecraft Launcher Core will create one.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:35][INFO]Checking java environment.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:37][INFO]Checking memory parameter.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:38][INFO]Starting to save logs.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:38][INFO]The dir logs has already existed.Nothing to do.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:38][INFO]Save logs successfully.
[Ghink Minecraft Launcher Core][2020-08-19 18:14:38][INFO]The task has done successfully.

View File

@ -1,13 +0,0 @@
[18:14:40] [main/INFO]: Setting user: Bigsk
[18:14:40] [main/INFO]: (Session ID is token:9eabeeaf108a57d4f0828c364b214857:9eabeeaf108a57d4f0828c364b214857)
[18:14:40] [Client thread/INFO]: LWJGL Version: 2.9.1
[18:14:41] [Client thread/ERROR]: Couldn't initialize twitch stream
[18:14:41] [Client thread/INFO]: Reloading ResourceManager: Default
[18:14:42] [Sound Library Loader/INFO]: Sound engine started
[18:14:43] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
[18:14:43] [Client thread/INFO]: Created: 256x256 textures/items-atlas
[18:14:50] [Client thread/INFO]: Reloading ResourceManager: Default
[18:14:50] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
[18:14:50] [Client thread/INFO]: Created: 256x256 textures/items-atlas
[18:14:51] [Sound Library Loader/INFO]: Sound engine started
[18:14:58] [Client thread/INFO]: Stopping!