コード例 #1
0
ファイル: Gump.cs プロジェクト: cbnolok/SphereSvrSource
		public Gump( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			uint serial = reader.ReadUInt32();
			uint gumpId = reader.ReadUInt32();
			uint x = reader.ReadUInt32();
			uint y = reader.ReadUInt32();

			ushort layoutLength = reader.ReadUInt16();
			string layout = reader.ReadASCIIString( layoutLength - 1 );
			reader.ReadByte();

			ArrayList textList = new ArrayList();
			ushort n = reader.ReadUInt16();
			for ( int i = 0; i < n; i++ )
			{
				int length = reader.ReadUInt16() * 2;

				string s = reader.ReadUnicodeString( length );
				textList.Add( s );
			}
			string[] text = (string[])textList.ToArray( typeof( string ) );

			Init( serial, gumpId, x, y, layout, text );
		}
コード例 #2
0
ファイル: PlaySound.cs プロジェクト: cbnolok/SphereSvrSource
		public PlaySound( PacketReader reader, bool send ) : base( reader, send )
		{
			m_SoundMode = reader.ReadByte();
			m_SoundId = reader.ReadUInt16();
			m_Unknown = reader.ReadInt16();
			m_Position = new Point3D( reader.ReadInt16(), reader.ReadInt16(), reader.ReadInt16() );
		}
コード例 #3
0
		public ObjectProperties( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Type = reader.ReadUInt16();

			if ( m_Type == 1 )
			{
				m_Serial = reader.ReadUInt32();

				reader.ReadUInt16();

				m_HashCode = reader.ReadUInt32();

				ArrayList list = new ArrayList();
				while ( true )
				{
					uint number = reader.ReadUInt32();
					if ( number == 0 )
						break;

					ushort length = reader.ReadUInt16();
					string arguments = reader.ReadUnicodeStringLE( length );

					list.Add( new Property( number, arguments ) );
				}

				m_Properties = (Property[])list.ToArray( typeof( Property ) );
			}
			else
			{
				m_Properties = new Property[0];
			}
		}
コード例 #4
0
ファイル: PackedGump.cs プロジェクト: cbnolok/SphereSvrSource
		public PackedGump( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			uint serial = reader.ReadUInt32();
			uint gumpId = reader.ReadUInt32();
			uint x = reader.ReadUInt32();
			uint y = reader.ReadUInt32();

			byte[] dLayout = ReadPacked( reader );
			PacketReader layoutReader = new PacketReader( dLayout );
			string layout = layoutReader.ReadASCIIString( dLayout.Length );

			int stringCount = reader.ReadInt32();

			byte[] dText = ReadPacked( reader );
			PacketReader textReader = new PacketReader( dText );

			ArrayList textList = new ArrayList();
			for ( int i = 0; i < stringCount; i++ )
			{
				int length = textReader.ReadUInt16() * 2;

				string s = textReader.ReadUnicodeString( length );
				textList.Add( s );
			}
			string[] text = (string[])textList.ToArray( typeof( string ) );


			Init( serial, gumpId, x, y, layout, text );
		}
コード例 #5
0
        public EncryptionReply(PacketReader reader, bool send) : base(reader, send)
		{
            reader.ReadUInt16();

            m_LenData1 = reader.ReadUInt32();
            m_Data1 = new byte[m_LenData1];
            m_Data1 = reader.ReadBytes(m_LenData1);
        }
コード例 #6
0
        public MacroEquipItem(PacketReader reader, bool send) : base(reader, send)
		{
			reader.ReadUInt16();

            m_ItemCount = reader.ReadByte();
            for (int i = 0; i < (int)(m_ItemCount); i++)
			{
                m_ItemUids.Add(reader.ReadUInt32());
			}
		}
コード例 #7
0
        public MacroUnequipItem(PacketReader reader, bool send) : base(reader, send)
		{
			reader.ReadUInt16();

            m_LayerCount = reader.ReadByte();
            for (int i = 0; i < (int)(m_LayerCount); i++)
			{
                m_LayerIds.Add(reader.ReadByte());
			}
		}
コード例 #8
0
		public MobileAnimation( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Serial = reader.ReadUInt32();
			m_Action = reader.ReadUInt16();
			m_FrameCount = reader.ReadUInt16();
			m_RepeatCount = reader.ReadUInt16();
			m_Forward = !reader.ReadBoolean();
			m_Repeat = reader.ReadBoolean();
			m_Delay = reader.ReadByte();
		}
