read config from file...

Signed-off-by: 502647092 <jtb1@163.com>
master
502647092 2015-09-16 20:54:04 +08:00
parent 7231ef6cd3
commit d6920d5146
2 changed files with 34 additions and 1 deletions

View File

@ -45,6 +45,12 @@ public class CTZServerBridge extends JavaPlugin {
*
*/
void initDatabase() {
CTZAuth.init(sql, "127.0.0.1", 3306, "ctzserver", "root", "325325");
// 连接数据库用到的一些参数.
String dbHost = config.getMessage("config.mysql.ip");
int dbPort = config.getInt("config.mysql.port");
String dbName = config.getMessage("config.mysql.database");
String dbuserName = config.getMessage("config.mysql.username");
String dbpwd = config.getMessage("config.mysql.password");
CTZAuth.init(sql, dbHost, dbPort, dbName, dbuserName, dbpwd);
}
}

View File

@ -0,0 +1,27 @@
#本文件为登录插件的主配置文件
version: '1.0'
#服务器名称
servername: ''
#插件名称
pluginname: '&6[&bCTZL&6]&r'
#是否提示
tipplayer: true
#服务器配置
config:
#服务器监听端口
port: 25580
#断线重连超时
timeout: 10
#强制使用专用客户端(关闭则可以同时使用自带登录和外部登录)
forceclient: true
mysql:
#数据库需要自行建立
database: minecraft
#用户名
username: root
#密码
password: 325325
#地址
ip: localhost
#端口
port: 3306