本文整理汇总了C#中Packet.WriteInt方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteInt方法的具体用法?C# Packet.WriteInt怎么用?C# Packet.WriteInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.WriteInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConnectData
public void ConnectData(Packet pPacket)
{
long v5 = CRand32__Random();
long s2 = CRand32__Random();
long v6 = CRand32__Random();
CRand32__Seed(v5, s2, v6);
pPacket.WriteInt((int)v5);
pPacket.WriteInt((int)s2);
pPacket.WriteInt((int)v6);
}
示例2: SpawnMonster
public static Packet SpawnMonster(Mob pMob, int pSpawnType, int pLink, bool pAzwan)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Monster_Spawn);
p.WriteInt(pMob.SpawnID);
p.WriteByte(1);
p.WriteInt(pMob.MobID);
MobPacketHelper.AddMonsterStatus(p, pMob);
p.WriteShort(pMob.Position.X);
p.WriteShort(pMob.Position.Y);
p.WriteByte(pMob.Stance); // Stance, TODO.
p.WriteShort(pMob.Foothold);
p.WriteShort(pMob.OriginalFoothold);
p.WriteByte((byte)pSpawnType);
if (pSpawnType == -3 || pSpawnType >= 0)
p.WriteInt(pLink);
p.WriteByte(0); // TODO: Carnival.
p.WriteInt(125);
p.WriteZero(16);
p.WriteByte(0);
p.WriteInt(-1);
p.WriteInt(0);
p.WriteInt(46);
p.WriteInt(0);
p.WriteByte(0);
p.WriteByte(0xFF);
return p;
}
示例3: HeartbeatResponse
public static Packet HeartbeatResponse(int pRequest)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Heartbeat_Response);
p.WriteInt(Tools.HeartbeatAlgorithm(pRequest));
return p;
}
示例4: AddCharacterImage
public static void AddCharacterImage(Packet pPacket, Character pCharacter, bool pRanked, bool pViewAll)
{
AddCharacterStats(pPacket, pCharacter);
AddCharacterLooks(pPacket, pCharacter, true);
if (!pViewAll)
pPacket.WriteByte(0);
pPacket.WriteByte((byte)(pRanked ? 1 : 0));
if (pRanked)
{
//TODO: Ranking Stats.
pPacket.WriteInt(100);
pPacket.WriteInt(100);
pPacket.WriteInt(200);
pPacket.WriteInt(200);
}
}
示例5: Login
public static Packet Login(Client pClient, long pSessionId)
{
Packet p = new Packet();
p.WriteByte((byte)SendOpcodes.Login_Status);
p.WriteByte(0);
p.WriteByte(0);
p.WriteInt(0);
p.WriteInt(pClient.Account.Id);
p.WriteByte(0);
p.WriteBool(false); // TODO: Admin.
p.WriteByte(1);
p.WriteMapleString(pClient.Account.Username);
p.WriteInt(0);
p.WriteInt(0);
p.WriteInt(0);
return p;
}
示例6: Cash_Shop_Enter
public static Packet Cash_Shop_Enter(Client pClient)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Cash_Shop_Enter);
HelpPacket.AddCharacterInformation(p, pClient.Character);
p.WriteLong(1);
p.WriteInt(0);
p.WriteHexString("67 00 20 00 74 00 68 00 65 00 20 00 73 00 6B 00 69 00 6C 00 6C 00 2C 00 20 00 74 00 68 00 65 00 20 00 6E 00 65 00 61 00 72 00 62 00 79 00 20 00 70 00 72 00 65 00 73 00 65 00 74 00 2D 00 75 00 70 00 20 00 50 00 6F 00 69 00 73 00 6F 00 6E 00 20 00 4D 00 69 00 73 00 74 00 73 00 20 00 65 00 78 00 70 00 6C 00 6F 00 64 00 65 00 2C 00 20 00 64 00 65 00 61 00 6C 00 69 00 6E 00 67 00 20 00 66 00 61 00 74 00 61 00 6C 00 20 00 64 00 61 00 6D 00 61 00 67 00 65 00 20 00 74 00 6F 00 20 00 65 00 6E 00 65 00 6D 00 69 00 65 00 73 00 2E 00 20 00 54 00 68 00 65 00 20 00 64 00 61 00 6D 00 61 00 67 00 65 00 20 00 77 00 69 00 6C 00 6C 00 20 00 69 00 6E 00 63 00 72 00 65 00 61 00 73 00 65 00 20 00 70 00 72 00 6F 00 70 00 6F 00 72 00 74 00 69 00 6F 00 6E 00 61 00 74 00 65 00 20 00 74 00 6F 00 20 00 74 00 68 00 65 00 20 00 6E 00 75 00 6D 00 62 00 65 00 72 00 20 00 6F 00 66 00 20 00 63 00 6F 00 6E 00 74 00 69 00 6E 00 75 00 6F 00 75 00 73 00 20 00 64 00 61 00 6D 00 61 00 67 00 65 00 20 00 65 00 66 00 66 00 65 00 63 00 74 00 73 00 20 00 61 00 70 00 70 00 6C 00 69 00 65 00 64 00 20 00 74 00 6F 00 20 00 74 00 68 00 65 00 20 00 74 00 61 00 72 00 67 00 65 00 74 00 2E 00 20 00 59 00 6F 00 75 00 20 00 63 00 61 00 6E 00 6E 00 6F 00 74 00 20 00 64 00 65 00 74 00 6F 00 6E 00 61 00 74 00 65 00 20 00 4D 00 69 00 73 00 74 00 73 00 20 00 73 00 65 00 74 00 2D 00 75 00 70 00 20 00 62 00 79 00 20 00 6F 00 74 00 68 00 65 00 72 00 73 00 2E 00 20 00 54 00 68 00 65 00 20 00 64 00 61 00 6D 00 61 00 67 00 65 00 20 00 62 00 6F 00 6F 00 73 00 74 00 20 00 61 00 70 00 70 00 6C 00 69 00 65 00 73 00 20 00 75 00 70 00 20 00 74 00 6F 00 20 00 74 00 68 00 65 00 20 00 35 00 74 00 68 00 20 00 65 00 66 00 66 00 65 00 63 00 74 00 2E 00 5C 00 6E 00 52 00 65 00 71 00 75 00 69 00 72 00 65 00 64 00 20 00 53 00 6B 00 69 00 6C 00 6C 00 3A 00 20 00 23 00 63 00 50 00 6F 00 69 00 73 00 6F 00 6E 00 20 00 4D 00 69 00 73 00 74 00 20 00 4C 00 76 00 2E 00 20 00 32 00 30 00 23 00 00 00 49 00 01 48 98 15 5D 0E 34 02 00 00 4D 00 50 00 20 00 43 00 6F 00 73 00 74 00 3A 00 20 00 23 00 6D 00 70 00 43 00 6F 00 6E 00 2C 00 20 00 44 00 61 00 6D 00 61 00 67 00 65 00 3A 00 20 00 23 00 64 00 61 00 6D 00 61 00 67 00 65 00 25 00 2C 00 20 00 4D 00 61 00 78 00 20 00 45 00 6E 00 65 00 6D 00 69 00 65 00 73 00 20 00 48 00 69 00 74 00 3A 00 20 00 23 00 6D 00 6F 00 62 00 43 00 6F 00 75 00 6E 00 74 00 2C 00 20 00 4E 00 75 00 6D 00 62 00 65 00 72 00 20 00 6F 00 66 00 20 00 41 00 74 00 74 00 61 00 63 00 6B 00 73 00 3A 00 20 00 23 00 61 00 74 00 74 00 61 00 63 00 6B 00 43 00 6F 00 75 00 6E 00 74 00 2C 00 20 00 44 00 61 00 6D 00 61 00 67 00 65 00 20 00 4F 00 76 00 65 00 72 00 20 00 54 00 69 00 6D 00 65 00 3A 00 20 00 23 00 64 00 6F 00 74 00 25 00 20 00 64 00 61 00 6D 00 61 00 67 00 65 00 20 00 65 00 76 00 65 00 72 00 79 00 20 00 23 00 64 00 6F 00 74 00 49 00 6E 00 74 00 65 00 72 00 76 00 61 00 6C 00 20 00 73 00 65 00 63 00 20 00 66 00 6F 00 72 00 20 00 23 00 64 00 6F 00 74 00 54 00 69 00 6D 00 65 00 20 00 73 00 65 00 63 00 2C 00 20 00 46 00 72 00 65 00 65 00 7A 00 65 00 20 00 43 00 68 00 61 00 6E 00 63 00 65 00 3A 00 20 00 23 00 68 00 63 00 50 00 72 00 6F 00 70 00 25 00 2C 00 20 00 46 00 72 00 65 00 65 00 7A 00 65 00 20 00 44 00 75 00 72 00 61 00 74 00 69 00 6F 00 6E 00 3A 00 20 00 00 00 00 00 00 00 00 A1 00 00 00 00 10 57 68 63 2B B8 CE 01");
return p;
}
示例7: Cash_Shop_Inventory
public static Packet Cash_Shop_Inventory(Client pClient)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Cash_Shop_Opeartion);
p.WriteByte((byte)(Opeartion_Code + 3));
p.WriteByte(0);
p.WriteShort(0);
p.WriteInt(0);
p.WriteShort(16); // Slots
p.WriteShort(6);
p.WriteShort(0);
p.WriteShort(1);
return p;
}
示例8: BeginMove
public static void BeginMove(Packet packet, Player player)
{
int GameCoord = packet.ReadInt( );
Point Pos = Data.GetReallyCoord(player.CharData.Map, GameCoord);
NPC NPCData = NPCs.IsNPC(player, Pos);
if (NPCData != null)
{
#region Response (NPC)
Packet Response = new Packet(0x0252);
Response.WriteByte(1);
Response.WriteUShort(NPCData.Type);
player.Sock.Send(Response);
#endregion
}
else
{
#region Response (Move)
Packet Response = new Packet(0x0122);
Response.WriteInt(GameCoord); // Coord
Response.WriteUShort(player.CharData.MovingSpeed); // Speed
Response.WriteByte(1); // Flag
player.Sock.Send(Response);
#endregion
#region Others
Packet Others = new Packet(0x0123);
Others.WriteULong(player.ID);
Others.WriteInt(GameCoord);
Others.WriteUShort(1); // Speed
int MapIndex = Maps.MapsData.Find(player.CharData.Map);
if (MapIndex != -1)
{
foreach (Player x in Maps.MapsData[MapIndex].Players)
{
if (x.ID != player.ID)
x.Sock.Send(Others);
}
}
#endregion
}
}
示例9: PlayerChat
public static Packet PlayerChat(int pCharacterId, string pMessage, bool pWhiteBackground, byte pShow)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Player_Chat);
p.WriteInt(pCharacterId);
p.WriteBool(pWhiteBackground);
p.WriteMapleString(pMessage);
p.WriteByte(pShow);
return p;
}
示例10: EnterField
public static Packet EnterField(Character pCharacter)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Field_Enter);
p.WriteShort(2);
p.WriteLong(1);
p.WriteLong(2);
p.WriteLong(pCharacter.Client.Channel);
p.WriteByte(pCharacter.PortalCount);
p.WriteByte(2);
p.WriteBytes(new byte[8]);
p.WriteInt(pCharacter.MapId);
p.WriteByte(pCharacter.MapPosition);
p.WriteInt(pCharacter.HP);
p.WriteByte(0);
p.WriteLong(Tools.GetTime(Tools.CurrentTimeMillis()));
p.WriteInt(100);
p.WriteShort(0);
p.WriteByte(1);
return p;
}
示例11: EnterFieldNew
public static Packet EnterFieldNew(Character pCharacter)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Field_Enter);
p.WriteShort(2);
p.WriteLong(1L);
p.WriteLong(2L);
p.WriteLong(pCharacter.Client.Channel);
p.WriteByte(0);
p.WriteByte(1);
p.WriteInt(0);
p.WriteByte(1);
p.WriteShort(0);
PlayerRandomStream PRS = new PlayerRandomStream();
PRS.ConnectData(p);
HelpPacket.AddCharacterInformation(p, pCharacter);
p.WriteInt(0);
p.WriteLong(Tools.GetTime(Tools.CurrentTimeMillis()));
p.WriteInt(100);
p.WriteShort(0);
p.WriteByte(1);
return p;
}
示例12: CharacterLeave
public static Packet CharacterLeave(int pCharacterId)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Player_Despawn);
p.WriteInt(pCharacterId);
return p;
}
示例13: CharacterEnter
public static Packet CharacterEnter(Character pCharacter)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Player_Spawn);
p.WriteInt(pCharacter.Id);
p.WriteByte(pCharacter.Level);
p.WriteMapleString(pCharacter.Name);
// Quest 111111 - I don't care for now.
p.WriteMapleString("");
// TODO: Guilds!
p.WriteZero(8);
p.WriteByte(0);
// Buffs
List<Pair<int, int>> BuffValue = new List<Pair<int, int>>();
List<Pair<int, int>> BuffValueNew = new List<Pair<int, int>>();
int[] Mask = new int[12];
Mask[0] |= -33554432;
Mask[1] |= 512;
Mask[5] |= 163840;
for (int i = 0; i < Mask.Length; i++)
{
p.WriteInt(Mask[i]);
}
foreach (Pair<int, int> i in BuffValue)
{
if (i.Right == 3)
{
p.WriteInt(i.Left);
}
else if (i.Right == 2)
{
p.WriteShort((short)i.Left);
}
else if (i.Right == 1)
{
p.WriteByte((byte)i.Left);
}
}
p.WriteInt(-1);
if (BuffValueNew.Count < 1)
{
p.WriteZero(10);
}
else
{
p.WriteByte(0);
foreach (Pair<int, int> i in BuffValueNew)
{
if (i.Right == 4)
{
p.WriteInt(i.Left);
}
else if (i.Right == 2)
{
p.WriteShort((short)i.Left);
}
else if (i.Right == 1)
{
p.WriteByte((byte)i.Left);
}
else if (i.Right == 0)
{
p.WriteZero((byte)i.Left);
}
}
}
p.WriteZero(20);
int Magic_Spawn = new Random().Next();
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteZero(10);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteZero(10);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteShort(0);
// TODO: Mounts.
p.WriteLong(0L);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteLong(0L);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteZero(15);
p.WriteByte(1);
//.........这里部分代码省略.........
示例14: LoginStatus
public static Packet LoginStatus(byte pReason)
{
Packet p = new Packet();
p.WriteByte((byte)SendOpcodes.Login_Status);
p.WriteByte(pReason);
p.WriteByte(0);
p.WriteInt(0);
return p;
}
示例15: AddEquipInfo
public static void AddEquipInfo(Packet p, Equip equip, Character c)
{
p.WriteByte(1); // Item type. 2 - An item, 3 - A pet. TODO: Pets.
p.WriteInt(equip.ItemID);
p.WriteByte(0); // todo: unique id.
AddExpirationTime(p, equip.Expiration);
p.WriteByte(0); // TODO: Extended slots.
p.WriteInt(0); // All values of all stats.
p.WriteByte(equip.Slots);
p.WriteByte(equip.Level);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteByte(0); // Inc skills?
p.WriteByte(equip.ItemLevel);
p.WriteInt(equip.ItemEXP * 100000);
p.WriteInt(0); // Durability.
p.WriteInt(equip.ViciousHammer);
p.WriteShort(0); // PVP Damage.
p.WriteInt(4);
p.WriteByte(0xFF);
p.WriteMapleString(""); // Owner.
p.WriteByte(0); // State.
p.WriteByte(0); // Enhance.
p.WriteShort(0); // ptl1
p.WriteShort(0); // ptl2
p.WriteShort(0); // ptl3
p.WriteShort(0); // bonus ptl 1
p.WriteShort(0); // bonus ptl2
p.WriteShort(0);
p.WriteShort(0);
p.WriteShort(0); // socket state
p.WriteShort(0); // socket1
p.WriteShort(0); // socket 2
p.WriteShort(0); // socket 3
//if (equip.CashId > 0)
//p.writelong
p.WriteLong(Tools.GetTime(-2));
p.WriteInt(-1);
}