/// <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;
            }
        }
Beispiel #2
0
        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;
            }
            }
        }
Beispiel #3
0
        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;
            }
        }