parent
ed3d4c09d5
commit
214537ddee
|
@ -8,15 +8,15 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import cn.citycraft.CTZServerBridge.listen.PlayerListen;
|
import cn.citycraft.CTZServerBridge.listen.PlayerListen;
|
||||||
import cn.citycraft.CTZServerCommon.CTZAuth;
|
import cn.citycraft.CTZServerCommon.CTZAuth;
|
||||||
import cn.citycraft.PluginHelper.config.FileConfig;
|
import cn.citycraft.PluginHelper.config.FileConfig;
|
||||||
import cn.citycraft.PluginHelper.sql.DataBaseCore;
|
import cn.citycraft.PluginHelper.sql.DataBase;
|
||||||
|
|
||||||
public class CTZServerBridge extends JavaPlugin {
|
public class CTZServerBridge extends JavaPlugin {
|
||||||
|
|
||||||
ConsoleCommandSender ccs;
|
ConsoleCommandSender ccs;
|
||||||
DataBaseCore sql;
|
DataBase sql;
|
||||||
public FileConfig config;
|
public FileConfig config;
|
||||||
|
|
||||||
public DataBaseCore getSql() {
|
public DataBase getSql() {
|
||||||
return sql;
|
return sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public class CTZServerBridge extends JavaPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initListener() {
|
private void initListener() {
|
||||||
PluginManager pm = Bukkit.getPluginManager();
|
final PluginManager pm = Bukkit.getPluginManager();
|
||||||
pm.registerEvents(new PlayerListen(this), this);
|
pm.registerEvents(new PlayerListen(this), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,11 +46,11 @@ public class CTZServerBridge extends JavaPlugin {
|
||||||
*/
|
*/
|
||||||
void initDatabase() {
|
void initDatabase() {
|
||||||
// 连接数据库用到的一些参数.
|
// 连接数据库用到的一些参数.
|
||||||
String dbHost = config.getMessage("config.mysql.ip");
|
final String dbHost = config.getMessage("config.mysql.ip");
|
||||||
int dbPort = config.getInt("config.mysql.port");
|
final int dbPort = config.getInt("config.mysql.port");
|
||||||
String dbName = config.getMessage("config.mysql.database");
|
final String dbName = config.getMessage("config.mysql.database");
|
||||||
String dbuserName = config.getMessage("config.mysql.username");
|
final String dbuserName = config.getMessage("config.mysql.username");
|
||||||
String dbpwd = config.getMessage("config.mysql.password");
|
final String dbpwd = config.getMessage("config.mysql.password");
|
||||||
CTZAuth.init(sql, dbHost, dbPort, dbName, dbuserName, dbpwd);
|
CTZAuth.init(sql, dbHost, dbPort, dbName, dbuserName, dbpwd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue