本文整理汇总了C#中FrameWork.PacketOut.WriteUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# PacketOut.WriteUInt32方法的具体用法?C# PacketOut.WriteUInt32怎么用?C# PacketOut.WriteUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameWork.PacketOut
的用法示例。
在下文中一共展示了PacketOut.WriteUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendMeTo
public override void SendMeTo(Player Plr)
{
PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC);
Out.WriteUInt16(Oid);
Out.WriteUInt16(0);
Out.WriteUInt16((UInt16)Spawn.WorldO);
Out.WriteUInt16((UInt16)Spawn.WorldZ);
Out.WriteUInt32((UInt32)Spawn.WorldX);
Out.WriteUInt32((UInt32)Spawn.WorldY);
Out.WriteUInt16((ushort)Spawn.DisplayID);
Out.WriteUInt16(Spawn.Proto.GetUnk(0));
Out.WriteUInt16(Spawn.Proto.GetUnk(1));
Out.WriteUInt16(Spawn.Proto.GetUnk(2));
Out.WriteByte(0);
Out.WriteUInt16(Spawn.Proto.GetUnk(3));
Out.Fill(0, 5);
Out.WriteUInt16(Spawn.Proto.GetUnk(4));
Out.WriteUInt16(Spawn.Proto.GetUnk(5));
Out.WriteUInt32(0);
Out.WritePascalString(Name);
Out.WriteByte(0);
Plr.SendPacket(Out);
base.SendMeTo(Plr);
}
示例2: HandlePacket
public static void HandlePacket(BaseClient client, PacketIn packet)
{
LobbyClient cclient = (LobbyClient)client;
UInt32 WorldUid = packet.GetUint32R();
string Name = packet.GetUnicodeString();
PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_CHARACTER_NAME_CHECK);
if (CheckName(Name) == 0)
{
cclient.CreateChar = new DBCharacter();
cclient.CreateChar.AcctId = cclient.Account.Id;
cclient.CreateChar.Name = Name;
if (cclient.Account.WorldId != WorldUid)
Program.CharMgr.SetAccountWorld(cclient.Account.Id, (int)WorldUid);
Out.WriteUInt32(0);
}
else
{
cclient.CreateChar = null;
Out.WriteUInt32(1);
}
cclient.SendTCP(Out);
}
示例3: F_PING
static public void F_PING(BaseClient client, PacketIn packet)
{
GameClient cclient = client as GameClient;
uint Timestamp = packet.GetUint32();
PacketOut Out = new PacketOut((byte)Opcodes.S_PONG);
Out.WriteUInt32(Timestamp);
Out.WriteUInt64((UInt64)TCPManager.GetTimeStamp());
Out.WriteUInt32((UInt32)(cclient.SequenceID+1));
Out.WriteUInt32(0);
cclient.SendPacket(Out);
}
示例4: F_CONNECT
static public void F_CONNECT(BaseClient client, PacketIn packet)
{
GameClient cclient = client as GameClient;
packet.Skip(8);
UInt32 Tag = packet.GetUint32();
string Token = packet.GetString(80);
packet.Skip(21);
string Username = packet.GetString(23);
// TODO
AuthResult Result = Program.AcctMgr.CheckToken(Username, Token);
if (Result != AuthResult.AUTH_SUCCESS)
{
Log.Error("F_CONNECT", "Invalid Token =" + Username);
cclient.Disconnect();
}
else
{
cclient._Account = Program.AcctMgr.GetAccount(Username);
if (cclient._Account == null)
{
Log.Error("F_CONNECT", "Invalid Account =" + Username);
cclient.Disconnect();
}
else
{
//Log.Success("F_CONNECT", "MeId=" + cclient.Id);
GameClient Other = (cclient.Server as TCPServer).GetClientByAccount(cclient, cclient._Account.AccountId);
if (Other != null)
Other.Disconnect();
{
PacketOut Out = new PacketOut((byte)Opcodes.S_CONNECTED);
Out.WriteUInt32(0);
Out.WriteUInt32(Tag);
Out.WriteByte(Program.Rm.RealmId);
Out.WriteUInt32(1);
Out.WritePascalString(Username);
Out.WritePascalString(Program.Rm.Name);
Out.WriteByte(0);
Out.WriteUInt16(0);
cclient.SendPacket(Out);
}
}
}
}
示例5: SendMount
public void SendMount(Player Plr)
{
PacketOut Out = new PacketOut((byte)Opcodes.F_MOUNT_UPDATE);
Out.WriteUInt16(Owner.Oid);
if (CurrentMountInfo == null)
Out.WriteUInt32(0);
else
Out.WriteUInt32(CurrentMountInfo.Entry);
Out.Fill(0, 14);
if (Plr == null)
Owner.DispatchPacket(Out, true);
else
Plr.SendPacket(Out);
}
示例6: SendTok
public void SendTok(ushort Entry, bool Print)
{
PacketOut Out = new PacketOut((byte)Opcodes.F_TOK_ENTRY_UPDATE);
Out.WriteUInt32(1);
Out.WriteUInt16((UInt16)Entry);
Out.WriteByte(1);
Out.WriteByte((byte)(Print ? 1 : 0));
Out.WriteByte(1);
GetPlayer().SendPacket(Out);
}
示例7: SendMeTo
/*
* |00 3D 71
06 90
00 00
00 00
1F E3
00 0C E3 29
00 0E 59 90
FF FF
1E 00 00 00 35 F3 00 03 04 00 00
|00 00 64 8B 76 09 CD 00 00 00 00 0F 45 6D 70 69 |..d.v.......Empi|
|72 65 20 42 61 72 20 44 6F 6F 72 04 06 AB DD 00 |re Bar Door.....|
-------------------------------------------------------------------
* */
public override void SendMeTo(Player Plr)
{
PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC);
Out.WriteUInt16(Oid);
Out.WriteUInt16(0);
Out.WriteUInt16((UInt16)Spawn.WorldO);
Out.WriteUInt16((UInt16)Spawn.WorldZ);
Out.WriteUInt32((UInt32)Spawn.WorldX);
Out.WriteUInt32((UInt32)Spawn.WorldY);
Out.WriteUInt16((ushort)Spawn.DisplayID);
Out.WriteUInt16(Spawn.GetUnk(0));
Out.WriteUInt16(Spawn.GetUnk(1));
Out.WriteUInt16(Spawn.GetUnk(2));
Out.WriteByte(Spawn.Unk1);
int flags = Spawn.GetUnk(3);
Loot Loots = LootsMgr.GenerateLoot(this, Plr);
if (Loots != null && Loots.IsLootable())
{
flags = flags | 4;
}
Out.WriteUInt16((ushort)flags);
Out.WriteByte(Spawn.Unk2);
Out.WriteUInt32(Spawn.Unk3);
Out.WriteUInt16(Spawn.GetUnk(4));
Out.WriteUInt16(Spawn.GetUnk(5));
Out.WriteUInt32(Spawn.Unk4);
Out.WritePascalString(Name);
Out.WriteByte(0);
Plr.SendPacket(Out);
base.SendMeTo(Plr);
}
示例8: SendReinitTime
public void SendReinitTime(Player Plr, ushort Time)
{
PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_INFO);
Out.WriteUInt32(Info.Entry);
Out.WriteByte(1);
Out.WriteByte(2);
Out.WriteByte(1);
Out.WriteUInt16(0);
Out.WritePascalString(Info.Name);
Out.WriteUInt16(0);
Out.WriteUInt16(Time); // Time in seconds
Out.WriteUInt16(0);
Out.WriteUInt16(0);
Plr.SendPacket(Out);
}
示例9: CL_INFO
public static void CL_INFO(BaseClient client, PacketIn packet)
{
Client cclient = client as Client;
if (cclient.LastInfoRequest == 0 || cclient.LastInfoRequest <= TCPServer.GetTimeStampMS()+10000)
{
cclient.LastInfoRequest = TCPServer.GetTimeStampMS();
List<Realm> Rms = Program.AcctMgr.GetRealms();
PacketOut Out = new PacketOut((byte)Opcodes.LCR_INFO);
Out.WriteByte((byte)Rms.Count);
foreach (Realm Rm in Rms)
{
Out.WriteByte(Convert.ToByte(Rm.Info != null));
Out.WriteString(Rm.Name);
Out.WriteUInt32(Rm.OnlinePlayers);
Out.WriteUInt32(Rm.OrderCount);
Out.WriteUInt32(Rm.DestructionCount);
}
cclient.SendTCP(Out);
}
}
示例10: BuildPlayerInfo
public static void BuildPlayerInfo(ref PacketOut Out,uint CharId, string Name, bool Online, byte Level, UInt16 Career, UInt16 Zone)
{
Out.WriteUInt32(CharId);
Out.WriteByte(0);
Out.WritePascalString(Name);
Out.WriteByte(0);
Out.WriteByte((byte)(Online ? 1 : 0));
Out.WriteByte((byte)(Online ? 1 : 0));
if (!Online)
return;
Out.WriteByte(Level);
Out.WriteUInt16(0);
Out.WriteUInt16(Career);
Out.WriteUInt16(Zone);
Out.WriteUInt16(1); // Guild Size
Out.WriteByte(0);
}
示例11: SendLevelUp
public void SendLevelUp(Dictionary<byte, UInt16> Diff)
{
SendRankUpdate(null);
PacketOut Out = new PacketOut((byte)Opcodes.F_PLAYER_LEVEL_UP);
Out.WriteUInt32(0);
Out.WriteByte((byte)Diff.Count);
foreach (KeyValuePair<byte, UInt16> Stat in Diff)
{
Out.WriteByte(Stat.Key);
Out.WriteUInt16(Stat.Value);
}
SendPacket(Out);
}
示例12: SendBuyBack
public void SendBuyBack()
{
if (!HasPlayer())
return;
Player Plr = GetPlayer();
PacketOut Out = new PacketOut((byte)Opcodes.F_STORE_BUY_BACK);
Out.WriteByte((byte)BuyBack.Count); // Count
for (int i = BuyBack.Count - 1; i >= 0; --i)
{
Out.WriteUInt32(BuyBack[i].Info.SellPrice);
Item.BuildItem(ref Out, BuyBack[i], null, 0, 0);
}
Out.WriteByte(0);
Plr.SendPacket(Out);
}
示例13: BuildItem
static public void BuildItem(ref PacketOut Out,Item Itm,Item_Info Info,ushort SlotId,ushort Count)
{
SlotId = SlotId == 0 ? (Itm == null ? SlotId : Itm.SlotId ) : SlotId;
Count = Count == 0 ? (Itm == null ? Count : Itm.Count) : Count;
Info = Info == null ? (Itm == null ? null : Itm.Info) : Info;
if(SlotId != 0)
Out.WriteUInt16(SlotId);
Out.WriteByte(0);
Out.WriteUInt32((uint)(Info != null ? Info.Entry : 0));
if (Info == null)
return;
Out.WriteUInt16((ushort)Info.ModelId); // Valid 1.4.8
Out.Fill(0, 7); // Valid 1.4.8
Out.WriteUInt16(Info.SlotId); // Valid 1.4.8
Out.WriteByte(Info.Type); // Valid 1.4.8
Out.WriteByte(Info.MinRank); // Min Level
Out.WriteByte(Info.ObjectLevel); // 1.3.5, Object Level
Out.WriteByte(Info.MinRenown); // 1.3.5, Min Renown
Out.WriteByte(Info.MinRenown); // ?
Out.WriteByte(Info.UniqueEquiped); // Unique - Equiped
Out.WriteByte(Info.Rarity);
Out.WriteByte(Info.Bind);
Out.WriteByte(Info.Race);
// Trophys have some extra bytes
if (Info.Type == (byte)GameData.ItemTypes.ITEMTYPES_TROPHY)
{
Out.WriteUInt32(0);
Out.WriteUInt16(0x0080);
}
Out.WriteUInt32(Info.Career);
Out.WriteUInt32(0);
Out.WriteUInt32(Info.SellPrice);
Out.WriteUInt16((UInt16)(Count > 0 ? Count : 1));
Out.WriteUInt16((UInt16)(Count > 0 ? Count : 1));
Out.WriteUInt32(0);
Out.WriteUInt32(Info.Skills); // Valid 1.4.8
Out.WriteUInt16(Info.Dps > 0 ? Info.Dps : Info.Armor); // Valid 1.4.8
Out.WriteUInt16(Info.Speed); // Valid 1.4.8
Out.WritePascalString(Info.Name); // Valid 1.4.8
Out.WriteByte((byte)Info._Stats.Count); // Valid 1.4.8
foreach (KeyValuePair<byte, UInt16> Key in Info._Stats)
{
Out.WriteByte(Key.Key);
Out.WriteUInt16(Key.Value);
Out.Fill(0, 5);
}
Out.WriteByte(0); // Equip Effects
Out.WriteByte((byte)Info._Spells.Count); // OK
foreach (KeyValuePair<UInt32, UInt32> Kp in Info._Spells)
{
Out.WriteUInt32(Kp.Key);
Out.WriteUInt32(Kp.Value);
}
// (uint32)Entry, uint16 X, uint16 Y
Out.WriteByte((byte)Info._Crafts.Count); // OK
foreach (KeyValuePair<byte, ushort> Kp in Info._Crafts)
{
Out.WriteByte(Kp.Key);
Out.WriteUInt16(Kp.Value);
}
Out.WriteByte(0); // ??
Out.WriteByte(Info.TalismanSlots);
Item_Info TalismanInfo = null;
for (int i = 0; i < Info.TalismanSlots; ++i)
{
if (Itm != null)
TalismanInfo = Itm.GetTalisman((byte)i);
if (TalismanInfo == null)
Out.WriteUInt32(0); // Entry;
else
{
Out.WriteUInt32(TalismanInfo.Entry);
Out.WritePascalString(TalismanInfo.Name);
Out.Fill(0, 15);
}
}
Out.WritePascalString(Info.Description);
Out.Write(Info.Unk27);
//.........这里部分代码省略.........
示例14: BuildCharacters
public static byte[] BuildCharacters(int AccountId)
{
Log.Debug("BuildCharacters", "AcocuntId = " + AccountId);
Character[] Chars = GetAccountChar(AccountId)._Chars;
UInt16 Count = 0;
// On Compte le nombre de personnages existant du joueur
for (UInt16 c = 0; c < Chars.Length; ++c)
if (Chars[c] != null) ++Count;
PacketOut Out = new PacketOut(0);
Out.Position = 0;
Out.WriteByte(MAX_SLOT);
Out.WriteUInt32(0xFF);
Out.WriteByte(0x14);
Character Char = null;
for (int i = 0; i < MAX_SLOT; ++i)
{
Char = Chars[i];
if (Char == null)
Out.Fill(0, 284); // 284
else
{
List<Character_item> Items = CharMgr.GetItemChar(Char.CharacterId);
Out.FillString(Char.Name, 48);
Out.WriteByte(Char.Value.Level);
Out.WriteByte(Char.Career);
Out.WriteByte(Char.Realm);
Out.WriteByte(Char.Sex);
Out.WriteByte(Char.ModelId);
Out.WriteUInt16(Char.Value.ZoneId);
Out.Fill(0, 5);
Character_item Item = null;
for (UInt16 SlotId = 14; SlotId < 30; ++SlotId)
{
Item = Items.Find(item => item != null && item.SlotId == SlotId);
if (Item == null)
Out.WriteUInt32(0);
else
Out.WriteUInt32R(Item.ModelId);
Out.Fill(0, 4);
}
Out.Fill(0, 6);
for (int j = 0; j < 5; ++j)
{
Out.Fill(0, 6);
Out.WriteUInt16(0xFF00);
}
for (UInt16 SlotId = 10; SlotId < 13; ++SlotId)
{
Item = Items.Find(item => item != null && item.SlotId == SlotId);
Out.WriteUInt16(0);
if (Item == null)
Out.WriteUInt16(0);
else
Out.WriteUInt16R((ushort)Item.ModelId);
}
Out.Fill(0, 10);
Out.WriteUInt16(0xFF00);
Out.WriteByte(0);
Out.WriteByte(Char.Race);
Out.WriteUInt16(0);
Out.Write(Char.bTraits, 0, Char.bTraits.Length);
Out.Fill(0, 14);// 272
}
}
return Out.ToArray();
}
示例15: SendTradeInfo
public void SendTradeInfo(ItemsInterface DistInterface)
{
PacketOut Out = new PacketOut((byte)Opcodes.F_TRADE_STATUS);
Out.WriteByte(DistInterface.TradingAccepted);
Out.WriteByte(0);
Out.WriteUInt16(DistInterface != this ? DistInterface._Owner.Oid : (ushort)0);
if (DistInterface.TradingAccepted == 2)
Out.Fill(0, 24);
else
{
Out.WriteUInt32(DistInterface.TradingMoney);
Out.WriteByte(TradingUpdate);
Out.Fill(0, 2 * MAX_TRADE_SLOT);
}
_Owner.GetPlayer().SendPacket(Out);
}