/
moba.go
43 lines (31 loc) · 832 Bytes
/
moba.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
package main
import (
"fmt"
"time"
"github.com/golang/glog"
"github.com/yangsf5/claw/center"
"github.com/yangsf5/claw/service"
"github.com/yangsf5/moba/server/handler"
"github.com/yangsf5/moba/server/hero"
myService "github.com/yangsf5/moba/server/service"
"github.com/yangsf5/moba/server/service/room"
)
var ()
func main() {
glog.Info("MOBA server start!")
service.Register()
myService.Register()
handler.RegisterHandler()
hero.ReadConfig("client/resource/config/hero.json")
willUseServices := []string{"Error", "Web", "MobaWebsocket", "MobaHall"}
for i := 1; i <= room.RoomCount; i++ {
name := fmt.Sprintf("MobaRoom%d", i)
willUseServices = append(willUseServices, name)
}
center.Use(willUseServices)
for {
time.Sleep(100 * time.Millisecond)
}
glog.Info("MOBA server exit!")
glog.Flush()
}