/// <summary> /// 处理事件 /// </summary> /// <param name="eventObject"></param> public void processEvent(EventObjectEx eventObject) { int eventType = eventObject.EventType; switch (eventType) { case (int)GlobalEventTypes.KuaFuNotifyEnterGame: { KuaFuNotifyEnterGameEvent e = eventObject as KuaFuNotifyEnterGameEvent; if (null != e) { KuaFuServerLoginData kuaFuServerLoginData = e.Arg as KuaFuServerLoginData; if (null != kuaFuServerLoginData) { lock (RuntimeData.Mutex) { RuntimeData.RoleIdKuaFuLoginDataDict[kuaFuServerLoginData.RoleId] = kuaFuServerLoginData; LogManager.WriteLog(LogTypes.Error, string.Format("通知角色ID={0}拥有进入跨服Boss资格,跨服GameID={1}", kuaFuServerLoginData.RoleId, kuaFuServerLoginData.GameId)); } } eventObject.Handled = true; } } break; } }
/// <summary> /// 处理事件 /// </summary> /// <param name="eventObject"></param> public void processEvent(EventObjectEx eventObject) { int eventType = eventObject.EventType; switch (eventType) { case (int)GlobalEventTypes.KuaFuRoleCountChange: { KuaFuFuBenRoleCountEvent e = eventObject as KuaFuFuBenRoleCountEvent; if (null != e) { GameClient client = GameManager.ClientMgr.FindClient(e.RoleId); if (null != client) { client.sendCmd((int)TCPGameServerCmds.CMD_SPR_HYSY_QUEUE_PLAYER_NUM, e.RoleCount); } eventObject.Handled = true; } } break; case (int)GlobalEventTypes.KuaFuNotifyEnterGame: { KuaFuNotifyEnterGameEvent e = eventObject as KuaFuNotifyEnterGameEvent; if (null != e) { KuaFuServerLoginData kuaFuServerLoginData = e.Arg as KuaFuServerLoginData; if (null != kuaFuServerLoginData) { GameClient client = GameManager.ClientMgr.FindClient(kuaFuServerLoginData.RoleId); if (null != client) { KuaFuServerLoginData clientKuaFuServerLoginData = Global.GetClientKuaFuServerLoginData(client); if (null != clientKuaFuServerLoginData) { clientKuaFuServerLoginData.RoleId = kuaFuServerLoginData.RoleId; clientKuaFuServerLoginData.GameId = kuaFuServerLoginData.GameId; clientKuaFuServerLoginData.GameType = kuaFuServerLoginData.GameType; clientKuaFuServerLoginData.EndTicks = kuaFuServerLoginData.EndTicks; clientKuaFuServerLoginData.ServerId = kuaFuServerLoginData.ServerId; clientKuaFuServerLoginData.ServerIp = kuaFuServerLoginData.ServerIp; clientKuaFuServerLoginData.ServerPort = kuaFuServerLoginData.ServerPort; clientKuaFuServerLoginData.FuBenSeqId = kuaFuServerLoginData.FuBenSeqId; client.sendCmd((int)TCPGameServerCmds.CMD_SPR_HYSY_ENTER_NOTIFY, clientKuaFuServerLoginData); } } } eventObject.Handled = true; } } break; } }
/// <summary> /// 处理事件 /// </summary> /// <param name="eventObject"></param> public void processEvent(EventObjectEx eventObject) { int eventType = eventObject.EventType; switch (eventType) { case (int)GlobalEventTypes.KuaFuNotifyEnterGame: { KuaFuNotifyEnterGameEvent e = eventObject as KuaFuNotifyEnterGameEvent; if (null != e) { KuaFuServerLoginData kuaFuServerLoginData = e.Arg as KuaFuServerLoginData; if (null != kuaFuServerLoginData) { lock (RuntimeData.Mutex) { RuntimeData.RoleIdKuaFuLoginDataDict[kuaFuServerLoginData.RoleId] = kuaFuServerLoginData; LogManager.WriteLog(LogTypes.Error, string.Format("通知角色ID={0}拥有进入勇者战场资格,跨服GameID={1}", kuaFuServerLoginData.RoleId, kuaFuServerLoginData.GameId)); } } eventObject.Handled = true; } } break; case (int)GlobalEventTypes.PlayerCaiJi: { CaiJiEventObject e = eventObject as CaiJiEventObject; if (null != e) { GameClient client = e.Source as GameClient; Monster monster = e.Target as Monster; OnCaiJiFinish(client, monster); eventObject.Handled = true; eventObject.Result = true; } } break; } }
public void processEvent(EventObjectEx eventObject) { int eventType = eventObject.EventType; int num = eventType; if (num == 10001) { KuaFuNotifyEnterGameEvent e = eventObject as KuaFuNotifyEnterGameEvent; if (null != e) { KuaFuServerLoginData kuaFuServerLoginData = e.Arg as KuaFuServerLoginData; if (null != kuaFuServerLoginData) { lock (this.RuntimeData.Mutex) { this.RuntimeData.RoleIdKuaFuLoginDataDict[kuaFuServerLoginData.RoleId] = kuaFuServerLoginData; LogManager.WriteLog(LogTypes.Error, string.Format("通知角色ID={0}拥有进入跨服Boss资格,跨服GameID={1}", kuaFuServerLoginData.RoleId, kuaFuServerLoginData.GameId), null, true); } } eventObject.Handled = true; } } }
public void processEvent(EventObjectEx eventObject) { switch (eventObject.EventType) { case 10000: { KuaFuFuBenRoleCountEvent e = eventObject as KuaFuFuBenRoleCountEvent; if (null != e) { GameClient client = GameManager.ClientMgr.FindClient(e.RoleId); if (null != client) { client.sendCmd(1303, e.RoleCount.ToString(), false); } eventObject.Handled = true; } break; } case 10001: { KuaFuNotifyEnterGameEvent e2 = eventObject as KuaFuNotifyEnterGameEvent; if (null != e2) { KuaFuServerLoginData kuaFuServerLoginData = e2.Arg as KuaFuServerLoginData; if (null != kuaFuServerLoginData) { GameClient client = GameManager.ClientMgr.FindClient(kuaFuServerLoginData.RoleId); if (null != client) { KuaFuServerLoginData clientKuaFuServerLoginData = Global.GetClientKuaFuServerLoginData(client); if (null != clientKuaFuServerLoginData) { clientKuaFuServerLoginData.RoleId = kuaFuServerLoginData.RoleId; clientKuaFuServerLoginData.GameId = kuaFuServerLoginData.GameId; clientKuaFuServerLoginData.GameType = kuaFuServerLoginData.GameType; clientKuaFuServerLoginData.EndTicks = kuaFuServerLoginData.EndTicks; clientKuaFuServerLoginData.ServerId = kuaFuServerLoginData.ServerId; clientKuaFuServerLoginData.ServerIp = kuaFuServerLoginData.ServerIp; clientKuaFuServerLoginData.ServerPort = kuaFuServerLoginData.ServerPort; clientKuaFuServerLoginData.FuBenSeqId = kuaFuServerLoginData.FuBenSeqId; client.sendCmd(1304, string.Format("{0}:{1}", kuaFuServerLoginData.GameId, e2.TeamCombatAvg), false); } } } eventObject.Handled = true; } break; } case 10004: { KuaFuNotifyCopyCancelEvent e3 = eventObject as KuaFuNotifyCopyCancelEvent; GameClient client = GameManager.ClientMgr.FindClient(e3.RoleId); if (client != null) { client.sendCmd(1306, string.Format("{0}:{1}", e3.GameId, e3.Reason), false); client.ClientData.SignUpGameType = 0; } eventObject.Handled = true; break; } case 10005: { KuaFuNotifyRealEnterGameEvent e4 = eventObject as KuaFuNotifyRealEnterGameEvent; if (e4 != null) { GameClient client = GameManager.ClientMgr.FindClient(e4.RoleId); if (client != null) { GlobalNew.RecordSwitchKuaFuServerLog(client); client.sendCmd <KuaFuServerLoginData>(14000, Global.GetClientKuaFuServerLoginData(client), false); client.ClientData.SignUpGameType = 0; } } eventObject.Handled = true; break; } } }
public void processEvent(EventObjectEx eventObject) { int eventType = eventObject.EventType; switch (eventType) { case (int)GlobalEventTypes.KuaFuRoleCountChange: { KuaFuFuBenRoleCountEvent e = eventObject as KuaFuFuBenRoleCountEvent; if (null != e) { GameClient client = GameManager.ClientMgr.FindClient(e.RoleId); if (null != client) { client.sendCmd((int)TCPGameServerCmds.CMD_MORI_NTF_ROLE_COUNT, e.RoleCount.ToString()); } eventObject.Handled = true; } } break; case (int)GlobalEventTypes.KuaFuNotifyEnterGame: { KuaFuNotifyEnterGameEvent e = eventObject as KuaFuNotifyEnterGameEvent; if (null != e) { KuaFuServerLoginData kuaFuServerLoginData = e.Arg as KuaFuServerLoginData; if (null != kuaFuServerLoginData) { GameClient client = GameManager.ClientMgr.FindClient(kuaFuServerLoginData.RoleId); if (null != client) { KuaFuServerLoginData clientKuaFuServerLoginData = Global.GetClientKuaFuServerLoginData(client); if (null != clientKuaFuServerLoginData) { clientKuaFuServerLoginData.RoleId = kuaFuServerLoginData.RoleId; clientKuaFuServerLoginData.GameId = kuaFuServerLoginData.GameId; clientKuaFuServerLoginData.GameType = kuaFuServerLoginData.GameType; clientKuaFuServerLoginData.EndTicks = kuaFuServerLoginData.EndTicks; clientKuaFuServerLoginData.ServerId = kuaFuServerLoginData.ServerId; clientKuaFuServerLoginData.ServerIp = kuaFuServerLoginData.ServerIp; clientKuaFuServerLoginData.ServerPort = kuaFuServerLoginData.ServerPort; clientKuaFuServerLoginData.FuBenSeqId = kuaFuServerLoginData.FuBenSeqId; client.sendCmd((int)TCPGameServerCmds.CMD_MORI_NTF_ENTER, string.Format("{0}:{1}", kuaFuServerLoginData.GameId, e.TeamCombatAvg)); } } } eventObject.Handled = true; } } break; case (int)GlobalEventTypes.KuaFuCopyCanceled: { KuaFuNotifyCopyCancelEvent e = eventObject as KuaFuNotifyCopyCancelEvent; GameClient client = GameManager.ClientMgr.FindClient(e.RoleId); if (client != null) { client.sendCmd((int)TCPGameServerCmds.CMD_NTF_MORI_COPY_CANCEL, string.Format("{0}:{1}", e.GameId, e.Reason)); client.ClientData.SignUpGameType = (int)GameTypes.None; } // MoRiJudgeClient.getInstance().ChangeRoleState(e.RoleId, KuaFuRoleStates.None); eventObject.Handled = true; } break; case (int)GlobalEventTypes.KuaFuNotifyRealEnterGame: { KuaFuNotifyRealEnterGameEvent e = eventObject as KuaFuNotifyRealEnterGameEvent; if (e != null) { GameClient client = GameManager.ClientMgr.FindClient(e.RoleId); if (client != null) { GlobalNew.RecordSwitchKuaFuServerLog(client); client.sendCmd((int)TCPGameServerCmds.CMD_SPR_KF_SWITCH_SERVER, Global.GetClientKuaFuServerLoginData(client)); client.ClientData.SignUpGameType = (int)GameTypes.None; } } eventObject.Handled = true; } break; } }