Exemple #1
0
		/*
		 * public override void SendPlayerBanner(GamePlayer player, int GuildEmblem)
		{
			if (player == null) return;
			GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.VisualEffect));
			pak.WriteShort((ushort) player.ObjectID);
			pak.WriteByte(12);
			if (GuildEmblem == 0)
			{
				pak.WriteByte(1);
			}
			else
			{
				pak.WriteByte(0);
			}
			int newEmblemBitMask = ((GuildEmblem & 0x010000) << 8) | (GuildEmblem & 0xFFFF);
			pak.WriteInt((uint)newEmblemBitMask);
			SendTCP(pak);
		}

		 */

		public override void SendHouse(House house)
		{
			GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseCreate));
			pak.WriteShort((ushort)house.HouseNumber);
			pak.WriteShort((ushort)house.Z);
			pak.WriteInt((uint)house.X);
			pak.WriteInt((uint)house.Y);
			pak.WriteShort((ushort)house.Heading);
			pak.WriteShort((ushort)house.PorchRoofColor);
			pak.WriteShort((ushort)(house.GetPorchAndGuildEmblemFlags() | (house.Emblem & 0x010000) >> 13));//new Guild Emblem
			pak.WriteShort((ushort)house.Emblem);
			pak.WriteByte((byte)house.Model);
			pak.WriteByte((byte)house.RoofMaterial);
			pak.WriteByte((byte)house.WallMaterial);
			pak.WriteByte((byte)house.DoorMaterial);
			pak.WriteByte((byte)house.TrussMaterial);
			pak.WriteByte((byte)house.PorchMaterial);
			pak.WriteByte((byte)house.WindowMaterial);
			pak.WriteByte(0x03);
			pak.WritePascalString(house.Name);

			SendTCP(pak);
		}
		//housing
		public virtual void SendHouse(House house)
		{
			using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseCreate)))
			{
				pak.WriteShort((ushort) house.HouseNumber);
				pak.WriteShort((ushort) house.Z);
				pak.WriteInt((uint) house.X);
				pak.WriteInt((uint) house.Y);
				pak.WriteShort((ushort) house.Heading);
				pak.WriteShort((ushort) house.PorchRoofColor);
				pak.WriteShort((ushort) house.GetPorchAndGuildEmblemFlags());
				pak.WriteShort((ushort) house.Emblem);
				pak.WriteByte((byte) house.Model);
				pak.WriteByte((byte) house.RoofMaterial);
				pak.WriteByte((byte) house.WallMaterial);
				pak.WriteByte((byte) house.DoorMaterial);
				pak.WriteByte((byte) house.TrussMaterial);
				pak.WriteByte((byte) house.PorchMaterial);
				pak.WriteByte((byte) house.WindowMaterial);
				pak.WriteByte(0x03);
				pak.WritePascalString(house.Name);

				SendTCP(pak);
			}
			
			// Update cache
			m_gameClient.HouseUpdateArray[new Tuple<ushort, ushort>(house.RegionID, (ushort)house.HouseNumber)] = GameTimer.GetTickCount();
		}