mirror of
https://e.coding.net/circlecloud/CTZServerBridge.git
synced 2024-12-27 19:08:46 +00:00
read config from file...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
7231ef6cd3
commit
d6920d5146
@ -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);
|
||||
}
|
||||
}
|
||||
|
27
src/main/resources/config.yml
Normal file
27
src/main/resources/config.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user