示例#1
0
func (this *TimerManager) Init() {

	//体力恢复刷新
	//distance_time := int32(Csv.property[2057].Id_102)
	timer.CreateTimer(100, true, this.TimerDealEnergy)

	//悬赏任务刷新
	//distance_time2 := int32(Csv.property[2013].Id_102)
	//timer.CreateTimer(30, true, this.TimerDealXuanShang)
}
示例#2
0
func main() {
	//连接账号服务器
	var err error
	conn2a, err = net.Dial("tcp", sys_config.Server2AccountAddress)
	if CheckError(err) {
		//定时告诉账号服务器当前人数
		timer.CreateTimer(sys_config.DistanceTime, true, deal_2a.send2AccountMenber)

		//接收account服务器发来的消息
		go deal_2a.Handler2A(conn2a)
	}

	//监听玩家连接
	listener1, err1 := net.Listen("tcp", sys_config.ServerAddress)
	if CheckError(err1) {
		go deal_4c.Deal4Client(listener1)
	}

	<-end
}