本文整理汇总了C#中IPacketReceiver类的典型用法代码示例。如果您正苦于以下问题:C# IPacketReceiver类的具体用法?C# IPacketReceiver怎么用?C# IPacketReceiver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IPacketReceiver类属于命名空间,在下文中一共展示了IPacketReceiver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendAllAuras
public static void SendAllAuras(IPacketReceiver rcv, Unit owner)
{
using (var packet = CreateAllAuraPacket(owner))
{
rcv.Send(packet);
}
}
示例2: SendArenaTeamRosterResponse
public static void SendArenaTeamRosterResponse(IPacketReceiver client, ArenaTeam team)
{
using (var packet = CreateArenaTeamRosterResponsePacket(team))
{
client.Send(packet);
}
}
示例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);
}
示例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);
}
}
示例5: SendAllAuras
public static void SendAllAuras(IPacketReceiver rcv, Unit owner)
{
if (!owner.IsAreaActive) return;
using (var packet = CreateAllAuraPacket(owner))
{
rcv.Send(packet);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}