コード例 #1
0
ファイル: Utilities.cs プロジェクト: wiljafor1/BlazeServer
        public static string GetCommandName(ushort componentId, ushort commandId)
        {
            string result = "";

            switch ((Component)componentId)
            {
            case Component.AUTHENTICATION:
                result = AuthenticationComponent.GetCommandName(commandId);
                break;

            case Component.GAMEMANAGER:
                result = GameManagerComponent.GetCommandName(commandId);
                break;

            case Component.REDIRECTOR:
                result = RedirectorComponent.GetCommandName(commandId);
                break;

            case Component.STATS:
                result = StatsComponent.GetCommandName(commandId);
                break;

            case Component.UTIL:
                result = UtilComponent.GetCommandName(commandId);
                break;

            case Component.CLUBS:
                result = ClubsComponent.GetCommandName(commandId);
                break;

            case Component.RSP:
                result = RSPComponent.GetCommandName(commandId);
                break;

            case Component.USERSESSIONS:
                result = UserSessionsComponent.GetCommandName(commandId);
                break;

            case Component.GAMEREPORTING:
                result = GameReportingComponent.GetCommandName(commandId);
                break;

            default:
                result = string.Format("0x" + commandId.ToString("X4"));
                break;
            }

            return(result);
        }
コード例 #2
0
ファイル: Router.cs プロジェクト: wiljafor1/BlazeServer
        public static void HandleRequest(ulong clientId, Packet packet, SslStream stream)
        {
            Utilities.LogRequest(packet);

            switch (packet.componentId)
            {
            case Component.REDIRECTOR:
                RedirectorComponent.HandleComponent(clientId, packet, stream);
                break;

            case Component.UTIL:
                UtilComponent.HandleComponent(clientId, packet, stream);
                break;

            case Component.AUTHENTICATION:
                AuthenticationComponent.HandleComponent(clientId, packet, stream);
                break;

            case Component.USERSESSIONS:
                UserSessionsComponent.HandleComponent(clientId, packet, stream);
                break;

            case Component.GAMEMANAGER:
                GameManagerComponent.HandleComponent(clientId, packet, stream);
                break;

            case Component.RSP:
                RSPComponent.HandleComponent(clientId, packet, stream);
                break;

            case Component.GAMEREPORTING:
                GameReportingComponent.HandleComponent(clientId, packet, stream);
                break;

            case Component.CLUBS:
                ClubsComponent.HandleComponent(clientId, packet, stream);
                break;

            case Component.STATS:
                StatsComponent.HandleComponent(clientId, packet, stream);
                break;

            default:
                Utilities.LogUnhandledRequest(packet);
                //SendError(packet, stream);
                break;
            }
        }