forked from ubrabbit/go-game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
46 lines (40 loc) · 726 Bytes
/
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
package main
import (
"server/conf"
"server/db"
"server/game"
"server/gate"
"server/leaf"
lconf "server/leaf/conf"
"server/login"
"server/scene"
)
import (
"fmt"
"net/http"
_ "net/http/pprof"
)
import (
. "server/common"
)
func main() {
lconf.LogLevel = conf.Server.LogLevel
lconf.LogPath = conf.Server.LogPath
lconf.LogFlag = conf.LogFlag
lconf.ConsolePort = conf.Server.ConsolePort
lconf.ProfilePath = conf.Server.ProfilePath
go func() {
addr := fmt.Sprintf("localhost:%d", conf.Server.PprofPort)
err := http.ListenAndServe(addr, nil)
if err != nil {
LogError("pprof listen error: %v", err)
}
}()
leaf.Run(
db.Module,
gate.Module,
game.Module,
scene.Module,
login.Module,
)
}