Files
HMCL/HMCLServer/src/main/java/org.jackhuang.hellominecraft.launcher/servers/mfcraft/Servers.java

51 lines
1.6 KiB
Java
Raw Normal View History

2015-12-27 10:59:03 +08:00
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.launcher.servers.mfcraft;
import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.NetUtils;
/**
*
* @author huangyuhui
*/
public class Servers {
public static Servers instance;
public static Servers getInstance() {
if (instance == null) {
String servers = null;
try {
servers = NetUtils.get("http://zh.mfcraft.cn/View/servers.php");
instance = C.gson.fromJson(servers, Servers.class);
} catch (IOException ex) {
HMCLog.err("Failed to get servers");
}
}
return instance;
}
public ArrayList<ServerArea> areas;
}