コード例 #9
0
ファイル: Packet.cs プロジェクト: cbnolok/SphereSvrSource
		public static Packet Create( byte[] data, bool send )
		{
			PacketReader reader = new PacketReader( data );
			byte cmd = reader.ReadByte();

			Type type = m_Table[cmd];
			if ( type != null )
				return (Packet)Activator.CreateInstance( type, new object[] { reader, send } );
			else
				return new Packet( reader, send );
		}
コード例 #10
0
		public ASCIIMessage( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();
			m_ModelId = reader.ReadUInt16();
			m_SpeechType = reader.ReadByte();
			m_Hue = reader.ReadUInt16();
			m_Font = reader.ReadUInt16();
			m_SourceName = reader.ReadASCIIString( 30 );
			m_Text = reader.ReadASCIIString();
		}
コード例 #11
0
		public LocalizedMessage( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();
			m_ModelId = reader.ReadUInt16();
			m_SpeechType = reader.ReadByte();
			m_Hue = reader.ReadUInt16();
			m_Font = reader.ReadUInt16();
			m_Number = reader.ReadUInt32();
			m_SourceName = reader.ReadASCIIString( 30 );
			m_Append = reader.ReadUnicodeStringLE();
		}
コード例 #12
0
		public ContainerContentUpdate( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Serial = reader.ReadUInt32();
			m_ItemId = reader.ReadUInt16();

			reader.ReadByte();

			m_Amount = reader.ReadUInt16();
			m_X = reader.ReadInt16();
			m_Y = reader.ReadInt16();
            m_Grid = reader.ReadByte();
			m_ContSerial = reader.ReadUInt32();
			m_Hue = reader.ReadUInt16();
		}
コード例 #13
0
ファイル: PackedGump.cs プロジェクト: cbnolok/SphereSvrSource
		byte[] ReadPacked( PacketReader reader )
		{
			int packLength = reader.ReadInt32() - 4;
			if ( packLength < 0 )
				return new byte[0];

			int length = reader.ReadInt32();

			byte[] pack = reader.ReadBytes( packLength );
			byte[] buffer = new byte[length];

			ZLib.uncompress( buffer, ref length, pack, packLength );

			return buffer;
		}
コード例 #14
0
		public BookPageDetails( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();

			int pagesCount = reader.ReadUInt16();
			m_Pages = new BookPageInfo[pagesCount];

			for ( int i = 0; i < m_Pages.Length; i++ )
			{
				int index = reader.ReadUInt16();

				int linesCount = reader.ReadInt16();
				if ( linesCount < 0 )
				{
					m_Pages[i] = new BookPageInfo( index, true, new string[0] );
					continue;
				}

				string[] lines = new string[linesCount];

				for ( int j = 0; j < linesCount; j++ )
				{
					ArrayList buffer = new ArrayList();

					while ( true )
					{
						byte b = reader.ReadByte();

						if ( b != 0 )
						{
							buffer.Add( b );
						}
						else
						{
							byte[] bytes = (byte[])buffer.ToArray( typeof( byte ) );
							lines[j] = Encoding.UTF8.GetString( bytes );

							break;
						}
					}
				}

				m_Pages[i] = new BookPageInfo( index, false, lines );
			}
		}
コード例 #15
0
		public GraphicalEffect( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Type = reader.ReadByte();
			m_From = reader.ReadUInt32();
			m_To = reader.ReadUInt32();
			m_ItemId = reader.ReadUInt16();
			m_FromPoint = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_ToPoint = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_Speed = reader.ReadByte();
			m_Duration = reader.ReadByte();

			reader.ReadByte();
			reader.ReadByte();

			m_FixedDirection = reader.ReadBoolean();
			m_Explode = reader.ReadBoolean();
		}
コード例 #16
0
        public EncryptionSet(PacketReader reader, bool send) : base(reader, send)
		{
            reader.ReadUInt16();

            m_LenData1 = reader.ReadUInt32();
            m_Data1 = new byte[m_LenData1];
            m_Data1 = reader.ReadBytes(m_LenData1);
            m_LenData2 = reader.ReadUInt32();
            m_Data2 = new byte[m_LenData2];
            m_Data2 = reader.ReadBytes(m_LenData2);
            m_LenData3 = reader.ReadUInt32();
            m_Data3 = new byte[m_LenData3];
            m_Data3 = reader.ReadBytes(m_LenData3);
            m_Unknown = reader.ReadUInt32();
            m_LenDataIV = reader.ReadUInt32();
            m_DataIV = new byte[m_LenDataIV];
            m_DataIV = reader.ReadBytes(m_LenDataIV);
		}
