本文整理汇总了C#中Framework.Network.Packets.PacketWriter.WriteUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteUInt32方法的具体用法?C# PacketWriter.WriteUInt32怎么用?C# PacketWriter.WriteUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework.Network.Packets.PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleSendKnownSpells
public static void HandleSendKnownSpells(ref WorldClass session)
{
Character pChar = session.Character;
var specializationSpells = SpecializationMgr.GetSpecializationSpells(pChar);
var specializationSpellCount = ((specializationSpells != null) ? specializationSpells.Count : 0);
var talentSpells = SpecializationMgr.GetTalentSpells(pChar, pChar.ActiveSpecGroup);
var talentSpellCount = ((talentSpells != null) ? talentSpells.Count : 0);
int count = pChar.SpellList.Count + specializationSpellCount + talentSpellCount;
PacketWriter writer = new PacketWriter(ServerMessage.SendKnownSpells);
BitPack BitPack = new BitPack(writer);
BitPack.Write(1);
BitPack.Write(count, 22);
BitPack.Flush();
pChar.SpellList.ForEach(spell =>
writer.WriteUInt32(spell.SpellId));
if (specializationSpells != null)
specializationSpells.ForEach(spell => writer.WriteUInt32(spell.Spell));
if (talentSpells != null)
talentSpells.ForEach(spell => writer.WriteUInt32(spell));
session.Send(ref writer);
}
示例2: HandleAuthChallenge
public static void HandleAuthChallenge(ref PacketReader packet, ref WorldClass session)
{
PacketWriter authChallenge = new PacketWriter(ServerMessage.AuthChallenge, true);
for (int i = 0; i < 8; i++)
authChallenge.WriteUInt32(0);
authChallenge.WriteUInt32((uint)new Random(DateTime.Now.Second).Next(1, 0xFFFFFFF));
authChallenge.WriteUInt8(1);
session.Send(ref authChallenge);
}
示例3: HandleRealmSplitStateResponse
public static void HandleRealmSplitStateResponse(ref PacketReader packet, ref WorldClass session)
{
uint realmSplitState = 0;
PacketWriter realmSplitStateResp = new PacketWriter(LegacyMessage.RealmSplitStateResponse);
realmSplitStateResp.WriteUInt32(packet.ReadUInt32());
realmSplitStateResp.WriteUInt32(realmSplitState);
realmSplitStateResp.WriteCString("01/01/01");
session.Send(ref realmSplitStateResp);
}
示例4: SendMessageByType
public static void SendMessageByType(ref WorldClass session, MessageType type, int language, string chatMessage)
{
PacketWriter messageChat = new PacketWriter(LegacyMessage.MessageChat);
ulong guid = session.Character.Guid;
messageChat.WriteUInt8((byte)type);
messageChat.WriteInt32(language);
messageChat.WriteUInt64(guid);
messageChat.WriteUInt32(0);
messageChat.WriteUInt64(guid);
messageChat.WriteUInt32((uint)chatMessage.Length + 1);
messageChat.WriteCString(chatMessage);
messageChat.WriteUInt16(0);
session.Send(ref messageChat);
}
示例5: HandleDBQueryBulk
public static void HandleDBQueryBulk(ref PacketReader packet, ref WorldClass session)
{
var type = (DBTypes)packet.ReadUInt32();
var unknown = packet.ReadInt32();
var id = packet.ReadInt32();
switch (type)
{
case DBTypes.BroadcastText:
{
var broadCastText = GossipMgr.GetBroadCastText<Creature>(id);
PacketWriter dbReply = new PacketWriter(JAMCMessage.DBReply);
BitPack BitPack = new BitPack(dbReply);
var textLength = broadCastText.Text.Length;
var alternativeTextLength = broadCastText.AlternativeText.Length;
var size = 48;
if (textLength == 0 || alternativeTextLength == 0)
size += 1;
size += textLength + alternativeTextLength;
dbReply.WriteUInt32((uint)size);
dbReply.WriteInt32(broadCastText.Id);
dbReply.WriteInt32(broadCastText.Language);
dbReply.WriteUInt16((ushort)broadCastText.Text.Length);
dbReply.WriteString(broadCastText.Text);
dbReply.WriteUInt16((ushort)broadCastText.AlternativeText.Length);
dbReply.WriteString(broadCastText.AlternativeText);
broadCastText.Emotes.ForEach(emote => dbReply.WriteInt32(emote));
dbReply.WriteUInt32(1);
dbReply.WriteUInt32(0); // UnixTime, last change server side
dbReply.WriteUInt32((uint)DBTypes.BroadcastText);
dbReply.WriteInt32(broadCastText.Id);
session.Send(ref dbReply);
break;
}
}
}
示例6: HandleUpdateClientCacheVersion
public static void HandleUpdateClientCacheVersion(ref WorldClass session)
{
PacketWriter cacheVersion = new PacketWriter(LegacyMessage.UpdateClientCacheVersion);
cacheVersion.WriteUInt32(0);
session.Send(cacheVersion);
}
示例7: HandleTutorialFlags
public static void HandleTutorialFlags(ref WorldClass session)
{
PacketWriter tutorialFlags = new PacketWriter(LegacyMessage.TutorialFlags);
for (int i = 0; i < 8; i++)
tutorialFlags.WriteUInt32(0);
session.Send(ref tutorialFlags);
}
示例8: HandleCacheVersion
public static void HandleCacheVersion(ref WorldClass session)
{
PacketWriter cacheVersion = new PacketWriter(ServerMessage.CacheVersion);
cacheVersion.WriteUInt32(0);
session.Send(ref cacheVersion);
}
示例9: HandleMessageOfTheDay
public static void HandleMessageOfTheDay(ref WorldClass session)
{
PacketWriter motd = new PacketWriter(LegacyMessage.MessageOfTheDay);
motd.WriteUInt32(3);
motd.WriteCString("Arctium MoP test");
motd.WriteCString("Welcome to our MoP server test.");
motd.WriteCString("Your development team =)");
session.Send(ref motd);
}
示例10: HandlePong
public static void HandlePong(ref PacketReader packet, ref WorldClass session)
{
uint sequence = packet.ReadUInt32();
uint latency = packet.ReadUInt32();
PacketWriter pong = new PacketWriter(JAMCCMessage.Pong);
pong.WriteUInt32(sequence);
session.Send(pong);
}
示例11: HandleRealmSplit
public static void HandleRealmSplit(ref PacketReader packet, ref WorldClass session)
{
uint realmSplitState = 0;
var date = "01/01/01";
PacketWriter realmSplit = new PacketWriter(ServerMessage.RealmSplit);
BitPack BitPack = new BitPack(realmSplit);
BitPack.Write(date.Length, 7);
realmSplit.WriteString(date);
realmSplit.WriteUInt32(packet.Read<uint>());
realmSplit.WriteUInt32(realmSplitState);
session.Send(ref realmSplit);
// Crash!!!
// Wrong data sent...
// AddonMgr.WriteAddonData(ref session);
}
示例12: HandleRealmSplit
public static void HandleRealmSplit(ref PacketReader packet, WorldClass session)
{
uint realmSplitState = 0;
var date = "01/01/01";
PacketWriter realmSplit = new PacketWriter(ServerMessage.RealmSplit);
BitPack BitPack = new BitPack(realmSplit);
realmSplit.WriteUInt32(packet.Read<uint>());
realmSplit.WriteUInt32(realmSplitState);
BitPack.Write(date.Length, 7);
BitPack.Flush();
realmSplit.WriteString(date);
session.Send(ref realmSplit);
AddonHandler.WriteAddonData(session);
}
示例13: HandleMoveSetCanFly
public static void HandleMoveSetCanFly(ref WorldClass session)
{
PacketWriter setCanFly = new PacketWriter(JAMCMessage.MoveSetCanFly);
BitPack BitPack = new BitPack(setCanFly, session.Character.Guid);
BitPack.WriteGuidMask(7, 3, 1, 5, 0, 6, 2, 4);
BitPack.Flush();
setCanFly.WriteUInt32(0);
BitPack.WriteGuidBytes(2, 6, 7, 1, 3, 4, 6, 0);
session.Send(setCanFly);
}
示例14: HandleStartCinematic
public static void HandleStartCinematic(ref WorldClass session)
{
Character pChar = session.Character;
PacketWriter startCinematic = new PacketWriter(LegacyMessage.StartCinematic);
startCinematic.WriteUInt32(DBCStorage.RaceStorage[pChar.Race].CinematicSequence);
session.Send(ref startCinematic);
if (pChar.LoginCinematic)
DB.Characters.Execute("UPDATE characters SET loginCinematic = 0 WHERE guid = ?", pChar.Guid);
}
示例15: HandleStartCinematic
public static void HandleStartCinematic(ref WorldClass session)
{
Character pChar = session.Character;
PacketWriter startCinematic = new PacketWriter(ServerMessage.StartCinematic);
startCinematic.WriteUInt32(CliDB.ChrRaces.Single(race => race.Id == pChar.Race).CinematicSequence);
session.Send(ref startCinematic);
if (pChar.LoginCinematic)
DB.Characters.Execute("UPDATE characters SET loginCinematic = 0 WHERE guid = ?", pChar.Guid);
}