Esempio n. 1
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddString(ref m_SerializeBuffer, p, TextMessage);
     BitPacker.AddPropertyBag(ref m_SerializeBuffer, p, Parms);
     return(m_SerializeBuffer);
 }
Esempio 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);
        }
Esempio n. 3
0
 public override void Serialize(ref byte[] buffer, Pointer p)
 {
     base.Serialize(ref buffer, p);
     BitPacker.AddInt(ref buffer, p, PhaseID);
     BitPacker.AddString(ref buffer, p, PhaseName);
     BitPacker.AddLong(ref buffer, p, ResponseTime);
 }
        public override byte[] Serialize(Pointer p)
        {
            base.Serialize(p);
            BitPacker.AddString(ref m_SerializeBuffer, p, TargetServerName);
            BitPacker.AddString(ref m_SerializeBuffer, p, TargetResource.ToString());

            return(m_SerializeBuffer);
        }
Esempio n. 5
0
 public void Serialize(ref byte[] buffer, Pointer p)
 {
     BitPacker.AddString(ref buffer, p, CommandName);
     BitPacker.AddString(ref buffer, p, CommandGroup);
     BitPacker.AddString(ref buffer, p, UsageHelp);
     BitPacker.AddStringList(ref buffer, p, new List <string>(AllowedRoles));
     BitPacker.AddStringList(ref buffer, p, new List <string>(ParmNames));
 }
Esempio n. 6
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.AddLong(ref dat, p, m_Value[i].Ticks);
     }
 }
Esempio n. 7
0
 public override void SerializeValue(ref byte[] dat, Pointer p)
 {
     if (m_Value == null)
     {
         return;
     }
     BitPacker.AddString(ref dat, p, Name);
     BitPacker.AddComponent(ref dat, p, m_Value);
 }
Esempio n. 8
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     byte[] serverName = System.Text.Encoding.UTF8.GetBytes(ServerName);
     BitPacker.AddString(ref m_SerializeBuffer, p, ServerName);
     BitPacker.AddInt(ref m_SerializeBuffer, p, MaxPlayers);
     BitPacker.AddInt(ref m_SerializeBuffer, p, CurrentPlayers);
     BitPacker.AddString(ref m_SerializeBuffer, p, UserID);
     return(m_SerializeBuffer);
 }
Esempio n. 9
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);
 }
Esempio n. 10
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddString(ref m_SerializeBuffer, p, OriginServer);
     BitPacker.AddString(ref m_SerializeBuffer, p, TargetServer);
     BitPacker.AddString(ref m_SerializeBuffer, p, To.ToString());
     BitPacker.AddSerializableWispObject(ref m_SerializeBuffer, p, From);
     BitPacker.AddBytes(ref m_SerializeBuffer, p, Message);
     return(m_SerializeBuffer);
 }
Esempio n. 11
0
 public void Serialize(ref byte[] buffer, Pointer p)
 {
     BitPacker.AddInt(ref buffer, p, Configs.Count);
     Dictionary <string, string> .Enumerator enu = Configs.GetEnumerator();
     while (enu.MoveNext())
     {
         BitPacker.AddString(ref buffer, p, enu.Current.Key);
         BitPacker.AddString(ref buffer, p, enu.Current.Value);
     }
 }
Esempio n. 12
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);
 }
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddString(ref m_SerializeBuffer, p, m_ServerVersion.ToString());
     BitPacker.AddBytes(ref m_SerializeBuffer, p, m_PublicRSAKey);
     BitPacker.AddInt(ref m_SerializeBuffer, p, m_ConnectionKeySize);
     BitPacker.AddString(ref m_SerializeBuffer, p, ServerName);
     BitPacker.AddInt(ref m_SerializeBuffer, p, MaxPlayers);
     BitPacker.AddInt(ref m_SerializeBuffer, p, CurrentPlayers);
     return(m_SerializeBuffer);
 }
Esempio n. 14
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);
 }
        public override byte[] Serialize(Pointer p)
        {
            base.Serialize(p);
            BitPacker.AddSerializableWispObject(ref m_SerializeBuffer, p, Profile);
            BitPacker.AddString(ref m_SerializeBuffer, p, TargetResource.ToString());
            BitPacker.AddString(ref m_SerializeBuffer, p, Player.ToString());
            BitPacker.AddString(ref m_SerializeBuffer, p, AuthTicket.ToString());
            BitPacker.AddString(ref m_SerializeBuffer, p, AccountName);

            return(m_SerializeBuffer);
        }
