ReadSByte() public method

public ReadSByte ( ) : sbyte
return sbyte
		public static void DropReq6017( NetState state, PacketReader pvSrc )
		{
			pvSrc.ReadInt32(); // serial, ignored
			int x = pvSrc.ReadInt16();
			int y = pvSrc.ReadInt16();
			int z = pvSrc.ReadSByte();
			pvSrc.ReadByte(); // Grid Location?
			Serial dest = pvSrc.ReadInt32();

			Point3D loc = new Point3D( x, y, z );

			Mobile from = state.Mobile;

			if (dest.IsMobile) {
				Mobile m = World.FindMobile(dest);
				try {
					if (m != null)
						from.Drop(m, loc);
				} catch (Exception e) {
					log.Fatal(String.Format("Exception disarmed in drop {0} > {1}",
											from, m), e);
				}
			} else if (dest.IsItem) {
				Item i = World.FindItem(dest);
				try {
					if (i != null)
						from.Drop(i, loc);
				} catch (Exception e) {
					log.Fatal(String.Format("Exception disarmed in drop {0} > {1}",
											from, i), e);
				}
			} else {
				from.Drop(loc);
			}
		}
		public static void DropReq6017( NetState state, PacketReader pvSrc )
		{
			pvSrc.ReadInt32(); // serial, ignored
			int x = pvSrc.ReadInt16();
			int y = pvSrc.ReadInt16();
			int z = pvSrc.ReadSByte();
			pvSrc.ReadByte(); // Grid Location?
			Serial dest = pvSrc.ReadInt32();

			Point3D loc = new Point3D( x, y, z );

			Mobile from = state.Mobile;

			if ( dest.IsMobile )
			{
				from.Drop( World.FindMobile( dest ), loc );
			}
			else if ( dest.IsItem )
			{
				Item item = World.FindItem( dest );

				if ( item is BaseMulti && ((BaseMulti)item).AllowsRelativeDrop )
				{
					loc.m_X += item.X;
					loc.m_Y += item.Y;
					from.Drop( loc );
				}
				else
				{
					from.Drop( item, loc );
				}
			}
			else
			{
				from.Drop( loc );
			}
		}
Example #3
0
        public static void CrashReport(NetState state, PacketReader pvSrc)
        {
            byte clientMaj = pvSrc.ReadByte();
            byte clientMin = pvSrc.ReadByte();
            byte clientRev = pvSrc.ReadByte();
            byte clientPat = pvSrc.ReadByte();

            ushort x = pvSrc.ReadUInt16();
            ushort y = pvSrc.ReadUInt16();
            sbyte z = pvSrc.ReadSByte();
            byte map = pvSrc.ReadByte();

            string account = pvSrc.ReadString(32);
            string character = pvSrc.ReadString(32);
            string ip = pvSrc.ReadString(15);

            int unk1 = pvSrc.ReadInt32();
            int exception = pvSrc.ReadInt32();

            string process = pvSrc.ReadString(100);
            string report = pvSrc.ReadString(100);

            pvSrc.ReadByte(); // 0x00

            int offset = pvSrc.ReadInt32();

            int count = (int)pvSrc.ReadByte();

            for (int i = 0; i < count; i++) {
                int address = pvSrc.ReadInt32();
            }
        }
Example #4
0
        public static void DropReq6017( NetState state, PacketReader pvSrc )
        {
            pvSrc.ReadInt32(); // serial, ignored
            int x = pvSrc.ReadInt16();
            int y = pvSrc.ReadInt16();
            int z = pvSrc.ReadSByte();
            pvSrc.ReadByte(); // Grid Location?
            Serial dest = pvSrc.ReadInt32();

            Point3D loc = new Point3D( x, y, z );

            Mobile from = state.Mobile;

            if ( dest.IsMobile )
                from.Drop( World.FindMobile( dest ), loc );
            else if ( dest.IsItem )
                from.Drop( World.FindItem( dest ), loc );
            else
                from.Drop( loc );
        }
        public static void DropReq( NetState state, PacketReader pvSrc )
        {
            pvSrc.ReadInt32(); // serial, ignored
            int x = pvSrc.ReadInt16();
            int y = pvSrc.ReadInt16();
            int z = pvSrc.ReadSByte();
            Serial dest = pvSrc.ReadInt32();

            Point3D loc = new Point3D( x, y, z );

            Mobile from = state.Mobile;

            if (dest.IsMobile) {
                Mobile m = World.FindMobile(dest);
                try {
                    if (m != null)
                        from.Drop(m, loc);
                } catch (Exception e) {
                    Console.WriteLine("Exception disarmed in drop {0} > {1}: {2}",
                                      from, m, e);
                }
            } else if (dest.IsItem) {
                Item i = World.FindItem(dest);
                try {
                    if (i != null)
                        from.Drop(i, loc);
                } catch (Exception e) {
                    Console.WriteLine("Exception disarmed in drop {0} > {1}: {2}",
                                      from, i, e);
                }
            } else {
                from.Drop(loc);
            }
        }
