This repository has been archived on 2022-12-28. You can view files and clone it, but cannot push or open issues or pull requests.
gmclcore/main.py
2020-10-23 13:25:17 +08:00

28 lines
1.2 KiB
Python

#------------------#
import os,requests,json,time,sys,psutil,string,platform,glob,getpass,shutil,hashlib,random,subprocess,math,zipfile
#------------------#
class GMCLCore(object):
def __int__(self,LauncherName="GMCLCore",LauncherVersion="A0.2.0",AuthWay="offline",Account="Steve",Password="",GamePath=".minecraft",Memory="1GB",Version="",Java="",DownloadFrom="",DownloadTo=""):
self.__LauncherName=LauncherName
self.__LauncherVersion=LauncherVersion
self.GetAuthWay(AuthWay)
self.GetAccoutn(Account)
self.__Password=Password
self.__GamePath=GamePath
self.GetMemory(Memory)
self.__Version=Version
self.__Java=Java
self.Download(DownloadFrom,DownloadTo)
self.__UserAgent={'User-Agent':LauncherName+'/'+LauncherVersion+' ((GMCL Core Alpha 0.2.0;Alpha))'}
def GetAuthWay(self,AuthWay):
if(AuthWay=="offline"):
self.__AuthWay="offline"
elif(AuthWay=="online"):
self.__AuthWay="online"
else:
return "Error:Wrong Auth Way."
def GetMemory(self,Memory):
if(Memory.count("B")>1 or Memory.count("b")>1):
return "Error:Wrong Memory Unit."
else:
if(Memory.count("GB"))