Esempio n. 16
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);
 }
Esempio n. 17
0
        public override void Serialize(ref byte[] buffer, Pointer p, bool includeComponents)
        {
            m_CharacterInfo.Serialize(ref buffer, p, includeComponents);

            BitPacker.AddString(ref buffer, p, OwningAccount.OwningServer);
            BitPacker.AddString(ref buffer, p, OwningAccount.ID.ToString());
            BitPacker.AddString(ref buffer, p, OwningAccount.AccountName);
            BitPacker.AddSerializableWispObject(ref buffer, p, OwningAccount.Profile);

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

            base.Serialize(ref buffer, p, includeComponents);
        }
Esempio n. 18
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);
     }
 }
Esempio n. 19
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);
            }
        }
 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);
 }
Esempio n. 21
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);
            }
        }
Esempio n. 22
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);
        }
Esempio n. 23
0
        public virtual void Serialize(ref byte[] buffer, Pointer p)
        {
#if !IS_CLIENT
            BitPacker.AddString(ref buffer, p, CurrentSessionID.ToString());
            BitPacker.AddString(ref buffer, p, Username);
#endif
            BitPacker.AddInt(ref buffer, p, MaxCharacters);

            // Add roles
            BitPacker.AddInt(ref buffer, p, UserRoles.Length);
            for (int i = 0; i < UserRoles.Length; i++)
            {
                BitPacker.AddString(ref buffer, p, UserRoles[i]);
            }

#if !IS_CLIENT
            // Login IPs
            BitPacker.AddInt(ref buffer, p, LoginHistoryIP.Count);
            for (int i = 0; i < LoginHistoryIP.Count; i++)
            {
                BitPacker.AddString(ref buffer, p, LoginHistoryIP.ElementAt(i));
            }

            // Login Times
            BitPacker.AddInt(ref buffer, p, LoginHistoryTime.Count);
            for (int i = 0; i < LoginHistoryTime.Count; i++)
            {
                BitPacker.AddLong(ref buffer, p, LoginHistoryTime.ElementAt(i).Ticks);
            }

            // Logout Times
            BitPacker.AddInt(ref buffer, p, LogoffHistoryTime.Count);
            for (int i = 0; i < LogoffHistoryTime.Count; i++)
            {
                BitPacker.AddLong(ref buffer, p, LogoffHistoryTime.ElementAt(i).Ticks);
            }

            BitPacker.AddString(ref buffer, p, m_CurrentSessionID.ToString());
            BitPacker.AddLong(ref buffer, p, m_CurrentLoginTime.Ticks);
            BitPacker.AddString(ref buffer, p, m_CurrentIP);
#endif
        }
Esempio n. 24
0
        public override void Serialize(ref byte[] buffer, Pointer p, bool includeSubComponents)
        {
            // General match info
            BitPacker.AddInt(ref buffer, p, Owner);
            BitPacker.AddString(ref buffer, p, GameID.ToString());
            BitPacker.AddPropertyBag(ref buffer, p, Properties);

            // Players
            List <ICharacterInfo> players = AllPlayers;

            BitPacker.AddInt(ref buffer, p, players.Count);
            for (int i = 0; i < players.Count; i++)
            {
                ICharacterInfo ci = players[i];
                BitPacker.AddPropertyBag(ref buffer, p, ci.Properties);
                BitPacker.AddStatBag(ref buffer, p, ci.Stats);
                BitPacker.AddInt(ref buffer, p, ci.ID);
            }

            base.Serialize(ref buffer, p, includeSubComponents);
        }
Esempio n. 25
0
 public override void SerializeValue(ref byte[] dat, Pointer p)
 {
     BitPacker.AddString(ref dat, p, Name);
     BitPacker.AddSerializableWispObject(ref dat, p, m_Value);
 }
Esempio n. 26
0
 public override void SerializeValue(ref byte[] dat, Pointer p)
 {
     BitPacker.AddString(ref dat, p, Name);
     BitPacker.AddLong(ref dat, p, m_Value.Ticks);
 }
Esempio n. 27
0
 public override byte[] Serialize(Pointer p)
 {
     base.Serialize(p);
     BitPacker.AddString(ref m_SerializeBuffer, p, Message);
     return(m_SerializeBuffer);
 }