Example #6
0
        public static void DropReq6017( NetState state, PacketReader pvSrc )
        {
            if (state.IsKRClient || state.IsSAClient)
            {
                Serial m_item = pvSrc.ReadInt32(); // support UO:KR
                //pvSrc.ReadInt32(); // serial, ignored
                int x = pvSrc.ReadInt16();
                int y = pvSrc.ReadInt16();
                int z = pvSrc.ReadSByte();
                int GridLocation = pvSrc.ReadByte(); // support UO:KR
                //pvSrc.ReadByte(); // Grid Location?
                Serial dest = pvSrc.ReadInt32();

                Point3D loc = new Point3D(x, y, z);

                Mobile from = state.Mobile;

                if (dest.IsMobile)
                    from.Drop(World.FindMobile(dest), loc);
                else if (dest.IsItem)
                {
                    #region GeNova KR Support
                    if (World.FindItem(dest) is Container)
                    {
                        Container m_container = World.FindItem(dest) as Container;
                        Item[] items = m_container.FindItemsByType(typeof(Item));
                        bool canDropGrid = true;
                        foreach (Item itemDropOn in items)
                        {
                            if (itemDropOn.GridLocation == GridLocation && itemDropOn.Parent != null && itemDropOn.Parent == m_container)
                            {
                                canDropGrid = false;
                                break;
                            }
                        }
                        if (canDropGrid)
                            World.FindItem(m_item).GridLocation = GridLocation;
                        else
                        {
                            bool m_sadd = true;
                            for (int i = 0; i <= items.Length; i++)
                            {
                                foreach (Item itemDropOn in items)
                                {
                                    if (itemDropOn.GridLocation == i && itemDropOn.Parent != null && itemDropOn.Parent == m_container)
                                        m_sadd = false;
                                }
                                if (m_sadd)
                                {
                                    World.FindItem(m_item).GridLocation = i;
                                    break;
                                }
                                if (i != items.Length)
                                    m_sadd = true;
                            }
                            if (!m_sadd && (items.Length < 125))
                                World.FindItem(m_item).GridLocation = items.Length;
                        }
                    }
                    #endregion
                    from.Drop(World.FindItem(dest), loc);
                }
                else
                    from.Drop(loc);

                #region GeNova: KR Support
                if (state != null)
                    state.Send(new KRDropConfirm());
                #endregion
            }
            else
            {
                pvSrc.ReadInt32(); // serial, ignored
                int x = pvSrc.ReadInt16();
                int y = pvSrc.ReadInt16();
                int z = pvSrc.ReadSByte();
                pvSrc.ReadByte(); // Grid Location?
                Serial dest = pvSrc.ReadInt32();

                Point3D loc = new Point3D(x, y, z);

                Mobile from = state.Mobile;

                if (dest.IsMobile)
                {
                    from.Drop(World.FindMobile(dest), loc);
                }
                else if (dest.IsItem)
                {
                    Item item = World.FindItem(dest);

                    if (item is BaseMulti && ((BaseMulti)item).AllowsRelativeDrop)
                    {
                        loc.m_X += item.X;
                        loc.m_Y += item.Y;
                        from.Drop(loc);
                    }
                    else
                    {
                        from.Drop(item, loc);
                    }
                }
                else
                {
                    from.Drop(loc);
                }
            }
        }
