-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.go
52 lines (47 loc) · 1.37 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"fmt"
_ "fmt"
"github.com/TISUnion/most-simple-mcd/constant"
"github.com/TISUnion/most-simple-mcd/modules"
pack_webfile "github.com/TISUnion/most-simple-mcd/pack-webfile"
"github.com/TISUnion/most-simple-mcd/plugins"
"github.com/TISUnion/most-simple-mcd/services"
"github.com/TISUnion/most-simple-mcd/utils"
"gopkg.in/ini.v1"
"runtime"
)
// 初始化
func ModuleInit() {
// 处理退出逻辑
go modules.ExitHandle()
ini.PrettyFormat = false
// 注册插件到容器中
plugins.RegisterPlugin()
// 解压前端静态文件
_ = pack_webfile.UnCompress()
// 创建服务端容器对象
modules.GetMinecraftServerContainerInstance()
// 注册gin路由
services.RegisterServices()
// 开启web服务器
_ = modules.GetGinServerInstance().Start()
}
func main() {
// 打印banner
fmt.Println(modules.DrawBanner("M C D"))
// 启动各服务
ModuleInit()
// 打印信息
webManageUrl := modules.GetWebManageUrl()
// 如果是windows就自动打开浏览器
if runtime.GOOS == constant.OS_WINDOWS {
utils.OpenBrowser(webManageUrl)
}
fmt.Println("启动成功!")
fmt.Println("本项目开源并且免费,项目仓库:https://github.com/TISUnion/most-simple-mcd")
fmt.Println("管理后台url: " + webManageUrl)
fmt.Println("初始账号: " + constant.DEFAULT_ACCOUNT)
fmt.Println("初始密码: " + constant.DEFAULT_PASSWORD)
select {}
}