本文整理汇总了C#中Framework.Network.Packets.PacketWriter.WriteGuid方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteGuid方法的具体用法?C# PacketWriter.WriteGuid怎么用?C# PacketWriter.WriteGuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework.Network.Packets.PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteGuid方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleUpdateObject
public static void HandleUpdateObject(ref PacketReader packet, ref WorldClass session)
{
Character character = session.Character;
PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1); // Grml sandbox style...
updateObject.WriteUInt8(1);
updateObject.WriteGuid(character.Guid);
updateObject.WriteUInt8(4);
UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self | UpdateFlag.Unknown4;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
character.WriteUpdateFields(ref updateObject);
session.Send(updateObject);
}
示例2: HandleUpdateObjectCreate
public static void HandleUpdateObjectCreate(ref WorldClass session)
{
WorldObject character = session.Character;
PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8((byte)UpdateType.CreateObject);
updateObject.WriteGuid(character.Guid);
updateObject.WriteUInt8((byte)ObjectType.Player);
UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
session.Send(ref updateObject);
}
示例3: HandleNameCache
public static void HandleNameCache(ref PacketReader packet, ref WorldClass session)
{
Character pChar = session.Character;
ulong guid = packet.ReadUInt64();
uint realmId = packet.ReadUInt32();
PacketWriter nameCache = new PacketWriter(LegacyMessage.NameCache);
nameCache.WriteGuid(guid);
nameCache.WriteUInt8(0);
nameCache.WriteCString(pChar.Name);
nameCache.WriteUInt32(realmId);
nameCache.WriteUInt8(pChar.Race);
nameCache.WriteUInt8(pChar.Gender);
nameCache.WriteUInt8(pChar.Class);
nameCache.WriteUInt8(0);
session.Send(nameCache);
}
示例4: HandleUpdateObjectValues
public static void HandleUpdateObjectValues(ref WorldClass session)
{
WorldObject character = session.Character;
PacketWriter updateObject = new PacketWriter(ServerMessage.ObjectUpdate);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8((byte)UpdateType.Values);
updateObject.WriteGuid(character.Guid);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
session.Send(ref updateObject);
}
示例5: HandleUpdateObjectCreate
public static void HandleUpdateObjectCreate(ref WorldClass session)
{
WorldObject character = session.Character;
PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8((byte)UpdateType.CreateObject);
updateObject.WriteGuid(character.Guid);
updateObject.WriteUInt8((byte)ObjectType.Player);
UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
session.Send(ref updateObject);
var tempSessions = new Dictionary<ulong, WorldClass>(WorldMgr.Sessions);
tempSessions.Remove(character.Guid);
if (tempSessions != null)
{
foreach (var s in tempSessions)
{
if (s.Value.Character.CheckUpdateDistance(character))
{
updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8((byte)UpdateType.CreateObject);
updateObject.WriteGuid(character.Guid);
updateObject.WriteUInt8((byte)ObjectType.Player);
updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
s.Value.Send(ref updateObject);
}
}
foreach (var s in tempSessions)
{
WorldObject pChar = s.Value.Character;
if (character.CheckUpdateDistance(pChar))
{
character.ToCharacter().InRangeObjects.Add(pChar.Guid, pChar);
updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)pChar.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8((byte)UpdateType.CreateObject);
updateObject.WriteGuid(pChar.Guid);
updateObject.WriteUInt8((byte)ObjectType.Player);
updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref pChar, updateFlags);
pChar.WriteUpdateFields(ref updateObject);
pChar.WriteDynamicUpdateFields(ref updateObject);
session.Send(ref updateObject);
}
}
}
}
示例6: HandleUpdateObject
public static void HandleUpdateObject(ref WorldClass session)
{
WorldObject character = session.Character;
PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8(1);
updateObject.WriteGuid(character.Guid);
updateObject.WriteUInt8(4);
UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
session.Send(ref updateObject);
var tempSessions = new Dictionary<ulong, WorldClass>(WorldMgr.Sessions);
tempSessions.Remove(character.Guid);
if (tempSessions != null)
{
foreach (var s in tempSessions)
{
if (character.Map != s.Value.Character.Map)
continue;
updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8(1);
updateObject.WriteGuid(character.Guid);
updateObject.WriteUInt8(4);
updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
s.Value.Send(ref updateObject);
}
foreach (var s in tempSessions)
{
WorldObject pChar = s.Value.Character;
if (pChar.Map != character.Map)
continue;
updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)pChar.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8(1);
updateObject.WriteGuid(pChar.Guid);
updateObject.WriteUInt8(4);
updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref pChar, updateFlags);
pChar.WriteUpdateFields(ref updateObject);
pChar.WriteDynamicUpdateFields(ref updateObject);
session.Send(ref updateObject);
}
}
character.AddCreatureSpawnsToWorld(ref session);
character.AddGameObjectSpawnsToWorld(ref session);
}
示例7: AddToWorld
public void AddToWorld()
{
CreateFullGuid();
CreateData(GameObject);
Globals.SpawnMgr.AddSpawn(this, ref GameObject);
SetGameObjectFields();
WorldObject obj = this;
UpdateFlag updateFlags = UpdateFlag.Rotation | UpdateFlag.StationaryPosition;
foreach (var v in Globals.WorldMgr.Sessions)
{
Character pChar = v.Value.Character;
if (pChar.CheckUpdateDistance(this))
{
PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8(1);
updateObject.WriteGuid(Guid);
updateObject.WriteUInt8(5);
Globals.WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref obj, updateFlags);
WriteUpdateFields(ref updateObject);
WriteDynamicUpdateFields(ref updateObject);
v.Value.Send(ref updateObject);
}
}
}
示例8: HandleNameCache
public static void HandleNameCache(ref PacketReader packet, ref WorldClass session)
{
ulong guid = packet.ReadUInt64();
uint realmId = packet.ReadUInt32();
var pSession = WorldMgr.GetSession(guid);
if (pSession != null)
{
var pChar = pSession.Character;
if (pChar != null)
{
PacketWriter nameCache = new PacketWriter(LegacyMessage.NameCache);
nameCache.WriteGuid(guid);
nameCache.WriteUInt8(0);
nameCache.WriteCString(pChar.Name);
nameCache.WriteUInt32(realmId);
nameCache.WriteUInt8(pChar.Race);
nameCache.WriteUInt8(pChar.Gender);
nameCache.WriteUInt8(pChar.Class);
nameCache.WriteUInt8(0);
session.Send(ref nameCache);
}
}
}
示例9: AddToWorld
public void AddToWorld()
{
CreateFullGuid();
CreateData(Creature);
Globals.SpawnMgr.AddSpawn(this, ref Creature);
SetCreatureFields();
WorldObject obj = this;
UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
foreach (var v in Globals.WorldMgr.Sessions)
{
Character pChar = v.Value.Character;
if (pChar.Map != Map)
continue;
PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8(1);
updateObject.WriteGuid(Guid);
updateObject.WriteUInt8(3);
Globals.WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref obj, updateFlags);
WriteUpdateFields(ref updateObject);
WriteDynamicUpdateFields(ref updateObject);
v.Value.Send(ref updateObject);
}
}
示例10: HandleUpdateObjectValues
public static void HandleUpdateObjectValues(ref WorldClass session, bool broadcast = false, bool toself = true)
{
WorldObject character = session.Character;
PacketWriter updateObject = new PacketWriter(ServerMessage.ObjectUpdate);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8((byte)UpdateType.Values);
updateObject.WriteGuid(character.Guid);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
if (toself)
session.Send(ref updateObject);
if (broadcast)
WorldMgr.SendToInRangeCharacter(character as Character, updateObject);
}
示例11: HandleUpdateObject
public static void HandleUpdateObject(ref WorldClass session)
{
Character character = session.Character;
PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8(1);
updateObject.WriteGuid(character.Guid);
updateObject.WriteUInt8(4);
UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
session.Send(updateObject);
var tempSession = WorldMgr.Sessions;
tempSession.Remove(character.Guid);
foreach (var s in tempSession)
{
if (character.Zone != s.Value.Character.Zone)
continue;
updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8(1);
updateObject.WriteGuid(character.Guid);
updateObject.WriteUInt8(4);
updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
s.Value.Send(updateObject);
}
foreach (var s in tempSession)
{
character = s.Value.Character;
if (character.Zone != session.Character.Zone)
continue;
updateObject = new PacketWriter(LegacyMessage.UpdateObject);
updateObject.WriteUInt16((ushort)character.Map);
updateObject.WriteUInt32(1);
updateObject.WriteUInt8(1);
updateObject.WriteGuid(character.Guid);
updateObject.WriteUInt8(4);
updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
character.WriteUpdateFields(ref updateObject);
character.WriteDynamicUpdateFields(ref updateObject);
session.Send(updateObject);
}
}