예제 #1
0
        public static void Deserialize(VerticalDefine ins, tabtoy.DataReader reader)
        {
            // 服务器IP
            if (reader.MatchTag(0x60000))
            {
                ins.ServerIP = reader.ReadString();
            }

            // 调试模式
            if (reader.MatchTag(0x70001))
            {
                ins.DebugMode = reader.ReadBool();
            }

            // 客户端人数限制
            if (reader.MatchTag(0x10002))
            {
                ins.ClientLimit = reader.ReadInt32();
            }

            // 端
            if (reader.MatchTag(0x90003))
            {
                ins.Peer = reader.ReadStruct <PeerData>(PeerDataDeserializeHandler);
            }


            if (reader.MatchTag(0x50004))
            {
                ins.Float = reader.ReadFloat();
            }
        }
예제 #2
0
파일: Config.cs 프로젝트: zsjinit/tabtoy
        public static void Deserialize(VerticalDefine ins, tabtoy.DataReader reader)
        {
            int tag = -1;

            while (-1 != (tag = reader.ReadTag()))
            {
                switch (tag)
                {
                case 0x60000:
                {
                    ins.ServerIP = reader.ReadString();
                }
                break;

                case 0x70001:
                {
                    ins.DebugMode = reader.ReadBool();
                }
                break;

                case 0x10002:
                {
                    ins.ClientLimit = reader.ReadInt32();
                }
                break;

                case 0x90003:
                {
                    ins.Peer = reader.ReadStruct <PeerData>(PeerDataDeserializeHandler);
                }
                break;

                case 0x50004:
                {
                    ins.Float = reader.ReadFloat();
                }
                break;

                case 0x10005:
                {
                    ins.Token.Add(reader.ReadInt32());
                }
                break;
                }
            }
        }