Exemplo n.º 1
0
        public override byte[] Serialize(Pointer p)
        {
            base.Serialize(p);
            BitPacker.AddBool(ref m_SerializeBuffer, p, IsRefresh);
            BitPacker.AddBool(ref m_SerializeBuffer, p, IsServerPacket);
            BitPacker.AddInt(ref m_SerializeBuffer, p, TheGames.Count);
            for (int i = 0; i < TheGames.Count; i++)
            {
                if (!IsRefresh)
                {
                    BitPacker.AddInt(ref m_SerializeBuffer, p, (int)Kinds[i]);
                }

                // determine if this packet goes to another server, in which case we need to send the full game data,
                // or to the client in which case we need to just send a matchInfo object
                BitPacker.AddComponent(ref m_SerializeBuffer, p, TheGames[i], IsServerPacket);

                BitPacker.AddBool(ref m_SerializeBuffer, p, TargetPlayers.Count > i);
                if (!IsRefresh && TargetPlayers[i] != null)
                {
                    BitPacker.AddComponent(ref m_SerializeBuffer, p, TargetPlayers[i], false);
                }
            }

            return(m_SerializeBuffer);
        }
Exemplo n.º 2
0
        public override byte[] Serialize(Pointer p)
        {
            base.Serialize(p);
            BitPacker.AddInt(ref m_SerializeBuffer, p, (int)Kind);

            if (TheGame == null)
            {
                BitPacker.AddBool(ref m_SerializeBuffer, p, false); // do not have game data
            }
            else
            {
                BitPacker.AddBool(ref m_SerializeBuffer, p, true); // have game data
                BitPacker.AddComponent(ref m_SerializeBuffer, p, TheGame, false);
            }

            BitPacker.AddBool(ref m_SerializeBuffer, p, TargetPlayer != null);
            if (TargetPlayer != null)
            {
                BitPacker.AddComponent(ref m_SerializeBuffer, p, TargetPlayer, false);
            }

            BitPacker.AddString(ref m_SerializeBuffer, p, TheGameID.ToString());

            return(m_SerializeBuffer);
        }
Exemplo n.º 3
0
 public override void SerializeValue(ref byte[] dat, Pointer p)
 {
     BitPacker.AddInt(ref dat, p, m_Value.Length);
     for (int i = 0; i < m_Value.Length; i++)
     {
         BitPacker.AddString(ref dat, p, Name);
         BitPacker.AddBool(ref dat, p, m_Value[i]);
     }
 }
Exemplo n.º 4
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddInt(ref m_SerializeBuffer, p, (int)LoginConnectionType);
     BitPacker.AddString(ref m_SerializeBuffer, p, AccountName);
     BitPacker.AddString(ref m_SerializeBuffer, p, Password);
     BitPacker.AddBool(ref m_SerializeBuffer, p, IsNewAccount);
     BitPacker.AddPropertyBag(ref m_SerializeBuffer, p, Parms);
     return(m_SerializeBuffer);
 }
Exemplo n.º 5
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddString(ref m_SerializeBuffer, p, AuthTicket.ToString());
     BitPacker.AddString(ref m_SerializeBuffer, p, ServerName);
     BitPacker.AddString(ref m_SerializeBuffer, p, ServerIP);
     BitPacker.AddInt(ref m_SerializeBuffer, p, ServerPort);
     BitPacker.AddString(ref m_SerializeBuffer, p, TargetResource.ToString());
     BitPacker.AddBool(ref m_SerializeBuffer, p, IsAssistedTransfer);
     return(m_SerializeBuffer);
 }
Exemplo n.º 6
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddString(ref m_SerializeBuffer, p, Description);
     BitPacker.AddLong(ref m_SerializeBuffer, p, TotalLength);
     BitPacker.AddBool(ref m_SerializeBuffer, p, Final);
     BitPacker.AddBool(ref m_SerializeBuffer, p, Initial);
     BitPacker.AddString(ref m_SerializeBuffer, p, Arg);
     BitPacker.AddBytes(ref m_SerializeBuffer, p, Buffer);
     return(m_SerializeBuffer);
 }
Exemplo n.º 7
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddBool(ref m_SerializeBuffer, p, Remove);
     BitPacker.AddString(ref m_SerializeBuffer, p, PropertyBagId.ToString());
     BitPacker.AddInt(ref m_SerializeBuffer, p, Properties.Length);
     for (int i = 0; i < Properties.Length; i++)
     {
         BitPacker.AddProperty(ref m_SerializeBuffer, p, Properties[i]);
     }
     return(m_SerializeBuffer);
 }
Exemplo n.º 8
0
        public override byte[] Serialize(Pointer p)
        {
            base.Serialize(p);

            BitPacker.AddBool(ref m_SerializeBuffer, p, TheGame != null);
            if (TheGame != null)
            {
                BitPacker.AddComponent(ref m_SerializeBuffer, p, TheGame, false);
            }
            BitPacker.AddBool(ref m_SerializeBuffer, p, StillLooking);

            return(m_SerializeBuffer);
        }
Exemplo n.º 9
0
 public void Serialize(ref byte[] buffer, Pointer p)
 {
     BitPacker.AddBool(ref buffer, p, IsEnabled);
     BitPacker.AddLong(ref buffer, p, SampleInterval.Ticks);
     BitPacker.AddString(ref buffer, p, Category);
     BitPacker.AddString(ref buffer, p, CounterName);
     BitPacker.AddString(ref buffer, p, InstanceName);
     BitPacker.AddString(ref buffer, p, HelpText);
     BitPacker.AddInt(ref buffer, p, History.Count);
     for (int i = 0; i < History.Count; i++)
     {
         BitPacker.AddSingle(ref buffer, p, History[i].Value);
         BitPacker.AddLong(ref buffer, p, History[i].Timestamp.Ticks);
     }
 }
