Beispiel #1
0
        override public void FromBytes(BinaryReader br)
        {
            base.FromBytes(br);

            int faceCount           = DecodeInteger(br);
            int roomCount           = DecodeInteger(br);
            int partnerCount        = DecodeInteger(br);
            int evalHistoryCount    = DecodeInteger(br);
            int chatHistoryCount    = DecodeInteger(br);
            int chargeHistoryCount  = DecodeInteger(br);
            int gameHistoryCount    = DecodeInteger(br);
            int presentHistoryCount = DecodeInteger(br);



            for (int i = 0; i < faceCount; i++)
            {
                IconInfo faceInfo = (IconInfo)BaseInfo.CreateInstance(br);
                Faces.Add(faceInfo);
            }

            for (int i = 0; i < roomCount; i++)
            {
                RoomInfo roomInfo = (RoomInfo)BaseInfo.CreateInstance(br);
                Rooms.Add(roomInfo);
            }

            for (int i = 0; i < partnerCount; i++)
            {
                UserInfo partnerInfo = (UserInfo)BaseInfo.CreateInstance(br);
                Partners.Add(partnerInfo);
            }

            for (int i = 0; i < evalHistoryCount; i++)
            {
                EvalHistoryInfo evalHistoryInfo = (EvalHistoryInfo)BaseInfo.CreateInstance(br);
                EvalHistories.Add(evalHistoryInfo);
            }

            for (int i = 0; i < chatHistoryCount; i++)
            {
                ChatHistoryInfo chatHistoryInfo = (ChatHistoryInfo)BaseInfo.CreateInstance(br);
                ChatHistories.Add(chatHistoryInfo);
            }

            for (int i = 0; i < chargeHistoryCount; i++)
            {
                ChargeHistoryInfo chargeHistoryInfo = (ChargeHistoryInfo)BaseInfo.CreateInstance(br);
                ChargeHistories.Add(chargeHistoryInfo);
            }

            for (int i = 0; i < gameHistoryCount; i++)
            {
                GameHistoryInfo gameHistoryInfo = (GameHistoryInfo)BaseInfo.CreateInstance(br);
                GameHistories.Add(gameHistoryInfo);
            }

            for (int i = 0; i < presentHistoryCount; i++)
            {
                PresentHistoryInfo presentHistoryInfo = (PresentHistoryInfo)BaseInfo.CreateInstance(br);
                PresentHistories.Add(presentHistoryInfo);
            }



            _strDownUrl = DecodeString(br);
        }
Beispiel #2
0
        public static BaseInfo CreateInstance(BinaryReader br)
        {
            BaseInfo baseInfo = null;

            InfoType infoType = (InfoType)DecodeInteger(br);

            switch (infoType)
            {
            case InfoType.Result:
                baseInfo = new ResultInfo();
                break;

            case InfoType.Header:
                baseInfo = new HeaderInfo();
                break;

            case InfoType.Home:
                baseInfo = new HomeInfo();
                break;

            case InfoType.User:
                baseInfo = new UserInfo();
                break;

            case InfoType.UserDetail:
                baseInfo = new UserDetailInfo();
                break;

            case InfoType.Room:
                baseInfo = new RoomInfo();
                break;

            case InfoType.RoomList:
                baseInfo = new RoomListInfo();
                break;

            case InfoType.RoomDetail:
                baseInfo = new RoomDetailInfo();
                break;

            case InfoType.String:
                baseInfo = new StringInfo();
                break;

            case InfoType.Voice:
                baseInfo = new VoiceInfo();
                break;

            case InfoType.Video:
                baseInfo = new VideoInfo();
                break;

            case InfoType.Present:
                baseInfo = new IconInfo();
                break;

            case InfoType.Give:
                baseInfo = new GiveInfo();
                break;

            case InfoType.Game:
                baseInfo = new GameInfo();
                break;

            case InfoType.GameList:
                baseInfo = new GameListInfo();
                break;

            case InfoType.GameDetail:
                baseInfo = new GameDetailInfo();
                break;

            case InfoType.ChatHistory:
                baseInfo = new ChatHistoryInfo();
                break;

            case InfoType.PointHistory:
                baseInfo = new PointHistoryInfo();
                break;

            case InfoType.ChargeHistory:
                baseInfo = new ChargeHistoryInfo();
                break;

            case InfoType.EvalHistory:
                baseInfo = new EvalHistoryInfo();
                break;

            case InfoType.PresentHistory:
                baseInfo = new PresentHistoryInfo();
                break;

            case InfoType.GameHistory:
                baseInfo = new GameHistoryInfo();
                break;

            case InfoType.UserList:
                baseInfo = new UserListInfo();
                break;

            case InfoType.AskChat:
                baseInfo = new AskChatInfo();
                break;

            case InfoType.Board:
                baseInfo = new BoardInfo();
                break;

            case InfoType.Betting:
                baseInfo = new BettingInfo();
                break;

            case InfoType.Table:
                baseInfo = new TableInfo();
                break;

            case InfoType.Sicbo:
                baseInfo = new SicboInfo();
                break;

            case InfoType.Dice:
                baseInfo = new DiceInfo();
                break;

            case InfoType.DzCard:
                baseInfo = new DzCardInfo();
                break;

            case InfoType.Horse:
                baseInfo = new HorseInfo();
                break;

            case InfoType.BumperCar:
                baseInfo = new BumperCarInfo();
                break;

            case InfoType.Fish:
                baseInfo = new FishInfo();
                break;

            case InfoType.FishSend:
                baseInfo = new FishSendInfo();
                break;

            case InfoType.AddScore:
                baseInfo = new AddScoreInfo();
                break;

            case InfoType.SendCard:
                baseInfo = new SendCardInfo();
                break;

            case InfoType.Musice:
                baseInfo = new MusiceInfo();
                break;

            case InfoType.MusiceState:
                baseInfo = new MusiceStateInfo();
                break;

            case InfoType.ClassInfo:
                baseInfo = new ClassInfo();
                break;

            case InfoType.ClassList:
                baseInfo = new ClassListInfo();
                break;

            case InfoType.ClassTypeInfo:
                baseInfo = new ClassTypeInfo();
                break;

            case InfoType.ClassTypeList:
                baseInfo = new ClassTypeListInfo();
                break;

            case InfoType.ClassPictureDetail:
                baseInfo = new ClassPictureDetailInfo();
                break;

            case InfoType.RoomValue:
                baseInfo = new RoomPrice();
                break;

            case InfoType.Payment:
                baseInfo = new PaymentInfo();
                break;

            case InfoType.DWGameFile:
                baseInfo = new DWGameFileInfo();
                break;

            case InfoType.UserState:
                baseInfo = new UserState();
                break;

            case InfoType.Server:
                baseInfo = new ServerInfo();
                break;

            case InfoType.AVMsg:
                baseInfo = new AVMsg();
                break;
            }

            if (baseInfo != null)
            {
                baseInfo.FromBytes(br);
            }

            return(baseInfo);
        }