Example #7
0
        public static void DropReq(NetState state, PacketReader pvSrc)
        {
            pvSrc.ReadInt32(); // serial, ignored
            int x = pvSrc.ReadInt16();
            int y = pvSrc.ReadInt16();
            int z = pvSrc.ReadSByte();

            // genova: suporte uo:kr.
            byte gridIndex = byte.MinValue;
            if (state.IsKRClient)
                gridIndex = pvSrc.ReadByte(); // Grid Location

            Serial dest = pvSrc.ReadInt32();

            Point3D loc = new Point3D(x, y, z);

            Mobile from = state.Mobile;

            if (dest.IsMobile)
                from.Drop(World.FindMobile(dest), loc);
            else if (dest.IsItem)
                from.Drop(World.FindItem(dest), loc);
            else
                from.Drop(loc);
        }
		public static void DropReq6017( NetState state, PacketReader pvSrc )
		{
            Serial itemSerial = pvSrc.ReadInt32(); // serial, ignored
			int x = pvSrc.ReadInt16();
			int y = pvSrc.ReadInt16();
			int z = pvSrc.ReadSByte();
			pvSrc.ReadByte(); // Grid Location?
			Serial dest = pvSrc.ReadInt32();
			Point3D loc = new Point3D( x, y, z );

			Mobile from = state.Mobile;
            Item item = World.FindItem(itemSerial);
            if (item == null) return;

            if (dest.IsMobile)
            {
                if (!from.Drop(World.FindMobile(dest), loc) && item.RootParent == null)
                {
                   item.SendInfoTo(state); // send it to the client again so it doesn't disappear 
                }
            }
            else if (dest.IsItem)
            {
                Item destItem = World.FindItem(dest);

                if (destItem is BaseMulti && ((BaseMulti)destItem).AllowsRelativeDrop)
                {
                    loc.m_X += destItem.X;
                    loc.m_Y += destItem.Y;
                    from.Drop(loc);
                }
                else
                {
                    if (!from.Drop(destItem, loc) && item.RootParent == null)
                    {
                        item.SendInfoTo(state);
                    }
                }
            }
            else if (!from.Drop(loc) && item.RootParent == null)
            {
                item.SendInfoTo(state);
            }
		}
Example #9
0
		public static void DropReq6017(NetState state, PacketReader pvSrc)
		{
			Serial serial = pvSrc.ReadInt32();
			int x = pvSrc.ReadInt16();
			int y = pvSrc.ReadInt16();
			int z = pvSrc.ReadSByte();
			pvSrc.ReadByte(); // Grid Location?
			Serial dest = pvSrc.ReadInt32();

			var loc = new Point3D(x, y, z);

			Mobile from = state.Mobile;
			Item item = World.FindItem(serial);

			if (item == null)
			{
				return;
			}

			if (dest.IsMobile)
			{
				if (!from.Drop(World.FindMobile(dest), loc) && item.RootParent == null)
				{
					item.SendInfoTo(state); // vanishing item fix 
				}
			}
			else if (dest.IsItem)
			{
				Item target = World.FindItem(dest);

				if (target is BaseMulti && ((BaseMulti)target).AllowsRelativeDrop)
				{
					loc.m_X += target.X;
					loc.m_Y += target.Y;
					from.Drop(loc);
				}
				else if (!from.Drop(target, loc) && item.RootParent == null)
				{
					item.SendInfoTo(state); // vanishing item fix 
				}				
			}
			else if (!from.Drop(loc) && item.RootParent == null)
			{
				item.SendInfoTo(state); // vanishing item fix
			}
		}
        // UOSA
        public static void DisplayWaipoint3D(NetState state, PacketReader pvSrc)
        {
            int size = pvSrc.ReadInt16();
            int obj_serial = pvSrc.ReadInt32();

            int x = pvSrc.ReadInt16();
            int y = pvSrc.ReadInt16();
            int z = pvSrc.ReadSByte();
            int mapID = pvSrc.ReadByte();

            int obj_type = pvSrc.ReadInt16();
            int ignore_obj_type = pvSrc.ReadByte();

            int obj_cliloc = pvSrc.ReadInt32();
            string obj_cliloc_args = pvSrc.ReadUnicodeString();

            int unk1 = pvSrc.ReadInt16();

            //no complete
            if (ignore_obj_type == 1)
            {

            }
        }
		public static void DropReq(NetState state, PacketReader pvSrc)
		{
			pvSrc.ReadInt32(); // serial, ignored
			int x = pvSrc.ReadInt16();
			int y = pvSrc.ReadInt16();
			int z = pvSrc.ReadSByte();
            #region Enhance Client
            byte gridloc = pvSrc.ReadByte(); // grid location
            #endregion

            Serial dest = pvSrc.ReadInt32();

			var loc = new Point3D(x, y, z);

			Mobile from = state.Mobile;

			if (dest.IsMobile)
			{
				from.Drop(World.FindMobile(dest), loc);
			}
			else if (dest.IsItem)
			{
				Item item = World.FindItem(dest);

				if (item is BaseMulti && ((BaseMulti)item).AllowsRelativeDrop)
				{
					loc.m_X += item.X;
					loc.m_Y += item.Y;
					from.Drop(loc);
				}
				else
                {
                    #region Enhance Client
                    from.Drop(item, loc, gridloc);
                    #endregion
                }
			}
			else
			{
				from.Drop(loc);
			}
		}
