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

C# IPacketReceiver类代码示例

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

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



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

示例1: SendAllAuras

		public static void SendAllAuras(IPacketReceiver rcv, Unit owner)
		{
			using (var packet = CreateAllAuraPacket(owner))
			{
				rcv.Send(packet);
			}
		}
开发者ID:Skizot,项目名称:WCell,代码行数:7,代码来源:AuraHandler.cs


示例2: SendArenaTeamRosterResponse

 public static void SendArenaTeamRosterResponse(IPacketReceiver client, ArenaTeam team)
 {
     using (var packet = CreateArenaTeamRosterResponsePacket(team))
     {
         client.Send(packet);
     }
 }
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:ArenaTeamHandler.cs


示例3: SetUp

 public void SetUp()
 {
     request = new SomeRequest();
     serverAddress = Mock.Of<IServerAddress>();
     packetReceiver = Mock.Of<IPacketReceiver>();
     packetConverter = Mock.Of<IPacketConverter>();
     responseReceiver = new ResponseReveiver(packetReceiver, packetConverter);
 }
开发者ID:AlexSbyshko,项目名称:Barsik.Client,代码行数:8,代码来源:ResponseReceiverTests.cs


示例4: SendCancelAutoRepeat

 public static void SendCancelAutoRepeat(IPacketReceiver client, IEntity entity)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_CANCEL_AUTO_REPEAT))
     {
         entity.EntityId.WritePacked(packet);
         client.Send(packet);
     }
 }
开发者ID:Zakkgard,项目名称:WCell,代码行数:8,代码来源:MiscHandler.cs


示例5: SendAllAuras

 public static void SendAllAuras(IPacketReceiver rcv, Unit owner)
 {
     if (!owner.IsAreaActive) return;
     using (var packet = CreateAllAuraPacket(owner))
     {
         rcv.Send(packet);
     }
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:8,代码来源:AuraHandler.cs


示例6: SendBreakTarget

		public static void SendBreakTarget(IPacketReceiver rcvr, IEntity target)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_BREAK_TARGET, 8))
			{
				packet.Write(target.EntityId);
				rcvr.Send(packet);
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:8,代码来源:VehicleHandler.cs


示例7: SendInstanceReset

 /// <summary>
 /// An instance has been reset
 /// </summary>
 public static void SendInstanceReset(IPacketReceiver client, MapId mapId)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_UPDATE_LAST_INSTANCE, 4))
     {
         packet.Write((int)mapId);
         client.Send(packet);
     }
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:11,代码来源:InstanceHandler.cs


示例8: SendUpdateWorldState

 public static void SendUpdateWorldState(IPacketReceiver rcv, WorldStateId key, int value)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_UPDATE_WORLD_STATE, 300))
     {
         packet.Write((uint)key);
         packet.Write(value);
         rcv.Send(packet);
     }
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:9,代码来源:WorldStateHandler.cs


示例9: SendVisible

		/// <summary>
		/// Makes the given faction visible to the client.
		/// </summary>
		public static void SendVisible(IPacketReceiver client, FactionReputationIndex reputationIndex)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SET_FACTION_VISIBLE, 4))
			{
				packet.Write((int)reputationIndex);

				client.Send(packet);
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:12,代码来源:FactionHandler.cs


示例10: SendGameObjectTextPage

        public static void SendGameObjectTextPage(IPacketReceiver rcv, IEntity obj)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GAMEOBJECT_PAGETEXT, 8))
            {
                packet.Write(obj.EntityId);

                rcv.Send(packet);
            }
        }
开发者ID:Zakkgard,项目名称:WCell,代码行数:9,代码来源:MiscHandler.cs


示例11: SendLearnedSpell

		public static void SendLearnedSpell(IPacketReceiver client, uint spellId)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_LEARNED_SPELL, 4))
			{
				packet.WriteUInt(spellId);
			    packet.WriteUShort(0); // 3.3.3a

				client.Send(packet);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:10,代码来源:SpellHandler.cs


示例12: SendItemNameQueryResponse

		public static void SendItemNameQueryResponse(IPacketReceiver client, ItemTemplate item)
		{
			using (var outPacket = new RealmPacketOut(RealmServerOpCode.SMSG_ITEM_NAME_QUERY_RESPONSE, 4 + item.DefaultName.Length))
			{
				outPacket.WriteInt(item.Id);
				outPacket.WriteCString(item.DefaultName);

				client.Send(outPacket);
			}
		}
开发者ID:Zerant,项目名称:WCell,代码行数:10,代码来源:ItemHandler.cs


示例13: SendAreaTriggerMessage

		public static void SendAreaTriggerMessage(IPacketReceiver client, string msg)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_AREA_TRIGGER_MESSAGE, (msg.Length * 2) + 4))
			{
				packet.WriteUIntPascalString(msg);
				packet.Write((byte)0);

				client.Send(packet);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:10,代码来源:AreaTriggerHandler.cs


示例14: SendSetAtWar

        /// <summary>
        /// Lets player know they are at war with a certain faction.
        /// </summary>
        public static void SendSetAtWar(IPacketReceiver client, Reputation rep)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SET_FACTION_ATWAR, 5))
			{
				packet.Write((int)rep.Faction.ReputationIndex);

				packet.Write((byte)rep.Flags); // rep flags

				client.Send(packet);
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:14,代码来源:FactionHandler.cs


示例15: HandleSetPvPTitle

        /*[ClientPacketHandler(RealmServerOpCode.CMSG_SET_PVP_TITLE)]
        public static void HandleSetPvPTitle(IRealmClient client, RealmPacketIn packet)
        {
        }*/


        public static void SendPVPCredit(IPacketReceiver receiver, uint points, Character victim)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PVP_CREDIT))
            {
                packet.Write(points);
                packet.Write(victim.EntityId);
                packet.Write((int)victim.PvPRank);

                receiver.Send(packet);
            }
        }
