예제 #1
0
파일: Map.go 프로젝트: sinni800/sgemu
func NewMap(mapid uint32, typ MapType) *Map {
	m := new(Map)
	m.Players = make(map[uint32]*GClient)
	m.Run = C.NewRunner()
	m.Run.Start()
	m.MapID = mapid
	m.Type = typ
	return m
}
예제 #2
0
파일: GServer.go 프로젝트: sinni800/sgemu
func (serv *GServer) OnSetup() {
	serv.CoreServer.OnSetup()
	serv.Maps = make(map[uint32]*Map)
	serv.IDG = Core.NewIDG()

	serv.Maps[100706] = NewMap(100706, BaseZone)
	serv.Maps[100106] = NewMap(100106, BaseZone)

	serv.Run = Core.NewRunner()
	serv.DBRun = Core.NewRunner()
	serv.Sdr = Core.NewScheduler()
	serv.Run.Start()
	serv.DBRun.Start()
	serv.Sdr.Start()

	serv.ServerTime = time.Now()

	serv.Sdr.AddMin(func() { serv.SavePlayers() }, 1)

	startRPCServer()

	go serv.AcceptClients()
	//serv.Sdr.AddSec(func() { serv.SavePlayers() }, 5)
}