Пример #1
0
 private void RaisePacketReceived(PacketReceivedEventArgs e)
 {
     if (PacketReceived != null)
         PacketReceived(this, e);
 }
Пример #2
0
 protected void ClientPacketReceived(object sender, PacketReceivedEventArgs e)
 {
     RaisePacketReceived(e);
 }
Пример #3
0
        private void HandlePacket(object sender, PacketReceivedEventArgs e)
        {
            //_packetLogger.Log<EAuthPacket>(e.Packet);

            switch (e.Packet.PacketID)
            {
                case (byte)EAuthPacket.CAuthReq:
                    HandleAuthRequest(e.Session, e.Packet);
                    break;

                case (byte)EAuthPacket.CLoginReq:
                    HandleLoginRequest(e.Session, e.Packet);
                    break;

                default:
                    _logger.Warning("Unknown packet {0}", e.Packet.PacketID.ToString("x2"));
                    break;
            }
        }
Пример #4
0
        private void HandlePacket(object sender, PacketReceivedEventArgs e)
        {
            //_packetLogger.Log<EChatPacket>(e.Packet);

            switch (e.Packet.PacketID)
            {
                case (byte)EChatPacket.CKeepAliveAck:
                    break;

                case (byte)EChatPacket.CLoginReq:
                    HandleLoginRequest(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CMessageReq:
                    HandleChatMessage(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CWhisperReq:
                    HandleWhisper(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CChannelListReq:
                    HandleChannelListRequest(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CChannelEnterReq:
                    HandleChannelEnter(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CChannelLeaveReq:
                    HandleChannelLeave(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CFriendListReq:
                    HandleFriendListRequest(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CCombiListReq:
                    HandleCombiListRequest(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CDenyListReq:
                    HandleDenyListRequest(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CGetDataReq:
                    HandleGetData(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CSetDataReq:
                    HandleSetDataRequest(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CSetStateReq:
                    //_logger.Debug("-C_SET_STATE_REQ-");
                    break;

                case (byte)EChatPacket.CAddDenyReq:
                    HandleAddDeny(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CRemoveDenyReq:
                    HandleRemoveDeny(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CAddFriendReq:
                    HandleAddFriend(e.Session, e.Packet);
                    break;

                case (byte)EChatPacket.CBRSFriendNotifyReq:
                    HandleBRSFriendNotify(e.Session, e.Packet);
                    break;

                default:
                    _logger.Warning("Unkown packet {0}", e.Packet.PacketID.ToString("x2"));
                    break;
            }
        }
Пример #5
0
        private void HandlePacket(object sender, PacketReceivedEventArgs e)
        {
            e.Packet.Decrypt();
            e.Packet.ReadBytes(4); // packet counter
            //_packetLogger.Log<EGamePacket>(e.Packet);

            if (_pluginManager.OnPacket(e.Session, e.Packet))
                return;

            switch (e.Packet.PacketID)
            {
                case (byte)EGamePacket.CLoginReq:
                    HandleLoginRequest(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CCreateCharacterReq:
                    HandleCreateCharacter(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CSelectCharacterReq:
                    HandleSelectCharacter(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CDeleteCharacterReq:
                    HandleDeleteCharacter(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CTimeSyncReq:
                    HandleTimeSync(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CKeepAliveReq:
                    break;

                case (byte)EGamePacket.CChannelInfoReq:
                    HandleChannelInformation(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CChannelEnterReq:
                    HandleChannelEnter(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CChannelLeaveReq:
                    HandleChannelLeave(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CGetPlayerInfoReq:
                    HandleGetPlayerInfo(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CNATInfoReq:
                    HandleNATInfo(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CBuyItemReq:
                    HandleBuyItem(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRefundItemReq:
                    HandleRefundItem(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRepairItemReq:
                    HandleRepairItem(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRefreshItemsReq:
                    HandleRefreshItems(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRefreshEQItemsReq:
                    HandleRefreshEQItems(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CClearInvalidateItemsReq:
                    HandleClearInvalidateItems(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CUseItemReq:
                    HandleUseItem(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRegisterLicenseReq:
                    HandleRegisterLicense(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CCreateRoomReq:
                    HandleCreateRoom(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CJoinTunnelReq:
                    HandleJoinTunnel(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.SCRoomPlayerEnter:
                    HandlePlayerEntered(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CEnterRoomReq:
                    HandleEnterRoom(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CBeginRoundReq:
                    HandleBeginRound(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRoomLeaveReq:
                    HandleLeaveRoom(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CEventMessageReq:
                    HandleEventMessage(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRoomReadyReq:
                    HandleReadyRound(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CAdminShowWindowReq:
                    HandleAdminShowWindow(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CAdminActionReq:
                    HandleAdminAction(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CScoreKillReq:
                    HandleScoreKill(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.SScoreKillAssistReq:
                    HandleScoreKillAssist(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CReboundFumbiReq:
                    HandleReboundFumbi(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.SCTouchdown:
                    HandleTouchdown(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CScoreSuicideReq:
                    HandleSuicide(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CScoreOffenseReq:
                    HandleScoreOffense(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CScoreOffenseAssistReq:
                    HandleScoreOffenseAssist(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CScoreDefenseReq:
                    HandleScoreDefense(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CScoreDefenseAssistReq:
                    HandleScoreDefenseAssist(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CChangeTeamReq:
                    HandleChangeTeam(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRoomKickReq:
                    HandleRoomKick(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRandomshopReq:
                    HandleRandomShop(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CLogoutReq:
                    HandleLogout(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRoomChangeItemsReq:
                    HandleRoomChangeItems(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CAvatarChangeReq:
                    HandleAvatarChange(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CChangeRoomReq:
                    HandleChangeRoom(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRoomPlayerGameModeChangeReq:
                    HandleChangePlayerGameMode(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CTutorialCompletedReq:
                    HandleTutorialCompleted(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CScoreSurvivalReq:
                    HandleScoreSurvival(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CQuickJoinReq:
                    HandleQuickJoin(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.SCRoomMovePlayer:
                    HandleMovePlayer(e.Session, e.Packet);
                    break;

                case (byte)EGamePacket.CRoomShuffleReq:
                    HandleShuffle(e.Session, e.Packet);
                    break;

                default:
                    Logger.Warning("Unkown packet {0}", e.Packet.PacketID.ToString("x2"));
                    break;
            }
        }
Пример #6
0
 private void RaisePacketReceived(PacketReceivedEventArgs e)
 {
     if (PacketReceived != null)
         Task.Factory.FromAsync(PacketReceived.BeginInvoke, PacketReceived.EndInvoke, this, e, null).ContinueWith((t) => { if (t.IsFaulted) RaiseError(new ExceptionEventArgs(t.Exception)); });
         //PacketReceived(this, e);
 }