• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Network.EncodedReader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



EncodedReader类属于Server.Network命名空间,在下文中一共展示了EncodedReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: QuestButton

        public static void QuestButton( GameClient state, IEntity e, EncodedReader reader )
        {
            if ( state.Mobile is PlayerMobile )
            {
                PlayerMobile from = (PlayerMobile) state.Mobile;

                from.CloseGump( typeof( BaseQuestGump ) );
                from.SendGump( new MLQuestMainLogGump( from ) );
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:10,代码来源:PacketOverrides.cs


示例2: QuestButton

        public static void QuestButton(NetState state, IEntity e, EncodedReader reader) 
        {
            if (state.Mobile is PlayerMobile)
            {
                PlayerMobile from = (PlayerMobile)state.Mobile;
				
                from.CloseGump(typeof(MondainQuestGump));
                from.SendGump(new MondainQuestGump(from));
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:10,代码来源:PacketOverrides.cs


示例3: Designer_Backup

        public static void Designer_Backup( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client chose to backup design state
                 *  - Construct a copy of the current design state
                 *  - Assign constructed state to backup state field
                 */

                // Construct a copy of the current design state
                DesignState copyState = new DesignState( context.Foundation.DesignState );

                // Assign constructed state to backup state field
                context.Foundation.BackupState = copyState;
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:19,代码来源:HouseFoundation.cs


示例4: EquipLastWeaponMacro

 public void EquipLastWeaponMacro( GameClient state, IEntity e, EncodedReader reader )
 {
     EventSink.Instance.InvokeEquipLastWeaponMacroUsed( new EquipLastWeaponMacroEventArgs( state.Mobile ) );
 }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:4,代码来源:PacketHandlers.cs


示例5: Designer_Stairs

        public static void Designer_Stairs( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client chose to add stairs
                 *  - Read data detailing stair type and location
                 *  - Validate stair multi ID
                 *  - Add the stairs
                 *     - Load data describing the stair components
                 *     - Insert described components
                 *  - Update revision
                 */

                // Read data detailing stair type and location
                int itemID = pvSrc.ReadInt32();
                int x = pvSrc.ReadInt32();
                int y = pvSrc.ReadInt32();

                // Validate stair multi ID
                DesignState design = context.Foundation.DesignState;

                if ( itemID < 0x1DB0 || itemID > 0x1DD7 )
                {
                    /* Specified multi ID is not a stair
                     *  - Resend design state
                     *  - Return without further processing
                     */

                    design.SendDetailedInfoTo( state );
                    return;
                }

                // Add the stairs
                MultiComponentList mcl = design.Components;

                // Add the stairs : Load data describing stair components
                MultiComponentList stairs = MultiData.GetComponents( itemID );

                // Add the stairs : Insert described components
                int z = GetLevelZ( context.Level );

                for ( int i = 0; i < stairs.List.Length; ++i )
                {
                    MultiTileEntry entry = stairs.List[i];

                    if ( (entry.m_ItemID & 0x3FFF) != 1 )
                        mcl.Add( entry.m_ItemID, x + entry.m_OffsetX, y + entry.m_OffsetY, z + entry.m_OffsetZ );
                }

                // Update revision
                design.OnRevised();
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:56,代码来源:HouseFoundation.cs


示例6: Designer_Roof

        public static void Designer_Roof( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                // Read data detailing component graphic and location
                int itemID = pvSrc.ReadInt32();
                int x = pvSrc.ReadInt32();
                int y = pvSrc.ReadInt32();
                int z = pvSrc.ReadInt32();

                // Add component
                DesignState design = context.Foundation.DesignState;

                if ( (TileData.ItemTable[itemID & 0x3FFF].Flags & TileFlag.Roof) == 0 )
                {
                    design.SendDetailedInfoTo( state );
                    return;
                }

                MultiComponentList mcl = design.Components;

                if ( z < -3 || z > 12 || z % 3 > 0 )
                    z = 0;
                z += GetLevelZ( context.Level );

                MultiTileEntry[] list = mcl.List;
                for ( int i = 0; i < list.Length; i++ )
                {
                    MultiTileEntry mte = list[i];

                    if ( mte.m_OffsetX == x && mte.m_OffsetY == y && (TileData.ItemTable[mte.m_ItemID & 0x3FFF].Flags & TileFlag.Roof) != 0 )
                        mcl.Remove( mte.m_ItemID, x, y, mte.m_OffsetZ );
                }

                mcl.Add( itemID, x, y, z );

                // Update revision
                design.OnRevised();
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:43,代码来源:HouseFoundation.cs


示例7: Designer_Restore

        public static void Designer_Restore( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client chose to restore design to the last backup state
                 *  - Restore backup
                 *     - Construct new design state from backup state
                 *     - Assign constructed state to foundation
                 *  - Update revision
                 *  - Update client with new state
                 */

                // Restore backup : Construct new design state from backup state
                DesignState backupDesign = new DesignState( context.Foundation.BackupState );

                // Restore backup : Assign constructed state to foundation
                context.Foundation.DesignState = backupDesign;

                // Update revision;
                backupDesign.OnRevised();

                // Update client with new state
                context.Foundation.SendInfoTo( state );
                backupDesign.SendDetailedInfoTo( state );
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:29,代码来源:HouseFoundation.cs


示例8: Designer_Delete

        public static void Designer_Delete( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client chose to delete a component
                 *  - Read data detailing which component to delete
                 *  - Verify component is deletable
                 *  - Remove the component
                 *  - If needed, replace removed component with a dirt tile
                 *  - Update revision
                 */

                // Read data detailing which component to delete
                int itemID = pvSrc.ReadInt32();
                int x = pvSrc.ReadInt32();
                int y = pvSrc.ReadInt32();
                int z = pvSrc.ReadInt32();

                // Verify component is deletable
                DesignState design = context.Foundation.DesignState;
                MultiComponentList mcl = design.Components;

                int ax = x + mcl.Center.X;
                int ay = y + mcl.Center.Y;

                if ( IsSignHanger( itemID ) || (z == 0 && ax >= 0 && ax < mcl.Width && ay >= 0 && ay < (mcl.Height - 1)) )
                {
                    /* Component is not deletable
                     *  - Resend design state
                     *  - Return without further processing
                     */

                    design.SendDetailedInfoTo( state );
                    return;
                }

                // Remove the component
                if ( !DeleteStairs( mcl, itemID, x, y, z ) )
                    mcl.Remove( itemID, x, y, z );

                // If needed, replace removed component with a dirt tile
                if ( ax >= 1 && ax < mcl.Width && ay >= 1 && ay < mcl.Height - 1 )
                {
                    Tile[] tiles = mcl.Tiles[ax][ay];

                    bool hasBaseFloor = false;

                    for ( int i = 0; !hasBaseFloor && i < tiles.Length; ++i )
                        hasBaseFloor = ( tiles[i].Z == 7 && (tiles[i].ID & 0x3FFF) != 1 );

                    if ( !hasBaseFloor )
                    {
                        // Replace with a dirt tile
                        mcl.Add( 0x31F4, x, y, 7 );
                    }
                }

                // Update revision
                design.OnRevised();
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:64,代码来源:HouseFoundation.cs


示例9: Designer_Close

        public static void Designer_Close( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client closed his house design window
                 *  - Remove design context
                 *  - Notify the client that customization has ended
                 *  - Refresh client with current visable design state
                 *  - If a signpost is needed, add it
                 *  - Eject all from house
                 *  - Restore relocated entities
                 */

                // Remove design context
                DesignContext.Remove( from );

                // Notify the client that customization has ended
                from.Send( new EndHouseCustomization( context.Foundation ) );

                // Refresh client with current visible design state
                context.Foundation.SendInfoTo( state );
                context.Foundation.CurrentState.SendDetailedInfoTo( state );

                // If a signpost is needed, add it
                context.Foundation.CheckSignpost();

                // Eject all from house
                from.RevealingAction();

                foreach ( Item item in context.Foundation.GetItems() )
                    item.Location = context.Foundation.BanLocation;

                foreach ( Mobile mobile in context.Foundation.GetMobiles() )
                    mobile.Location = context.Foundation.BanLocation;

                // Restore relocated entities
                context.Foundation.RestoreRelocatedEntities();
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:42,代码来源:HouseFoundation.cs


示例10: Designer_Build

        public static void Designer_Build( GameClient state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client chose to add a component
                 *  - Read data detailing component graphic and location
                 *  - Add component
                 *  - Update revision
                 */

                // Read data detailing component graphic and location
                int itemID = pvSrc.ReadInt32();
                int x = pvSrc.ReadInt32();
                int y = pvSrc.ReadInt32();

                // Add component
                DesignState design = context.Foundation.DesignState;

                if ( from.AccessLevel < AccessLevel.GameMaster && !ValidPiece( itemID ) )
                {
                    TraceValidity( state, itemID );
                    design.SendDetailedInfoTo( state );
                    return;
                }

                MultiComponentList mcl = design.Components;

                int z = GetLevelZ( context.Level, context.Foundation );

                if ( ( y + mcl.Center.Y ) == ( mcl.Height - 1 ) )
                    z = 0; // Tiles placed on the far-south of the house are at 0 Z

                mcl.Add( itemID, x, y, z );

                // Update revision
                design.OnRevised();
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:41,代码来源:HouseFoundation.cs


示例11: QuestButton

        public static void QuestButton(NetState state, IEntity e, EncodedReader reader)
        {
            if (state == null || state.Mobile == null) return;
            Mobile from = state.Mobile;

            from.CloseGump(typeof(QuestLogGump));
            // bring up the quest status gump
            from.SendGump(new QuestLogGump(from));
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:9,代码来源:XmlQuest.cs


示例12: Designer_Commit

		public static void Designer_Commit(NetState state, IEntity e, EncodedReader pvSrc)
		{
			Mobile from = state.Mobile;
			DesignContext context = DesignContext.Find(from);

			if (context != null)
			{
				int oldPrice = context.Foundation.Price;
				int newPrice = oldPrice + context.Foundation.CustomizationCost +
							   ((context.Foundation.DesignState.Components.List.Length -
								 (context.Foundation.CurrentState.Components.List.Length + context.Foundation.Fixtures.Count)) * 500);

				Type cType = context.Foundation.Expansion == Expansion.T2A ? typeof(Silver) : typeof(Gold);

				int bankBalance = Banker.GetBalance(from, cType);

				from.SendGump(new ConfirmCommitGump(from, context.Foundation, bankBalance, oldPrice, newPrice));
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:19,代码来源:HouseFoundation.cs


示例13: SetAbility

 public void SetAbility( GameClient state, IEntity e, EncodedReader reader )
 {
     EventSink.Instance.InvokeSetAbility( new SetAbilityEventArgs( state.Mobile, reader.ReadInt32() ) );
 }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:4,代码来源:PacketHandlers.cs


示例14: QuestGumpRequest

 public void QuestGumpRequest( GameClient state, IEntity e, EncodedReader reader )
 {
     EventSink.Instance.InvokeQuestGumpRequest( new QuestGumpRequestArgs( state.Mobile ) );
 }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:4,代码来源:PacketHandlers.cs


示例15: Designer_Build

        public static void Designer_Build( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client chose to add a component
                 *  - Read data detailing component graphic and location
                 *  - Add component
                 *  - Update revision
                 */

                // Read data detailing component graphic and location
                int itemID = pvSrc.ReadInt32();
                int x = pvSrc.ReadInt32();
                int y = pvSrc.ReadInt32();

                // Add component
                DesignState design = context.Foundation.DesignState;
                MultiComponentList mcl = design.Components;

                int z = GetLevelZ( context.Level );

                if ( (y + mcl.Center.Y) == (mcl.Height - 1) )
                    z = 0; // Tiles placed on the far-south of the house are at 0 Z

                mcl.Add( itemID, x, y, z );

                // Update revision
                design.OnRevised();
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:33,代码来源:HouseFoundation.cs


示例16: Designer_Clear

        public static void Designer_Clear( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client chose to clear the design
                 *  - Restore empty foundation
                 *     - Construct new design state from empty foundation
                 *     - Assign constructed state to foundation
                 *  - Update revision
                 *  - Update client with new state
                 */

                // Restore empty foundation : Construct new design state from empty foundation
                DesignState newDesign = new DesignState( context.Foundation, context.Foundation.GetEmptyFoundation() );

                // Restore empty foundation : Assign constructed state to foundation
                context.Foundation.DesignState = newDesign;

                // Update revision
                newDesign.OnRevised();

                // Update client with new state
                context.Foundation.SendInfoTo( state );
                newDesign.SendDetailedInfoTo( state );
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:29,代码来源:HouseFoundation.cs


示例17: QuestButton

		public static void QuestButton(NetState state, IEntity e, EncodedReader reader)
		{
			if (state == null || state.Mobile == null) return;
			Mobile from = state.Mobile;

            from.CloseGump(typeof(XMLQuestLogGump));
			// bring up the quest status gump
            from.SendGump(new XMLQuestLogGump(from));

			// bring up the normal quest objectives gump
			//NormalQuestButton(from as PlayerMobile);
		}
开发者ID:jamison654321,项目名称:xmlspawner,代码行数:12,代码来源:XmlQuest.cs


示例18: Designer_Commit

        public static void Designer_Commit( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                int oldPrice = context.Foundation.Price;
                int newPrice = oldPrice + 10000 + ((context.Foundation.DesignState.Components.List.Length - context.Foundation.CurrentState.Components.List.Length) * 500);
                int bankBalance = Banker.GetBalance( from );

                from.SendGump( new ConfirmCommitGump( from, context.Foundation, bankBalance, oldPrice, newPrice ) );
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:14,代码来源:HouseFoundation.cs


示例19: Designer_Roof

		public static void Designer_Roof( NetState state, IEntity e, EncodedReader pvSrc )
		{
			Mobile from = state.Mobile;
			DesignContext context = DesignContext.Find( from );

			if( context != null && (Core.SE || from.AccessLevel >= AccessLevel.GameMaster) )
			{
				// Read data detailing component graphic and location
				int itemID = pvSrc.ReadInt32();
				int x = pvSrc.ReadInt32();
				int y = pvSrc.ReadInt32();
				int z = pvSrc.ReadInt32();

				// Add component
				DesignState design = context.Foundation.DesignState;

				if( from.AccessLevel < AccessLevel.GameMaster && !ValidPiece( itemID, true ) )
				{
					TraceValidity( state, itemID );
					design.SendDetailedInfoTo( state );
					return;
				}

				MultiComponentList mcl = design.Components;

				if( z < -3 || z > 12 || z % 3 != 0 )
					z = -3;
				z += GetLevelZ( context.Level, context.Foundation );

				MultiTileEntry[] list = mcl.List;
				for( int i = 0; i < list.Length; i++ )
				{
					MultiTileEntry mte = list[i];

					if( mte.m_OffsetX == x && mte.m_OffsetY == y && GetZLevel( mte.m_OffsetZ, context.Foundation ) == context.Level  && (TileData.ItemTable[mte.m_ItemID & TileData.MaxItemValue].Flags & TileFlag.Roof) != 0 )
						mcl.Remove( mte.m_ItemID, x, y, mte.m_OffsetZ );
				}

				mcl.Add( itemID, x, y, z );

				// Update revision
				design.OnRevised();
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:44,代码来源:HouseFoundation.cs


示例20: Designer_Level

        public static void Designer_Level( NetState state, IEntity e, EncodedReader pvSrc )
        {
            Mobile from = state.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client is moving to a new floor level
                 *  - Read data detailing the target level
                 *  - Validate target level
                 *  - Update design context with new level
                 *  - Teleport mobile to new level
                 *  - Update client
                 *
                 * TODO: Proper validation for two-story homes
                 */

                // Read data detailing the target level
                int newLevel = pvSrc.ReadInt32();

                // Validate target level
                if ( newLevel < 1 || newLevel > 4 )
                    newLevel = 1;

                // Update design context with new level
                context.Level = newLevel;

                // Teleport mobile to new level
                from.Location = new Point3D( from.X, from.Y, context.Foundation.Z + GetLevelZ( newLevel ) );

                // Update client
                context.Foundation.SendInfoTo( state );
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:34,代码来源:HouseFoundation.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Network.EquipmentInfo类代码示例发布时间:2022-05-26
下一篇:
C# Network.Client类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap