Beispiel #1
0
        public static SubMessage ExtractSubMessage(byte[] Buffer, int StartIndex)
        {
            SubMessage returnValue = null;

            // try to parse the submessage
            switch ((MessageTypeGameMode)Buffer[StartIndex])
            {
                case MessageTypeGameMode.NewCharInfo:
                    returnValue = new SubMessageNewCharInfo(Buffer, StartIndex);
                    break;

                case MessageTypeGameMode.SendCharInfo:
                    returnValue = new SubMessageSendCharInfo(Buffer, StartIndex);
                    break;
             
                default:
                    returnValue = new SubMessageGeneric(Buffer, StartIndex);
                    break;
            }

            return returnValue;
        }
Beispiel #2
0
        public static SubMessage ExtractSubMessage(byte[] Buffer, int StartIndex)
        {
            SubMessage returnValue = null;

            // try to parse the submessage
            switch ((MessageTypeGameMode)Buffer[StartIndex])
            {
            case MessageTypeGameMode.NewCharInfo:
                returnValue = new SubMessageNewCharInfo(Buffer, StartIndex);
                break;

            case MessageTypeGameMode.SendCharInfo:
                returnValue = new SubMessageSendCharInfo(Buffer, StartIndex);
                break;

            default:
                returnValue = new SubMessageGeneric(Buffer, StartIndex);
                break;
            }

            return(returnValue);
        }