本文整理汇总了C#中Solar.FiestaLib.Networking.Packet.WriteUInt方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteUInt方法的具体用法?C# Packet.WriteUInt怎么用?C# Packet.WriteUInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solar.FiestaLib.Networking.Packet
的用法示例。
在下文中一共展示了Packet.WriteUInt方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendUpdateSP
public static void SendUpdateSP(ZoneCharacter character)
{
using (var p = new Packet(SH9Type.HealSP))
{
p.WriteUInt(character.SP);
p.WriteUShort(character.UpdateCounter);
character.Client.SendPacket(p);
}
}
示例2: SendAttackDamage
public static void SendAttackDamage(MapObject from, ushort objectID, ushort damage, bool crit, uint hpleft, ushort counter)
{
using (var packet = new Packet(SH9Type.AttackDamage))
{
packet.WriteUShort(from.MapObjectID);
packet.WriteUShort(objectID);
packet.WriteBool(crit);
packet.WriteUShort(damage);
packet.WriteUInt(hpleft);
packet.WriteUShort(counter);
packet.WriteByte(4);
packet.WriteByte(100);
from.MapSector.Broadcast(packet);
}
}
示例3: SendSkill
public static void SendSkill(MapObject user, ushort animid, List<SkillVictim> victims)
{
using (var packet = new Packet(SH9Type.SkillAnimationTarget))
{
packet.WriteUShort(animid);
packet.WriteUShort(user.MapObjectID);
packet.WriteByte((byte)(victims.Count > 255 ? 255 : victims.Count));
for (byte i = 0; i < victims.Count && i != 255; i++)
{
var victim = victims[i];
packet.WriteUShort(victim.MapObjectID);
packet.WriteByte(victim.Stance1);
packet.WriteByte(victim.Stance2);
packet.WriteUInt(victim.Damage);
packet.WriteUInt(victim.HPLeft);
packet.WriteUShort(victim.HPCounter);
}
user.MapSector.Broadcast(packet);
}
}
示例4: SendSkillPosition
public static void SendSkillPosition(MapObject user, ushort animid, ushort skillid, uint x, uint y)
{
// 9 81 | [32 29] [B8 10] [56 0A 00 00] [3A 27 00 00] [75 70]
using (var packet = new Packet(SH9Type.SkillAnimationPosition))
{
packet.WriteUShort(user.MapObjectID);
packet.WriteUShort(skillid);
packet.WriteUInt(x);
packet.WriteUInt(y);
packet.WriteUShort(animid);
user.MapSector.Broadcast(packet);
}
}
示例5: SendGainEXP
public static void SendGainEXP(ZoneCharacter who, uint amount, ushort mobid = 0xFFFF)
{
using (var packet = new Packet(SH9Type.GainEXP))
{
packet.WriteUInt(amount);
packet.WriteUShort(mobid);
who.Client.SendPacket(packet);
}
}
示例6: WriteEquipStats
public void WriteEquipStats(Packet packet)
{
byte StatCount = 0;
if (Str > 0) StatCount++;
if (End > 0) StatCount++;
if (Dex > 0) StatCount++;
if (Spr > 0) StatCount++;
if (Int > 0) StatCount++;
packet.WriteUShort(ItemID);
switch (this.SlotType)
{
case ItemSlot.Helm:
case ItemSlot.Armor:
case ItemSlot.Pants:
case ItemSlot.Boots:
// case ItemSlot.Bow: // Shield = same
case ItemSlot.Weapon2:
case ItemSlot.Weapon:
packet.WriteByte(this.Upgrades); // Refinement
packet.WriteByte(0);
packet.WriteShort(0); // Or int?
packet.WriteShort(0);
if (this.SlotType == ItemSlot.Weapon || (this.SlotType == ItemSlot.Weapon2 && Info.TwoHand))
{
packet.WriteByte(0);
// Licence data
packet.WriteUShort(0xFFFF); // Nr.1 - Mob ID
packet.WriteUInt(0); // Nr.1 - Kill count
packet.WriteUShort(0xFFFF); // Nr.2 - Mob ID
packet.WriteUInt(0); // Nr.2 - Kill count
packet.WriteUShort(0xFFFF); // Nr.3 - Mob ID
packet.WriteUInt(0); // Nr.3 - Kill count
packet.WriteUShort(0xFFFF); // UNK
packet.WriteString("", 16); // First licence adder name
}
packet.WriteByte(0);
packet.WriteUInt(GetExpiringTime()); // Expiring time (1992027391 - never expires)
//packet.WriteShort(0);
break;
case ItemSlot.Pet:
packet.WriteByte(this.Upgrades); // Pet Refinement Lol
packet.Fill(2, 0); // UNK
packet.WriteUInt(GetExpiringTime()); // Expiring time (1992027391 - never expires)
packet.WriteUInt(0); // Time? (1992027391 - never expires)
break;
case ItemSlot.Earings:
case ItemSlot.Necklace:
case ItemSlot.Ring:
packet.WriteUInt(GetExpiringTime()); // Expiring time (1992027391 - never expires)
packet.WriteUInt(0); // Time? (1992027391 - never expires)
packet.WriteByte(this.Upgrades); // Refinement
// Stats added while refining
packet.WriteUShort(0); // it may be byte + byte too (some kind of counter when item downgrades)
packet.WriteUShort(0); // STR
packet.WriteUShort(0); // END
packet.WriteUShort(0); // DEX
packet.WriteUShort(0); // INT
packet.WriteUShort(0); // SPR
break;
case ItemSlot.CostumeWeapon:
case ItemSlot.CostumeShield:
packet.WriteUInt(25000); // Skin Durability
break;
default:
packet.WriteUInt(GetExpiringTime()); // Expiring time (1992027391 - never expires)
packet.WriteUInt(0); // Time? (1992027391 - never expires)
break;
}
// Random stats data (Not those what were added in refinement)
switch (this.SlotType)
{ // Stat count (StatCount << 1 | Visible(0 or 1 are stats shown or not))
case ItemSlot.Earings:
packet.WriteByte((byte)(StatCount << 1 | 1));
break;
case ItemSlot.Necklace:
case ItemSlot.Ring:
packet.WriteByte((byte)(StatCount << 1 | 1));
break;
case ItemSlot.Helm:
case ItemSlot.Armor:
case ItemSlot.Pants:
case ItemSlot.Boots:
case ItemSlot.Weapon2:
case ItemSlot.Weapon:
packet.WriteByte((byte)(StatCount << 1 | 1));
break;
case ItemSlot.Pet: // Yes!! Its possible to give stats to pet also (It overrides default one(s)).
packet.WriteByte((byte)(StatCount << 1 | 1));
break;
}
// foreach stat
//pPacket.WriteByte(type); // Stat type ( 0 = STR, 1 = END, 2 = DEX, 3 = INT, 4 = SPR )
//pPacket.WriteUShort(amount); // Amount
// end foreach
if (Str > 0) { packet.WriteByte(0); packet.WriteUShort(Str); }
if (End > 0) { packet.WriteByte(1); packet.WriteUShort(End); }
if (Dex > 0) { packet.WriteByte(2); packet.WriteUShort(Dex); }
if (Spr > 0) { packet.WriteByte(3); packet.WriteUShort(Spr); }
//.........这里部分代码省略.........
示例7: WriteSmallInfo
//this is used by the smaller writer (e.g. additem, unequip, equip)
public void WriteSmallInfo(Packet packet)
{
packet.WriteUShort(this.ItemID);
switch (SlotType)
{
case ItemSlot.Helm:
case ItemSlot.Armor:
case ItemSlot.Pants:
case ItemSlot.Boots:
case ItemSlot.Weapon2:
case ItemSlot.Weapon:
packet.WriteByte(Upgrades);
packet.Fill(6, 0);
packet.WriteUShort(ushort.MaxValue); //unk
packet.WriteUInt(GetExpiringTime());
packet.WriteUShort(ushort.MaxValue);
break;
default:
packet.WriteUInt(GetExpiringTime());
packet.WriteInt(0); //unk
break;
}
}
示例8: SendPremiumEmotions
public static void SendPremiumEmotions(ZoneCharacter character)
{
using (var packet = new Packet(SH4Type.CharacterItemList))
{
byte count = 0;
packet.WriteByte(count); // Count
packet.WriteByte(0x0F); // Inventory
packet.WriteByte(0xCB); // UNK (In newest client it exists, in bit older, not)
for (byte i = 0; i < count; i++)
{
packet.WriteByte(8); // Item Data Length
packet.WriteByte(i); // Slot
packet.WriteByte(0x3C); // Inventory thing
packet.WriteUShort((ushort)(31500 + (16 < i ? 1 : 0) + i * 2)); // Item ID
packet.WriteUInt(1992027391); // Expiring Time (1992027391 - Permanent)
}
character.Client.SendPacket(packet);
}
}
示例9: SendPremiumItemList
public static void SendPremiumItemList(ZoneCharacter character)
{
using(var packet = new Packet(SH4Type.CharacterItemList)) {
ushort count = 0;
packet.WriteUShort(count); // Count
for (ushort i = 0; i < count; i++)
{
packet.WriteUShort(0x0010); // Inventory
packet.WriteUShort(0x0000); // Slot
packet.WriteUShort(0x033B); // Item Handle // (Iron Case, to add 4 extra inventories :P)
packet.WriteUInt(1992027391); // Activation Time (1992027391 - Permanent)
packet.WriteUInt(1992027391); // Expiring Time (1992027391 - Permanent)
}
character.Client.SendPacket(packet);
}
}
示例10: SendHouseList
public static void SendHouseList(ZoneCharacter character)
{
//TODO: house loading
using (var packet = new Packet(SH4Type.CharacterItemList))
{
byte count = 0;
packet.WriteByte(count); // Count
packet.WriteByte(0x0C); // Inventory
packet.WriteByte(0x35); // UNK (In newest client it exists, in bit older, not)
for (byte i = 0; i < count; i++)
{
packet.WriteByte(8); // Item Data Length
packet.WriteByte(i); // Slot
packet.WriteByte(0x30); // UNK
packet.WriteUShort((ushort)(31000 + i * 3)); // Item ID
packet.WriteUInt(1992027391); // Expiring Time (1992027391 - Permanent)
}
character.Client.SendPacket(packet);
}
}
示例11: WriteUpdateStats
public void WriteUpdateStats(Packet packet)
{
packet.WriteUInt(HP);
packet.WriteUInt(MaxHP); // Max HP
packet.WriteUInt(SP);
packet.WriteUInt(MaxSP); // Max SP
packet.WriteByte(Level);
packet.WriteUShort(this.UpdateCounter);
}
示例12: WriteUpdateStats
public void WriteUpdateStats(Packet packet)
{
packet.WriteUInt(this.HP);
packet.WriteUInt(BaseStats.MaxHP);
packet.WriteUInt(this.SP);
packet.WriteUInt(BaseStats.MaxSP);
packet.WriteByte(this.Level);
packet.WriteUShort(this.UpdateCounter);
}
示例13: WriteDetailedInfoExtra
public void WriteDetailedInfoExtra(Packet packet, bool levelUP = false)
{
if (!levelUP)
{
packet.WriteUShort(this.MapObjectID);
}
packet.WriteLong(this.Exp);
packet.WriteULong(DataProvider.Instance.GetMaxExpForLevel(this.Level));
packet.WriteInt(BaseStats.Strength);
packet.WriteInt(BaseStats.Strength + GetExtraStr());
packet.WriteInt(BaseStats.Endurance);
packet.WriteInt(BaseStats.Endurance + GetExtraEnd());
packet.WriteInt(BaseStats.Dexterity);
packet.WriteInt(BaseStats.Dexterity + GetExtraDex());
packet.WriteInt(BaseStats.Intelligence);
packet.WriteInt(BaseStats.Intelligence + GetExtraInt());
packet.WriteInt(0); // Wizdom. It isn't set in the server so it can contain shit from old buffers... :D
packet.WriteInt(0); // I once had a name here :P
packet.WriteInt(BaseStats.Spirit);
packet.WriteInt(BaseStats.Spirit + GetExtraSpr());
packet.WriteInt(GetWeaponDamage()); //base damage
packet.WriteInt(GetWeaponDamage(true)); //increased damage (e.g. buffs)
packet.WriteInt(GetMagicDamage()); //magic dmg
packet.WriteInt(GetMagicDamage(true)); //inc magic dmg
packet.WriteInt(GetWeaponDefense()); //todo equip stats loading (weapondef)
packet.WriteInt(GetWeaponDefense(true)); //weapondef inc
packet.WriteInt(GetAim()); //TODO: basestats aim + dex?
packet.WriteInt(GetAim(true)); //aim inc (calcuate later based on dex)
packet.WriteInt(GetEvasion()); //evasion
packet.WriteInt(GetEvasion(true)); //evasion inc
packet.WriteInt(GetWeaponDamage()); //damage block again
packet.WriteInt(GetWeaponDamage(true));
packet.WriteInt(GetMagicDamage()); //magic damage
packet.WriteInt(GetMagicDamage(true));
packet.WriteInt(GetMagicDefense()); //magic def
packet.WriteInt(GetMagicDefense(true)); //magic def inc
packet.WriteInt(1);
packet.WriteInt(20);
packet.WriteInt(2);
packet.WriteInt(40);
packet.WriteUInt(BaseStats.MaxHP); //max HP
packet.WriteUInt(BaseStats.MaxSP); //max SP
packet.WriteInt(0); // UNK
packet.WriteInt(BaseStats.MAXSoulHP); // Max HP Stones
packet.WriteInt(BaseStats.MAXSoulSP); // Max SP Stones
packet.Fill(64, 0);
if (!levelUP)
{
packet.WriteInt(this.Position.X);
packet.WriteInt(this.Position.Y);
}
}
示例14: WriteDetailedInfo
public void WriteDetailedInfo(Packet pPacket)
{
pPacket.WriteInt(ID);
pPacket.WriteString(this.Name, 16);
pPacket.WriteByte(this.Slot);
pPacket.WriteByte(this.Level);
pPacket.WriteLong(this.Exp);
pPacket.WriteInt(12345678); // UNK
pPacket.WriteShort(this.StonesHP);
pPacket.WriteShort(this.StonesSP);
pPacket.WriteUInt(this.HP);
pPacket.WriteUInt(this.SP);
pPacket.WriteInt(this.Fame); // Fame
pPacket.WriteLong(this.Money); //TODO: inventory class
pPacket.WriteString(this.Map.MapInfo.ShortName, 12);
pPacket.WriteInt(this.Position.X);
pPacket.WriteInt(this.Position.Y);
pPacket.WriteByte(this.Rotation);
pPacket.WriteByte(this.Str); // Str bonus
pPacket.WriteByte(this.End); // End bonus
pPacket.WriteByte(this.Dex); // Dex bonus
pPacket.WriteByte(this.Int); // Int bonus
pPacket.WriteByte(this.Spr); // Spr bonus
pPacket.WriteShort(0); // UNK
pPacket.WriteUInt(0); // Killpoints
pPacket.Fill(7, 0); // UNK
}