本文整理汇总了C#中RealmPacketOut.Write方法的典型用法代码示例。如果您正苦于以下问题:C# RealmPacketOut.Write方法的具体用法?C# RealmPacketOut.Write怎么用?C# RealmPacketOut.Write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealmPacketOut
的用法示例。
在下文中一共展示了RealmPacketOut.Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendCustomAnim
public void SendCustomAnim(uint anim)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GAMEOBJECT_CUSTOM_ANIM, 12))
{
packet.Write(EntityId);
packet.Write(anim);
SendPacketToArea(packet);
}
}
示例2: 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);
}
}
示例3: SendClearQuery
/// <summary>
/// Sends a request to wipe all talents, which must be confirmed by the player
/// </summary>
public static void SendClearQuery(TalentCollection talents)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_TALENT_WIPE_CONFIRM, 12))
{
packet.Write(talents.Owner.EntityId);
packet.Write(talents.GetResetPrice());
talents.OwnerCharacter.Send(packet);
}
}
示例4: SendClearQuery
/// <summary>
/// Sends a request to wipe all talents, which must be confirmed by the player
/// </summary>
public static void SendClearQuery(IHasTalents thing)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_TALENT_WIPE_CONFIRM, 12))
{
packet.Write(thing.EntityId);
packet.Write(thing.Talents.ResetAllPrice);
thing.Client.Send(packet);
}
}
示例5: SendCombatStart
public static void SendCombatStart(Unit unit, Unit opponent, bool includeSelf)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_ATTACKSTART, 16))
{
packet.Write(unit.EntityId);
packet.Write(opponent.EntityId);
unit.SendPacketToArea(packet, includeSelf);
}
}
示例6: 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);
}
}
示例7: 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);
}
}
示例8: SendWinner
public static void SendWinner(DuelWin win, Unit winner, INamed loser)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_WINNER))
{
packet.Write((byte)win);
packet.Write(winner.Name);
packet.Write(loser.Name);
winner.SendPacketToArea(packet);
}
}
示例9: SendRequest
public static void SendRequest(GameObject duelFlag, Character challenger, Character rival)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_REQUESTED))
{
packet.Write(duelFlag.EntityId);
packet.Write(challenger.EntityId);
rival.Client.Send(packet);
challenger.Client.Send(packet);
}
}
示例10: SendAchievmentStatus
// SMSG_CRITERIA_UPDATE
public static void SendAchievmentStatus(AchievementProgressRecord achievementProgressRecord, Character chr)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_CRITERIA_UPDATE, 4*5+8*2))
{
packet.WriteUInt((uint)achievementProgressRecord.AchievementCriteriaId);
packet.WritePackedUInt64(achievementProgressRecord.Counter); // amount
chr.EntityId.WritePacked(packet);
packet.Write(0);
packet.WriteDateTime(DateTime.Now); // start time?
packet.Write(0); // Duration
packet.Write(0); // Duration left
chr.Client.Send(packet);
}
}
示例11: CreateAchievementEarnedToGuild
public static RealmPacketOut CreateAchievementEarnedToGuild(AchievementEntryId achievementEntryId, Character chr)
{
// Must be a better way to do this.
const string msg = "|Hplayer:$N|h[$N]|h has earned the achievement $a!";
var packet = new RealmPacketOut(RealmServerOpCode.SMSG_MESSAGECHAT);
packet.WriteByte((byte) ChatMsgType.Achievment);
packet.WriteUInt((uint) ChatLanguage.Universal);
packet.Write(chr.EntityId);
packet.WriteUInt(5);
packet.Write(chr.EntityId);
packet.WriteUIntPascalString(msg);
packet.WriteByte(0);
packet.WriteUInt((uint) achievementEntryId);
return packet;
}
示例12: 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);
}
}
示例13: 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);
}
}
示例14: GetMail
public void GetMail(TestCharacter getter)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.CMSG_GET_MAIL_LIST))
{
packet.Write(EntityId.Zero);
getter.FakeClient.ReceiveCMSG(packet, true);
}
}
示例15: 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);
}
}