当前位置: 首页>>代码示例>>C#>>正文


C# PacketReader.ReadSByte方法代码示例

本文整理汇总了C#中Server.Network.PacketReader.ReadSByte方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadSByte方法的具体用法?C# PacketReader.ReadSByte怎么用?C# PacketReader.ReadSByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Network.PacketReader的用法示例。


在下文中一共展示了PacketReader.ReadSByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DropReq6017

		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);
			}
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:35,代码来源:PacketHandlers.cs

示例2: DropReq6017

		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 );
			}
		}
开发者ID:Grimoric,项目名称:RunUO.2.3.r1083,代码行数:37,代码来源:PacketHandlers.cs

示例3: CrashReport

        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();
            }
        }
开发者ID:3HMonkey,项目名称:runuo-ec,代码行数:32,代码来源:PacketHandlers.cs

示例4: DropReq6017

        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 );
        }
开发者ID:OurUO,项目名称:ouruo-server,代码行数:20,代码来源:PacketHandlers.cs

示例5: DropReq

        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);
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:34,代码来源:PacketHandlers.cs

示例6: DropReq6017

        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);
//.........这里部分代码省略.........
开发者ID:3HMonkey,项目名称:runuo-ec,代码行数:101,代码来源:PacketHandlers.cs

示例7: DropReq

        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);
        }
开发者ID:PepeBiondi,项目名称:runsa,代码行数:25,代码来源:PacketHandlers.cs

示例8: DropReq6017

		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);
            }
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:44,代码来源:PacketHandlers.cs

示例9: DropReq6017

		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
			}
		}
开发者ID:iansmellis,项目名称:JustUO,代码行数:46,代码来源:PacketHandlers.cs

示例10: DisplayWaipoint3D

        // 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)
            {

            }
        }
开发者ID:greeduomacro,项目名称:liberdade-uo-server,代码行数:25,代码来源:PacketHandlers.cs

示例11: DropReq

		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);
			}
		}
开发者ID:zerodowned,项目名称:JustUO-merged-with-EC-Support,代码行数:42,代码来源:PacketHandlers.cs

示例12: ClientCrashReport

        //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("");
			}
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:41,代码来源:PacketHandlers.cs

示例13: DropReq

		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;
			}
		}
开发者ID:suiy187,项目名称:runuocustom,代码行数:33,代码来源:PacketHandlers.cs

示例14: ChangeZ

		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 );
			}
		}
开发者ID:Grimoric,项目名称:RunUO.2.3.r1083,代码行数:11,代码来源:PacketHandlers.cs

示例15: DropReq6017

        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();
                    }
//.........这里部分代码省略.........
开发者ID:PepeBiondi,项目名称:runsa,代码行数:101,代码来源:PacketHandlers.cs


注:本文中的Server.Network.PacketReader.ReadSByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。