コード例 #17
0
ファイル: WorldItem.cs プロジェクト: cbnolok/SphereSvrSource
		public WorldItem( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();
			m_ItemId = reader.ReadUInt16();

			if ( (m_Serial & 0x80000000) != 0 )
			{
				m_Serial &= ~0x80000000;
				m_Count = reader.ReadUInt16();
			}
			else
				m_Count = 0;

			if ( (m_ItemId & 0x8000) != 0 )
			{
				m_ItemId &= 0x7FFF;
				m_ItemId += reader.ReadByte();
			}

			ushort x = reader.ReadUInt16();
			ushort y = reader.ReadUInt16();

			if ( (x & 0x8000) != 0 )
				m_Direction = reader.ReadByte();
			else
				m_Direction = 0;

			sbyte z = reader.ReadSByte();

			if ( (y & 0x8000) != 0 )
				m_Hue = reader.ReadUInt16();
			else
				m_Hue = 0;

			if ( (y & 0x4000) != 0 )
				m_Flag = reader.ReadByte();
			else
				m_Flag = 0;

			m_Position = new Point3D( x & ~0x8000, y & ~0xC000, z );
		}
コード例 #18
0
		public CorpseEquip( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();

			ArrayList list = new ArrayList();
			while ( true )
			{
				byte layer = reader.ReadByte();
				if ( layer == 0 )
					break;

				uint serial = reader.ReadUInt32();

				list.Add( new CorpseItem( (byte)(layer - 1), serial ) );
			}

			m_CorpseItems = (CorpseItem[])list.ToArray( typeof( CorpseItem ) );
		}
コード例 #19
0
ファイル: BookHeader.cs プロジェクト: cbnolok/SphereSvrSource
		public BookHeader( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();

			reader.ReadByte();

			m_Writable = reader.ReadBoolean();
			m_PagesCount = reader.ReadUInt16();

			int titleLength = reader.ReadUInt16() - 1;
			byte[] titleBuffer = reader.ReadBytes( titleLength );
			m_Title = Encoding.UTF8.GetString( titleBuffer );
			reader.ReadByte();

			int authorLength = reader.ReadUInt16() - 1;
			byte[] authorBuffer = reader.ReadBytes( authorLength );
			m_Author = Encoding.UTF8.GetString( authorBuffer );
			reader.ReadByte();
		}
コード例 #20
0
ファイル: PlayMusic.cs プロジェクト: cbnolok/SphereSvrSource
		public PlayMusic( PacketReader reader, bool send ) : base( reader, send )
		{
			m_MusicId = reader.ReadUInt16();
		}
コード例 #21
0
		public ContainerDisplay( PacketReader reader, bool send ) : base( reader, send )
		{
			m_ItemId = reader.ReadUInt32();
			m_Gump = reader.ReadUInt16();
		}
コード例 #22
0
		public ParticleEffect( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Type = reader.ReadByte();
			m_From = reader.ReadUInt32();
			m_To = reader.ReadUInt32();
			m_ItemId = reader.ReadUInt16();
			m_FromPoint = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_ToPoint = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_Speed = reader.ReadByte();
			m_Duration = reader.ReadByte();

			reader.ReadByte();
			reader.ReadByte();

			m_FixedDirection = reader.ReadBoolean();
			m_Explode = reader.ReadBoolean();
			m_Hue = reader.ReadUInt32();
			m_RenderMode = reader.ReadUInt32();
			m_Effect = reader.ReadUInt16();
			m_ExplodeEffect = reader.ReadUInt16();
			m_ExplodeSound = reader.ReadUInt16();
			m_Serial = reader.ReadUInt32();
			m_Layer = reader.ReadByte();
			m_Unknown = reader.ReadInt16();
		}
コード例 #23
0
		public ContainerContent( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			ushort n = reader.ReadUInt16();
			m_ContainedItems = new ContainedItem[n];

			for ( int i = 0; i < n; i++ )
			{
				uint serial = reader.ReadUInt32();
				ushort itemId = reader.ReadUInt16();

				reader.ReadByte();

				ushort amount = reader.ReadUInt16();
				short x = reader.ReadInt16();
				short y = reader.ReadInt16();
                byte grid = reader.ReadByte();
				uint contSerial = reader.ReadUInt32();
				ushort hue = reader.ReadUInt16();

                m_ContainedItems[i] = new ContainedItem(serial, itemId, amount, x, y, grid, contSerial, hue);
			}
		}
