Esempio n. 1
0
        public PeerData Peer = new PeerData();         // 端



        public void Deserialize(tabtoy.DataReader reader)
        {
            // 服务器IP
            if (reader.MatchTag(0x60000))
            {
                this.ServerIP = reader.ReadString( );
            }

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

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

            // 端
            if (reader.MatchTag(0x90003))
            {
                this.Peer = reader.ReadStruct <PeerData>( );
            }
        }
Esempio n. 2
0
        public static void Deserialize(PeerData ins, tabtoy.DataReader reader)
        {
            if (reader.MatchTag(0x60000))
            {
                ins.Name = reader.ReadString();
            }


            if (reader.MatchTag(0x60001))
            {
                ins.Type = reader.ReadString();
            }
        }
Esempio n. 3
0
        public static void Deserialize(PeerData ins, tabtoy.DataReader reader)
        {
            int tag = -1;

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

                case 0x60001:
                {
                    ins.Type = reader.ReadString();
                }
                break;
                }
            }
        }