Exemplo n.º 10
0
        public void Serialize(ref byte[] buffer, Pointer p)
        {
            BitPacker.AddLong(ref buffer, p, LastLogin.Ticks);
            BitPacker.AddLong(ref buffer, p, UserSince.Ticks);
            BitPacker.AddLong(ref buffer, p, LastPasswordChange.Ticks);

            BitPacker.AddString(ref buffer, p, ID.ToString());

            BitPacker.AddString(ref buffer, p, Email);
            BitPacker.AddString(ref buffer, p, Username);

            BitPacker.AddBool(ref buffer, p, IsLocked);
            BitPacker.AddBool(ref buffer, p, IsOnline);
            BitPacker.AddBool(ref buffer, p, IsApproved);

            BitPacker.AddStringList(ref buffer, p, Roles);

            BitPacker.AddInt(ref buffer, p, ServiceNotes.Count);
            for (int i = 0; i < ServiceNotes.Count; i++)
            {
                ServiceLogEntry sle = ServiceNotes[i];
                BitPacker.AddString(ref buffer, p, sle.EntryBy);
                BitPacker.AddString(ref buffer, p, sle.Note);
                BitPacker.AddString(ref buffer, p, sle.EntryType);
                BitPacker.AddInt(ref buffer, p, sle.CharacterId);
                BitPacker.AddLong(ref buffer, p, sle.TimeStampUTC.Ticks);
            }

            BitPacker.AddPropertyBag(ref buffer, p, AddedProperties);

            BitPacker.AddInt(ref buffer, p, LoginSessions.Count);
            for (int i = 0; i < LoginSessions.Count; i++)
            {
                AccountProfile.Session s = LoginSessions[i];
                BitPacker.AddLong(ref buffer, p, s.LoginUTC.Ticks);
                BitPacker.AddLong(ref buffer, p, s.LogoutUTC.Ticks);
                BitPacker.AddString(ref buffer, p, s.IP);
            }

            BitPacker.AddLong(ref buffer, p, CurrentLoginTime.Ticks);

            BitPacker.AddInt(ref buffer, p, Characters.Count);
            for (int i = 0; i < Characters.Count; i++)
            {
                ICharacterInfo ci = Characters[i];
                BitPacker.AddComponent(ref buffer, p, ci);
            }
        }
Exemplo n.º 11
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddString(ref m_SerializeBuffer, p, Player.ToString());
     BitPacker.AddString(ref m_SerializeBuffer, p, SharedSecret.ToString());
     BitPacker.AddString(ref m_SerializeBuffer, p, AccountName);
     BitPacker.AddString(ref m_SerializeBuffer, p, TargetResource.ToString());
     BitPacker.AddSerializableWispObject(ref m_SerializeBuffer, p, Profile);
     BitPacker.AddBool(ref m_SerializeBuffer, p, Character != null);
     if (Character != null)
     {
         BitPacker.AddComponent(ref m_SerializeBuffer, p, Character);
     }
     BitPacker.AddString(ref m_SerializeBuffer, p, OwningServer);
     return(m_SerializeBuffer);
 }
Exemplo n.º 12
0
        public void Serialize(ref byte[] buffer, Pointer p)
        {
            BitPacker.AddBool(ref buffer, p, AllowRemoteConnections);
            BitPacker.AddInt(ref buffer, p, TotalUserCount);
            BitPacker.AddString(ref buffer, p, UserDataStore);
            BitPacker.AddInt(ref buffer, p, Users.Count);

            foreach (User su in Users)
            {
                BitPacker.AddString(ref buffer, p, su.Username);
                BitPacker.AddStringList(ref buffer, p, new List <string>(su.Roles));
                BitPacker.AddBool(ref buffer, p, su.IsLocked);
                BitPacker.AddString(ref buffer, p, su.ID.ToString());
                BitPacker.AddString(ref buffer, p, su.Email);
                BitPacker.AddLong(ref buffer, p, su.LastLogin.Ticks);
            }
        }
Exemplo n.º 13
0
        public override byte[] Serialize(Pointer p)
        {
            base.Serialize(p);

            BitPacker.AddInt(ref m_SerializeBuffer, p, (int)ReplyCode);
            BitPacker.AddInt(ref m_SerializeBuffer, p, ReplyPacketID);
            BitPacker.AddString(ref m_SerializeBuffer, p, ReplyMessage);
            BitPacker.AddInt(ref m_SerializeBuffer, p, ReplyPacketType);
            BitPacker.AddInt(ref m_SerializeBuffer, p, ReplyPacketSubType);

            bool hasParms = Parms.PropertyCount > 0;

            BitPacker.AddBool(ref m_SerializeBuffer, p, hasParms);
            if (hasParms)
            {
                BitPacker.AddPropertyBag(ref m_SerializeBuffer, p, Parms);
            }
            return(m_SerializeBuffer);
        }
Exemplo n.º 14
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddBool(ref m_SerializeBuffer, p, true);
     return(m_SerializeBuffer);
 }
Exemplo n.º 15
0
 public override void SerializeValue(ref byte[] dat, Pointer p)
 {
     BitPacker.AddString(ref dat, p, Name);
     BitPacker.AddBool(ref dat, p, m_Value);
 }