initGson в ServerWrapper

This commit is contained in:
Gravit 2019-01-04 18:19:34 +07:00
parent b70e781fa7
commit 3fe5a34029
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -77,6 +77,13 @@ public static boolean loopAuth(ServerWrapper wrapper, int count, int sleeptime)
return false;
}
public static void initGson()
{
if(Launcher.gson != null) return;
Launcher.gsonBuilder = new GsonBuilder();
Launcher.gson = Launcher.gsonBuilder.create();
}
@SuppressWarnings("ConfusingArgumentToVarargsMethod")
public static void main(String[] args) throws Throwable {
ServerWrapper wrapper = new ServerWrapper();
@ -90,6 +97,7 @@ public static void main(String[] args) throws Throwable {
gsonBuiler = new GsonBuilder();
gsonBuiler.setPrettyPrinting();
gson = gsonBuiler.create();
initGson();
generateConfigIfNotExists();
try(Reader reader = IOHelper.newReader(configFile))
{