本文整理汇总了C#中IPacketReceiver.Send方法的典型用法代码示例。如果您正苦于以下问题:C# IPacketReceiver.Send方法的具体用法?C# IPacketReceiver.Send怎么用?C# IPacketReceiver.Send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPacketReceiver
的用法示例。
在下文中一共展示了IPacketReceiver.Send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendArenaTeamQueryResponse
/// <summary>
/// Sends an arena team query response to the client.
/// </summary>
/// <param name="client">the client to send to</param>
/// <param name="team">arena team to be sent</param>
public static void SendArenaTeamQueryResponse(IPacketReceiver client, ArenaTeam team)
{
using (var packet = CreateArenaTeamQueryResponsePacket(team))
{
client.Send(packet);
}
using (var packet = CreateArenaTeamStatsResponsePacket(team))
{
client.Send(packet);
}
}
示例2: SendAllAuras
public static void SendAllAuras(IPacketReceiver rcv, Unit owner)
{
using (var packet = CreateAllAuraPacket(owner))
{
rcv.Send(packet);
}
}
示例3: 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);
}
}
示例4: 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);
}
}
示例5: SendAllAuras
public static void SendAllAuras(IPacketReceiver rcv, Unit owner)
{
if (!owner.IsAreaActive) return;
using (var packet = CreateAllAuraPacket(owner))
{
rcv.Send(packet);
}
}
示例6: 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);
}
}
示例7: 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);
}
}
示例8: 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);
}
}
示例9: 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);
}
}
示例10: 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);
}
}
示例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: 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);
}
}
示例13: 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);
}
}
示例14: 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);
}
}
示例15: 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);
}
}