コード例 #24
0
		public ExtendedCommand( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Length = reader.ReadUInt16();
			m_Type = reader.ReadUInt16();
			m_Data = reader.ReadBytes(m_Length - 5);

			switch(m_Type)
			{
				case 0x01:
					m_Name = "FastWalk"; break;
				case 0x02:
					m_Name = "WalkKeyAdd"; break;
				case 0x04:
					m_Name = "GumpClose"; break;
				case 0x05:
					m_Name = "ScreenSize"; break;
				case 0x06:
					m_Name = "PartyPacket"; break;
				case 0x07:
					m_Name = "QuestArrow"; break;
				case 0x08:
					m_Name = "MapChange"; break;
				case 0x09:
					m_Name = "DisarmRequest"; break;
				case 0x0a:
					m_Name = "StunRequest"; break;
				case 0x0b:
					m_Name = "LanguageSet"; break;
				case 0x0c:
					m_Name = "StatusClose"; break;
				case 0x0e:
					m_Name = "Animate"; break;
				case 0x0f:
					m_Name = "Unknown_Empty"; break;
				case 0x10:
					m_Name = "ObjectPropertyListOld"; break;
				case 0x13:
					m_Name = "ContextMenuRequest"; break;
				case 0x14:
					m_Name = "ContextMenuDisplay"; break;
				case 0x15:
					m_Name = "ContextMenuResponse"; break;
				case 0x17:
					m_Name = "DisplayHelp"; break;
				case 0x18:
					m_Name = "MapDiffEnable"; break;
				case 0x19:
					m_Name = "MiscellaneousStatus"; break;
				case 0x1a:
					m_Name = "StatLockChange"; break;
				case 0x1b:
					m_Name = "NewSpellbookContent"; break;
				case 0x1c:
					m_Name = "CastSpell"; break;
				case 0x1d:
					m_Name = "HouseDesignVersion"; break;
				case 0x1e:
					m_Name = "HouseDesignDetailed"; break;
				case 0x20:
					m_Name = "HouseCustomization"; break;
				case 0x21:
					m_Name = "WeaponAbilityClear"; break;
				case 0x22:
					m_Name = "DamagePacketOld"; break;
				case 0x24:
					m_Name = "Unknown_CheatDetector"; break;
				case 0x25:
					m_Name = "SESpellIconToggle"; break;
				case 0x26:
					m_Name = "SpeedModeSet"; break;
				default:
					m_Name = "Unknown";	break;
			}
		}
コード例 #25
0
        public EncryptionStart(PacketReader reader, bool send) : base(reader, send)
		{
            m_Ffs = new byte[3];
            m_Ffs = reader.ReadBytes(3);
		}
コード例 #26
0
ファイル: ReqWalk.cs プロジェクト: leeairw/SpyUO
 public ReqMove(PacketReader reader, bool send) : base(reader, send)
 {
     m_Direction = reader.ReadByte();
     m_Sequence  = reader.ReadByte();
     m_Fastwalk  = reader.ReadUInt32();
 }
コード例 #27
0
ファイル: MobileHits.cs プロジェクト: cbnolok/SphereSvrSource
		public MobileHits( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Serial = reader.ReadUInt32();
			m_MaxHits = reader.ReadUInt16();
			m_Hits = reader.ReadUInt16();
		}
コード例 #28
0
ファイル: MobileMana.cs プロジェクト: cbnolok/SphereSvrSource
		public MobileMana( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Serial = reader.ReadUInt32();
			m_MaxMana = reader.ReadUInt16();
			m_Mana = reader.ReadUInt16();
		}
コード例 #29
0
		public DoubleClick( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Serial = reader.ReadUInt32();
		}
コード例 #30
0
		public MobileIncoming( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();
			m_ModelId = reader.ReadUInt16();
			m_Position = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_Direction = reader.ReadByte();
			m_Hue = reader.ReadUInt16();
			m_Flag = reader.ReadByte();
			m_Notoriety = reader.ReadByte();

			ArrayList list = new ArrayList();
			uint serial;
			while ( (serial = reader.ReadUInt32()) != 0 )
			{
				ushort itemId = reader.ReadUInt16();
				byte layer = reader.ReadByte();

				ushort hue;
				if ( (itemId & 0x8000) != 0 )
				{
					itemId &= 0x7FFF;
					hue = reader.ReadUInt16();
				}
				else
					hue = 0;

				list.Add( new EquipInfo( serial, itemId, layer, hue ) );
			}

			m_Equipment = (EquipInfo[])list.ToArray( typeof( EquipInfo ) );
		}
コード例 #31
0
ファイル: RemoveItem.cs プロジェクト: cbnolok/SphereSvrSource
		public RemoveEntity( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Serial = reader.ReadUInt32();
		}
コード例 #32
0
 public OpenChat(PacketReader reader, bool send) : base(reader, send)
 {
     m_ChatName = reader.ReadASCIIString(0x39);
 }