Example #12
0
        //Plume : Net 4
        public static void ClientCrashReport(NetState state, PacketReader pvSrc)
		{
			int maj = pvSrc.ReadByte();
			int min = pvSrc.ReadByte();
			int rev = pvSrc.ReadByte();
			int pat = pvSrc.ReadByte();
			int x = pvSrc.ReadInt16();
			int y = pvSrc.ReadInt16();
			int z = pvSrc.ReadSByte();
			int map = pvSrc.ReadByte();
			string acct = pvSrc.ReadString(0x20);
			string pg = pvSrc.ReadString(0x20);
			string ip = pvSrc.ReadString(15);
			pvSrc.ReadInt32();
			int excode = pvSrc.ReadInt32();
			string procname = pvSrc.ReadString(100);
			string crashrep = pvSrc.ReadString(100);
			pvSrc.ReadByte();
			int exoffset = pvSrc.ReadInt32();
			List<int> list = new List<int>();
			int addrcount = pvSrc.ReadByte();
			for (int i = 0; i < addrcount; i++)
			{
				list.Add(pvSrc.ReadInt32());
			}
			Server.ClientVersion version = new Server.ClientVersion(maj, min, rev, pat);
			if (!Directory.Exists("Logs/ClientCrashes"))
			{
				Directory.CreateDirectory("Logs/ClientCrashes");
			}
			using (StreamWriter writer = new StreamWriter(Path.Combine("Logs/ClientCrashes", string.Format("{0}.log", DateTime.Now.ToLongDateString())), true))
			{
				writer.Write("Time: {0} Ip:{1} Account: {2} Character: {3}\r\nClientVersion {4}\r\nLocation: {5}, {6}, {7}\r\nMap: {8}\r\nExceptionCode: {9}\r\nProcessName: {10}\r\nCrashReport: {11}\r\nExceptionOffset: {12}\r\nAddressCount: {13}\r\n", new object[] { DateTime.Now.ToString(), ip, acct, pg, version.ToString(), x.ToString(), y.ToString(), z.ToString(), map.ToString(), excode.ToString(), procname, crashrep, exoffset.ToString(), addrcount.ToString() });
				for (int j = 0; j < addrcount; j++)
				{
					writer.WriteLine("Address: {0}", list[j].ToString());
				}
				writer.WriteLine("");
			}
		}
Example #13
0
		public static void DropReq( NetState state, PacketReader pvSrc )
		{
			pvSrc.ReadInt32(); // serial, ignored
			int x = pvSrc.ReadInt16();
			int y = pvSrc.ReadInt16();
			int z = pvSrc.ReadSByte();
			Serial dest = pvSrc.ReadInt32();

			Point3D loc = new Point3D( x, y, z );

			Mobile from = state.Mobile;

			bool success = false;
			Item holding = from.Holding;

			if ( dest.IsMobile )
				success = from.Drop( World.FindMobile( dest ), loc );
			else if ( dest.IsItem )
				success = from.Drop( World.FindItem( dest ), loc );
			else
				success = from.Drop( loc );

			if ( holding != null )
			{
				if ( !success && holding.DupeSource != null )
				{
					holding.DupeSource.Amount += holding.Amount;
					holding.Delete();
				}

				holding.DupeSource = null;
			}
		}
		public static void ChangeZ( NetState state, PacketReader pvSrc )
		{
			if ( VerifyGC( state ) )
			{
				int x = pvSrc.ReadInt16();
				int y = pvSrc.ReadInt16();
				int z = pvSrc.ReadSByte();

				Console.WriteLine( "God Client: {0}: Change Z ({1}, {2}, {3})", state, x, y, z );
			}
		}
