Exemplo n.º 1
0
		private ClientInformation(PacketIn packet)
		{
			packet.SkipBytes(1);	// 0

			try
			{
				Version = new ClientVersion(packet.ReadBytes(5));
				Architecture = packet.ReadReversedString();
				OS = packet.ReadReversedString();

				var localeStr = packet.ReadReversedPascalString(4);
				if (!ClientLocales.Lookup(localeStr, out m_Locale))
				{
					m_Locale = WCellConstants.DefaultLocale;
				}

				TimeZone = BitConverter.ToUInt32(packet.ReadBytes(4), 0);
				IPAddress = new XmlIPAddress(packet.ReadBytes(4));
			}
			catch
			{
			}
		}
Exemplo n.º 2
0
        /// <summary>
        /// Generates a system information objet from the given packet.
        /// </summary>
        /// <param name="inPacket">contains the system information in a raw, serialized format</param>
        public static SystemInformation ReadFromPacket(PacketIn inPacket)
        {
            SystemInformation info = new SystemInformation();
        	inPacket.SkipBytes(1);	// 0

            try
            {
                info.Version = new ClientVersion(inPacket.ReadBytes(5));
                info.Architecture = inPacket.ReadReversedString();
                info.OS = inPacket.ReadReversedString();
                info.Locale = inPacket.ReadReversedPascalString(4);
                info.TimeZone = BitConverter.ToUInt32(inPacket.ReadBytes(4), 0);
                info.IPAddress = new XmlIPAddress(inPacket.ReadBytes(4));
            }
            catch
            {
            }

            return info;
        }