-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
66 lines (59 loc) · 2.69 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package main
import (
"github.com/NumberMan1/MMO-server/bootstrap"
"github.com/NumberMan1/MMO-server/config/define"
"github.com/NumberMan1/MMO-server/core/vector3"
"github.com/NumberMan1/MMO-server/mgr"
"github.com/NumberMan1/MMO-server/model"
"github.com/NumberMan1/MMO-server/service"
"github.com/NumberMan1/common/logger"
"github.com/NumberMan1/common/summer"
"github.com/NumberMan1/common/summer/timeunit"
)
func initServices() {
bootstrap.Init("config/config.yaml")
//加载JSON配置文件
define.GetDataManagerInstance().Init()
//网路服务模块
netService := service.NewNetService()
netService.Start()
logger.SLCDebug("网络服务启动完成")
service.GetSpaceServiceInstance().Start()
logger.SLCDebug("地图服务启动完成")
service.GetUserServiceInstance().Start()
logger.SLCDebug("玩家服务启动完成")
service.GetBattleServiceInstance().Start()
logger.SLCDebug("战斗服务启动完成")
service.GetChatServiceInstance().Start()
logger.SLCDebug("聊天服务启动完成")
summer.GetScheduleInstance().Start()
logger.SLCDebug("定时器服务启动完成")
//space := model.GetSpaceManagerInstance().GetSpace(2)
//mon := space.MonsterManager.Create(1002, 3, vector3.NewVector3(270038, 0, 322005), vector3.Zero3())
//mon.AI = model.NewMonsterAI(mon)
summer.GetScheduleInstance().AddTask(func() {
mgr.GetEntityManagerInstance().Update()
model.GetSpaceManagerInstance().Update()
}, timeunit.Milliseconds, 20, 0)
model.CreateItemEntityById(1, 1001, 10, vector3.NewVector3(0, 0, 0), vector3.Zero3())
model.CreateItemEntityById(1, 1002, 5, vector3.NewVector3(3000, 0, 3000), vector3.Zero3())
model.CreateItemEntityById(1, 1003, 1, vector3.NewVector3(6000, 0, 4000), vector3.Zero3())
model.CreateItemEntityById(1, 1006, 1, vector3.NewVector3(6000, 0, 5000), vector3.Zero3())
model.CreateItemEntityById(1, 1007, 1, vector3.NewVector3(6000, 0, 6000), vector3.Zero3())
//传送门1:新手村=>森林
gate1 := model.NewGate(1, 4001001, vector3.NewVector3(10000, 0, 10000), vector3.Zero3())
gate1.SetName("传送门-森林入口")
gate1.SetTarget(model.GetSpaceManagerInstance().GetSpace(2), vector3.NewVector3(354947, 1660, 308498))
//传送门2:森林=>新手村
gate3 := model.NewGate(2, 4001001, vector3.NewVector3(346318, 1870, 319313), vector3.Zero3())
gate3.SetName("传送门-新手村")
gate3.SetTarget(model.GetSpaceManagerInstance().GetSpace(1), vector3.NewVector3(0, 0, 0))
//山贼附近
gate2 := model.NewGate(1, 4001001, vector3.NewVector3(15000, 0, 10000), vector3.Zero3())
gate2.SetName("传送门-山贼")
gate2.SetTarget(model.GetSpaceManagerInstance().GetSpace(2), vector3.NewVector3(263442, 5457, 306462))
}
func main() {
initServices()
select {}
}