Example #15
0
        public static void DropReq6017(NetState state, PacketReader pvSrc)
        {
            if (state.IsKRClient || state.IsSAClient)
            {
                Serial m_item = pvSrc.ReadInt32(); // support UO:KR
                //pvSrc.ReadInt32(); // serial, ignored
                int x = pvSrc.ReadInt16();
                int y = pvSrc.ReadInt16();
                int z = pvSrc.ReadSByte();
                int GridLocation = pvSrc.ReadByte(); // support UO:KR
                //pvSrc.ReadByte(); // Grid Location?
                Serial dest = pvSrc.ReadInt32();

                Point3D loc = new Point3D(x, y, z);

                Mobile from = state.Mobile;

                if (dest.IsMobile)
                    from.Drop(World.FindMobile(dest), loc);
                else if (dest.IsItem)
                {
                    #region GeNova KR Support
                    if (World.FindItem(dest) is Container)
                    {
                        Container m_container = World.FindItem(dest) as Container;
                        Item[] items = m_container.FindItemsByType(typeof(Item));
                        bool canDropGrid = true;
                        foreach (Item itemDropOn in items)
                        {
                            if (itemDropOn.GridLocation == GridLocation && itemDropOn.Parent != null && itemDropOn.Parent == m_container)
                            {
                                canDropGrid = false;
                                break;
                            }
                        }
                        if (canDropGrid)
                            World.FindItem(m_item).GridLocation = GridLocation;
                        else
                        {
                            bool m_sadd = true;
                            for (int i = 0; i <= items.Length; i++)
                            {
                                foreach (Item itemDropOn in items)
                                {
                                    if (itemDropOn.GridLocation == i && itemDropOn.Parent != null && itemDropOn.Parent == m_container)
                                        m_sadd = false;
                                }
                                if (m_sadd)
                                {
                                    World.FindItem(m_item).GridLocation = i;
                                    break;
                                }
                                if (i != items.Length)
                                    m_sadd = true;
                            }
                            if (!m_sadd && (items.Length < 125))
                                World.FindItem(m_item).GridLocation = items.Length;
                        }
                    }
                    #endregion
                    from.Drop(World.FindItem(dest), loc);
                }
                else
                    from.Drop(loc);

                #region GeNova: KR Support
                if (state != null)
                    state.Send(new KRDropConfirm());
                #endregion
            }
            else
            {
                pvSrc.ReadInt32(); // serial, ignored
                int x = pvSrc.ReadInt16();
                int y = pvSrc.ReadInt16();
                int z = pvSrc.ReadSByte();
                pvSrc.ReadByte(); // Grid Location?
                Serial dest = pvSrc.ReadInt32();

                Point3D loc = new Point3D(x, y, z);

                Mobile from = state.Mobile;

                bool success = false;
                Item holding = from.Holding;

                if (dest.IsMobile)
                    success = from.Drop(World.FindMobile(dest), loc);
                else if (dest.IsItem)
                    success = from.Drop(World.FindItem(dest), loc);
                else
                    success = from.Drop(loc);

                if (holding != null)
                {
                    if (!success && holding.DupeSource != null)
                    {
                        holding.DupeSource.Amount += holding.Amount;
                        holding.Delete();
                    }

                    holding.DupeSource = null;
                }
            }
        }
		public static void Edit( NetState state, PacketReader pvSrc )
		{
			if ( VerifyGC( state ) )
			{
				int type = pvSrc.ReadByte(); // 10 = static, 7 = npc, 4 = dynamic
				int x = pvSrc.ReadInt16();
				int y = pvSrc.ReadInt16();
				int id = pvSrc.ReadInt16();
				int z = pvSrc.ReadSByte();
				int hue = pvSrc.ReadUInt16();

				Console.WriteLine( "God Client: {0}: Edit {6} ({1}, {2}, {3}) 0x{4:X} (0x{5:X})", state, x, y, z, id, hue, type );
			}
		}
Example #17
0
        public void DropReq( GameClient state, PacketReader pvSrc )
        {
            Serial serial = (Serial) pvSrc.ReadInt32();

            int x = pvSrc.ReadInt16();
            int y = pvSrc.ReadInt16();
            int z = pvSrc.ReadSByte();

            byte gridloc = pvSrc.ReadByte(); // grid location

            Serial dest = pvSrc.ReadInt32();

            Point3D loc = new Point3D( x, y, z );

            Mobile from = state.Mobile;

            if ( dest.IsMobile )
            {
                Mobile m = World.Instance.FindMobile( dest );

                try
                {
                    if ( m != null )
                        if ( from.Drop( m, loc ) )
                            state.Send( ConfirmDrop.Instance );
                        else
                            state.Send( new InvalidDrop( serial ) );
                }
                catch ( Exception e )
                {
                    Logger.Error( "Exception disarmed in drop {0} > {1}: {2}", from, m, e );
                }
            }
            else if ( dest.IsItem )
            {
                Item i = World.Instance.FindItem( dest );

                try
                {
                    if ( i != null )
                        if ( from.Drop( i, loc, gridloc ) )
                            state.Send( ConfirmDrop.Instance );
                        else
                            state.Send( new InvalidDrop( serial ) );
                }
                catch ( Exception e )
                {
                    Logger.Error( "Exception disarmed in drop {0} > {1}: {2}", from, i, e );
                }
            }
            else
            {
                if ( from.Drop( loc ) )
                    state.Send( ConfirmDrop.Instance );
                else
                    state.Send( new InvalidDrop( serial ) );
            }
        }