开发者ID:remixod,项目名称:netServer,代码行数:17,代码来源:HonorHandler.cs


示例16: SendSpellOrDamageImmune

		/// <summary>
		/// Correct for 3.0.9
		/// </summary>
		/// <param name="client"></param>
		/// <param name="obj1"></param>
		/// <param name="obj2"></param>
		/// <param name="spellId"></param>
		/// <param name="b1"></param>
		public static void SendSpellOrDamageImmune(IPacketReceiver client, ObjectBase obj1, ObjectBase obj2, int spellId, bool b1)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLORDAMAGE_IMMUNE, 21))
			{
				packet.Write(obj1.EntityId);
				packet.Write(obj2.EntityId);
				packet.Write(spellId);
				packet.Write(b1);

				client.Send(packet);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:20,代码来源:CombatLogHandler.cs


示例17: SendResult

        /// <summary>
        /// Sends result of actions connected with arenas
        /// </summary>
        /// <param name="client">the client to send to</param>
        /// <param name="commandId">command executed</param>
        /// <param name="name">name of player event has happened to</param>
        /// <param name="resultCode">The <see cref="ArenaTeamResult"/> result code</param>
        public static void SendResult(IPacketReceiver client, ArenaTeamCommandId commandId, string team, string player,
                                      ArenaTeamResult resultCode)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_ARENA_TEAM_COMMAND_RESULT))
            {
                packet.WriteUInt((uint)commandId);
                packet.WriteCString(team);
                packet.WriteCString(player);
                packet.WriteUInt((uint)resultCode);

                client.Send(packet);
            }
        }
开发者ID:enjoii,项目名称:WCell,代码行数:20,代码来源:ArenaTeamHandler.cs


示例18: SendRealmStateResponse

		public static void SendRealmStateResponse(IPacketReceiver client, uint realmNo)
		{
			//uint realmSplitState = 0;
			// realmNo = 0;
			const RealmState realmState = RealmState.Normal;
			var splitDate = "01/01/01";
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_REALM_SPLIT, 8 + 1 + splitDate.Length))
			{
				packet.WriteUInt(realmNo);
				packet.WriteUInt((uint)realmState);
				packet.WriteCString(splitDate);

				client.Send(packet);
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:15,代码来源:MiscHandler.cs


示例19: SendPeriodicAuraLog

		/// <summary>
		/// Used for any PeriodicAura (repeating ticks)
		/// </summary>
		/// <param name="extra">Always seems to be one</param>
		public static void SendPeriodicAuraLog(IPacketReceiver client, WorldObject caster, WorldObject target,
			uint spellId, uint extra, AuraTickFlags flags, int amount)
		{
			// TODO: Update struct for 3.0.2
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PERIODICAURALOG, 32))
			{
				caster.EntityId.WritePacked(packet);
				target.EntityId.WritePacked(packet);
				packet.WriteUInt(spellId);
				packet.WriteUInt(extra);
				packet.WriteUInt((uint)flags);
				packet.WriteUInt(amount);

				target.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:20,代码来源:CombatLogHandler.cs


示例20: SendInitWorldStates

 public static void SendInitWorldStates(IPacketReceiver rcv, MapId map, ZoneId zone, uint areaId, params WorldState[] states)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_INIT_WORLD_STATES, 300))
     {
         packet.Write((uint)map);
         packet.Write((uint)zone);
         packet.Write(areaId);
         packet.Write((ushort)states.Length);
         foreach (var state in states)
         {
             packet.Write((uint)state.Key);
             packet.Write(state.DefaultValue);
         }
         rcv.Send(packet);
     }
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:16,代码来源:WorldStateHandler.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IPadWindow类代码示例发布时间:2022-05-24
下一篇:
C# IPacketMsg类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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