Exemple #1
0
func handleRegist(client *NetCore.Client, msg *NetCore.NetMsg) {
	if client != courier {
		Logger.Warn(LogConf.WorkerServerJob, LogConf.SERVER, "handleRegist error, %v %v!", courier, client)
	}
	Logger.Info(LogConf.WorkerServerJob, LogConf.SERVER, "handleRegist OK, %v %v!", courier, client)

	NetCore.MarkServer(client, NetConf.Courier)
}
Exemple #2
0
func handleRegist(client *NetCore.Client, msg *NetCore.NetMsg) {
	stype := binary.LittleEndian.Uint32(msg.Buf)
	NetCore.MarkServer(client, stype)
	addServerToMap(client)
	client.AddCloseCB("removeServer", removeServerFromMap)

	Logger.Info(LogConf.CourierServerJob, LogConf.SERVER, "Server Regist client idx: %d buf len: %d %d", client.GetIdx(), len(msg.Buf), stype)

	binary.LittleEndian.PutUint32(msg.Buf[0:4], NetConf.Courier)
	client.SendMsg(msg)
}
Exemple #3
0
func handleServerRegist(client *NetCore.Client, msg *NetCore.NetMsg) bool {
	if client != courier {
		Logger.Warn(LogConf.Admin, LogConf.SERVER, "handleServerRegist error, %v %d!", courier, client.Idx)
		return false
	}
	client.CancelWaitRegist()

	Logger.Info(LogConf.Admin, LogConf.SERVER, "handleServerRegist OK, %v %d!", courier, client.Idx)

	NetCore.MarkServer(client, NetConf.Courier)

	return true
}
Exemple #4
0
func handleRegist(client *NetCore.Client, msg *NetCore.NetMsg) bool {
	var ctype = binary.LittleEndian.Uint32(msg.Buf)
	//client.CancelWaitRegist()

	/*if ctype == NetConf.Client {
		binary.LittleEndian.PutUint32(msg.Buf[0:4], NetConf.Worker)
		client.SendMsg(msg)
	} else {*/
	if client != courier {
		Logger.Warn(LogConf.WorkerServerJob, LogConf.SERVER, "handleServerRegist error, %d!", client.Idx)
		return false
	}

	Logger.Info(LogConf.WorkerServerJob, LogConf.SERVER, "handleServerRegist OK, %d!", client.Idx)

	NetCore.MarkServer(client, ctype)
	//}

	Logger.Info(LogConf.WorkerServerJob, LogConf.SERVER, "handleRegist, type: %d %d!", ctype, client.Idx)

	return true
}