diff --git a/main.py b/main.py index 90c4598..d55d7de 100644 --- a/main.py +++ b/main.py @@ -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"''' diff --git a/old/0.1.0/logs/2020-08-19-1.log.gz b/old/0.1.0/logs/2020-08-19-1.log.gz deleted file mode 100644 index 935f7f8..0000000 Binary files a/old/0.1.0/logs/2020-08-19-1.log.gz and /dev/null differ diff --git a/old/0.1.0/logs/2020-08-19-17-17-44.txt b/old/0.1.0/logs/2020-08-19-17-17-44.txt deleted file mode 100644 index 93aeeab..0000000 --- a/old/0.1.0/logs/2020-08-19-17-17-44.txt +++ /dev/null @@ -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. \ No newline at end of file diff --git a/old/0.1.0/logs/2020-08-19-17-18-15.txt b/old/0.1.0/logs/2020-08-19-17-18-15.txt deleted file mode 100644 index f40d22f..0000000 --- a/old/0.1.0/logs/2020-08-19-17-18-15.txt +++ /dev/null @@ -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. \ No newline at end of file diff --git a/old/0.1.0/logs/2020-08-19-17-18-39.txt b/old/0.1.0/logs/2020-08-19-17-18-39.txt deleted file mode 100644 index 3e55a00..0000000 --- a/old/0.1.0/logs/2020-08-19-17-18-39.txt +++ /dev/null @@ -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. \ No newline at end of file diff --git a/old/0.1.0/logs/2020-08-19-17-18-41.txt b/old/0.1.0/logs/2020-08-19-17-18-41.txt deleted file mode 100644 index 4247718..0000000 --- a/old/0.1.0/logs/2020-08-19-17-18-41.txt +++ /dev/null @@ -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. \ No newline at end of file diff --git a/old/0.1.0/logs/2020-08-19-17-18-42.txt b/old/0.1.0/logs/2020-08-19-17-18-42.txt deleted file mode 100644 index d0d728c..0000000 --- a/old/0.1.0/logs/2020-08-19-17-18-42.txt +++ /dev/null @@ -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. \ No newline at end of file diff --git a/old/0.1.0/logs/2020-08-19-18-14-35.txt b/old/0.1.0/logs/2020-08-19-18-14-35.txt deleted file mode 100644 index 0aca8d7..0000000 --- a/old/0.1.0/logs/2020-08-19-18-14-35.txt +++ /dev/null @@ -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. \ No newline at end of file diff --git a/old/0.1.0/logs/2020-08-19-18-14-37.txt b/old/0.1.0/logs/2020-08-19-18-14-37.txt deleted file mode 100644 index 1ae3160..0000000 --- a/old/0.1.0/logs/2020-08-19-18-14-37.txt +++ /dev/null @@ -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. \ No newline at end of file diff --git a/old/0.1.0/logs/2020-08-19-18-14-38.txt b/old/0.1.0/logs/2020-08-19-18-14-38.txt deleted file mode 100644 index 9b338ae..0000000 --- a/old/0.1.0/logs/2020-08-19-18-14-38.txt +++ /dev/null @@ -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. \ No newline at end of file diff --git a/old/0.1.0/logs/latest.log b/old/0.1.0/logs/latest.log deleted file mode 100644 index db3b1ab..0000000 --- a/old/0.1.0/logs/latest.log +++ /dev/null @@ -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!