本文整理汇总了C#中Packet.WriteBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteBoolean方法的具体用法?C# Packet.WriteBoolean怎么用?C# Packet.WriteBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.WriteBoolean方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RequestInfo
public static void RequestInfo(TNLConnection conn)
{
var resp = new Packet(Opcode.RequestClanInfoResponse); // todo: No response, if the character has no clan?
resp.WriteInteger(-1); // Clan Id
resp.WriteUtf8StringOn("", 51); // Clan Name
resp.WriteUtf8StringOn("", 251); // Clan Motd
resp.WriteUtf8StringOn("", 51); // Rank One
resp.WriteUtf8StringOn("", 51); // Rank Two
resp.WriteUtf8StringOn("", 51); // Rank Three
resp.WritePadding(1);
resp.WriteInteger(-1); // Monthly Dues
resp.WriteInteger(-1); // Monthly Upkeep
resp.WriteLong(-1L); // Clan Owner
resp.WriteInteger(0); // Num members
resp.WritePadding(4);
for (var i = 0; i < 0; ++i)
{
resp.WriteLong(-1L); // Member Coid
resp.WriteUtf8StringOn("", 17); // Character Name
resp.WritePadding(3);
resp.WriteInteger(0); // Continent Id
resp.WriteInteger(0); // Xp
resp.WriteInteger(0); // Clan Rank
resp.WriteLong(0); // Last Paid Dues
resp.WriteInteger(-1); // Cbid
resp.WriteBoolean(false); // Online
resp.WritePadding(3);
resp.WriteLong(0); // Last Online
resp.WriteLong(0); // Join Date
}
conn.SendPacket(resp, RPCGuaranteeType.RPCGuaranteedOrdered);
}
示例2: ConstructBroadcastPacket
private static Packet ConstructBroadcastPacket(ChatType type, Boolean isGm, String sender, Int64 sendercoid, String msg)
{
var msglen = (Int16) msg.Length;
var p = new Packet(Opcode.Broadcast);
p.WriteInteger((UInt32) type);
p.WriteLong(sendercoid);
p.WriteBoolean(isGm);
p.WritePadding(1).WriteShort(msglen);
p.WriteUtf8StringOn(sender, 17);
p.WriteUtf8StringOn(msg, msglen);
p.WriteByte(0);
return p;
}
示例3: GetEnemies
public static void GetEnemies(TNLConnection session)
{
//return;
var coid = session.CurrentCharacter.GetCOID();
CheckCache(coid);
var packet = new Packet(Opcode.GetEnemiesResponse);
var t = Cache[coid];
var enemyEntries = t.Item2.Where(e => e.Type == SocialType.Enemy).ToList();
var count = enemyEntries.Count;
packet.WriteInteger(count >= 20 ? 20 : count);
var j = 0;
foreach (var se in enemyEntries)
{
if (!(se is EnemyEntry)) // should never happen
continue;
packet.WriteLong(se.Character);
packet.WriteLong(se.OtherCharacter);
packet.WriteInteger(se.Level);
packet.WriteInteger(se.LastContinentId);
packet.WriteInteger((se as EnemyEntry).TimesKilled);
packet.WriteInteger((se as EnemyEntry).TimesKilledBy);
packet.WriteByte((se as EnemyEntry).Race);
packet.WriteByte(se.Class);
packet.WriteBoolean(se.Online);
packet.WriteUtf8StringOn(se.Name, 17);
packet.WritePadding(4);
if (++j == 20)
break;
}
for (var i = 0; i < 20 - j; ++i)
packet.WritePadding(56);
session.SendPacket(packet, RPCGuaranteeType.RPCGuaranteedOrdered);
}
示例4: WriteToCreatePacket
public override void WriteToCreatePacket(Packet packet, Boolean extended = false)
{
base.WriteToCreatePacket(packet, extended);
#region Create Wheel Set
packet.WriteSingle(_frictionGravel); // friction gravel
packet.WriteSingle(_frictionIce); // friction ice
packet.WriteSingle(_frictionMud); // friction mud
packet.WriteSingle(_frictionPaved); // friction paved
packet.WriteSingle(_frictionPlains); // friction plains
packet.WriteSingle(_frictionSand); // friction sand
packet.WriteBoolean(_isDefault); // is default
packet.WriteUtf8StringOn(MangledName, 100); // name
packet.WritePadding(3);
#endregion Create Wheel Set
}
示例5: GetFriends
public static void GetFriends(TNLConnection session)
{
//return;
var coid = session.CurrentCharacter.GetCOID();
CheckCache(coid);
var packet = new Packet(Opcode.GetFriendsResponse);
var t = Cache[coid];
var friendEntries = t.Item2.Where(e => e.Type == SocialType.Friend).ToList();
var count = friendEntries.Count;
packet.WriteInteger(count >= 20 ? 20 : count);
var j = 0;
foreach (var se in friendEntries)
{
packet.WriteLong(se.Character);
packet.WriteLong(se.OtherCharacter);
packet.WriteInteger(se.Level);
packet.WriteInteger(se.LastContinentId);
packet.WriteByte(se.Class);
packet.WriteBoolean(se.Online);
packet.WriteUtf8StringOn(se.Name, 17);
packet.WritePadding(5);
if (++j == 20)
break;
}
for (var i = 0; i < 20 - j; ++i)
packet.WritePadding(48);
session.SendPacket(packet, RPCGuaranteeType.RPCGuaranteedOrdered);
}
示例6: ConstructChatPacket
private static Packet ConstructChatPacket(ChatType type, Boolean isGm, String recipient, String sender, String msg)
{
var msglen = (Int16) msg.Length;
var p = new Packet(Opcode.Chat);
p.WriteInteger((UInt32) type);
p.WriteBoolean(isGm);
p.WriteUtf8StringOn(recipient, 17);
p.WriteUtf8StringOn(sender, 17);
p.WritePadding(1).WriteShort(msglen);
p.WriteUtf8StringOn(msg, msglen);
p.WriteByte(0);
return p;
}
示例7: WritePacket
public void WritePacket(Packet packet)
{
//packet.WritePadding(4);
// SVOG header begin -->
packet.WriteInteger(0); // Region Id
packet.WriteInteger(0); // Region Type
packet.WriteByte(1); // Region Level
packet.WritePadding(3);
packet.WriteInteger(0); // Layer Id
packet.WriteInteger(_continentObject.Objective); // Objective Index
packet.WriteUtf8StringOn(String.Format("{0}.fam", _continentObject.MapFileName), 65); // Map Name
packet.WriteBoolean(_continentObject.IsTown); // Is Town
packet.WriteBoolean(_continentObject.IsArena); // Is Arena
packet.WritePadding(1);
packet.WriteInteger(_continentObject.OwningFaction); // Race Faction
packet.WriteInteger(ContinentId); // Continent Object ID
packet.WriteBoolean(_continentObject.IsPersistent); // Is Persistent
packet.WritePadding(3);
packet.WriteInteger(MapEntry.IterationVersion); // Map Iteration Version
packet.WriteInteger(_continentObject.ContestedMission); // Contested Mission Id
packet.WritePadding(4);
packet.WriteLong(ContinentId); // COID Map
// SVOG header end <--
packet.WriteInteger(123456789); // Temporal Random Seed
packet.WriteLong(ContinentId); // COID Map
packet.WriteShort(0); // Number of Module Selections
// for NumberOfModuleSelections { 24 byte }
// CND Unaligned Vector 3 begin -->
packet.WriteSingle(0.0f);
packet.WriteSingle(0.0f);
packet.WriteSingle(0.0f);
// CND Unaligned Vector 3 end <--
packet.WriteShort(0);
/*packet.WriteShort(36); // Weather Count
// Weather Update begin -->
packet.WriteInteger(0x2069);
packet.WriteLong(0);
packet.WriteLong(0);
packet.WriteLong(0);
packet.WriteLong(0);*/
// Weather Update end <--
}
示例8: WriteToCreatePacket
public override void WriteToCreatePacket(Packet packet, Boolean extended = false)
{
base.WriteToCreatePacket(packet);
if (extended || this is Character) // only chars and vehicles can be extended
return;
packet.WriteInteger(EnhancementId);
packet.WritePadding(4);
packet.WriteTFID(SummonOwner);
packet.WriteBoolean(DoesntCountAsSummon);
packet.WritePadding(7);
packet.WriteLong(CurrentVehicleId);
packet.WriteLong(CurrentTrailerCoid);
packet.WriteInteger(-1); // current spawn owner
packet.WriteByte(0); // number skills
packet.WritePadding(3);
packet.WriteInteger(Analyzed);
packet.WriteInteger(Level);
packet.WriteInteger(0); // current path id
packet.WriteInteger(0); // extra path id
packet.WriteSingle(0.0f); // patrol distance
packet.WriteBoolean(false); // path is reversing
packet.WriteBoolean(false); // path is road
packet.WriteBoolean(IsElite); // iselite
packet.WriteByte(AIState); // ai state
packet.WriteInteger(0); // on use trigger
packet.WriteInteger(0); // on use reaction
packet.WriteLong(0); // murderer coid
for (var i = 0; i < 255; ++i)
{
packet.WriteInteger(0); // skill id
packet.WriteShort(0); // skill level
packet.WritePadding(2);
}
}
示例9: WriteToCreatePacket
public override void WriteToCreatePacket(Packet packet, Boolean extended = false)
{
base.WriteToCreatePacket(packet, extended);
#region Create Vehicle
packet.WriteLong(CoidCurrentOwner); // current owner coid
packet.WriteInteger(SpawnOwnerCoid); // spawn owner coid
for (var i = 0; i < 8; ++i) // arr id tricks
packet.WriteInteger(TrickIds[i]);
packet.WriteInteger(PrimaryColor); // color primary
packet.WriteInteger(SecondaryColor); // color secondary
packet.WriteShort(_armorAdd); // armor add
packet.WritePadding(2);
packet.WriteInteger(_powerMaxAdd); // power max add
packet.WriteInteger(_heatMaxAdd); // heat max add
packet.WriteShort(_cooldownAdd); // cooldownadd
packet.WriteShort(_inventorySlots); // inventoryslots
packet.WriteSingle(_maxWtWeaponFront); // max wt weapon front
packet.WriteSingle(_maxWtWeaponTurret); // max wt weapon turret
packet.WriteSingle(_maxWtWeaponRear); // max wt weapon rear
packet.WriteSingle(_maxWtArmor); // max wt armor
packet.WriteSingle(_maxWtPowerPlant); // max wt power plant
packet.WriteSingle(SpeedAdd); // speed add
packet.WriteSingle(BrakesMaxTorqueFrontMultiplier); // brakes max torque front multiplier
packet.WriteSingle(BrakesMaxTorqueRearAdjustMultiplier); // brakes max torque rear adjust multiplies
packet.WriteSingle(SteeringMaxAngleMultiplier); // steering max angle multiplier
packet.WriteSingle(SteeringFullSpeedLimitMultiplier); // steering full speed limit multiplier
packet.WriteSingle(AVDNormalSpinDampeningMultiplier); // AVD normal spin dampening multiplier
packet.WriteSingle(AVDCollisionSpinDampeningAdjust); // AVD collision spin dampening multiplier
packet.WriteSingle(_kmTravelled); // km travelled
packet.WriteBoolean(IsTrailer); // is trailer
packet.WriteBoolean(false); // is in inventory
packet.WriteBoolean(VehicleIsActive); // is active
packet.WriteByte(Trim); // trim
packet.WritePadding(4);
#region Ornament
packet.WriteOpcode(Opcode.CreateSimpleObject);
if (_ornament != null) // Ornament
_ornament.WriteToCreatePacket(packet, extended);
else
WriteEmptyObjectToPacket(packet);
#endregion
#region Race Item
packet.WriteOpcode(Opcode.CreateSimpleObject);
if (_raceItem != null && !TNLInterface.Instance.Adaptive) // Race Item
_raceItem.WriteToCreatePacket(packet, extended);
else
WriteEmptyObjectToPacket(packet);
#endregion
#region Power Plant
packet.WriteOpcode(Opcode.CreatePowerPlant);
if (_powerPlant != null) // Power Plant
_powerPlant.WriteToCreatePacket(packet);
else
PowerPlant.WriteEmptyObjectToPacket(packet);
#endregion
#region Wheel Set
packet.WriteOpcode(Opcode.CreateWheelSet);
if (_wheelSet != null) // Wheel set
_wheelSet.WriteToCreatePacket(packet);
else
Debug.Assert(false, "WHEELSETNEK KELL LENNIE!");
#endregion
#region Armor
packet.WriteOpcode(Opcode.CreateArmor);
if (_armor != null) // Armor
_armor.WriteToCreatePacket(packet);
else
Armor.WriteEmptyObjectToPacket(packet);
#endregion
#region Melee Weapon
packet.WriteOpcode(Opcode.CreateWeapon);
if (_meleeWeapon != null) // Weapon Melee
_meleeWeapon.WriteToCreatePacket(packet);
else
Weapon.WriteEmptyObjectToPacket(packet);
#endregion
#region Front Weapon
packet.WriteOpcode(Opcode.CreateWeapon);
if (_weapons[0] != null) // Weapon Front
_weapons[0].WriteToCreatePacket(packet);
//.........这里部分代码省略.........
示例10: WriteToCreatePacket
public override void WriteToCreatePacket(Packet packet, Boolean extended = false)
{
packet.WriteInteger(CBID);
packet.WriteLong(-1L); // coid Store
packet.WriteInteger(GetCurrentHP() + 100);
packet.WriteInteger(GetMaximumHP() + 100);
packet.WriteInteger(GetValue());
packet.WriteInteger(GetIDFaction());
packet.WriteInteger(TeamFaction);
packet.WriteInteger(CustomValue);
for (var i = 0; i < 5; ++i) // prefix id
packet.WriteInteger(-1);
for (var i = 0; i < 5; ++i) // gadget id
packet.WriteInteger(-1);
for (var i = 0; i < 5; ++i) // prefix level
packet.WriteShort(0);
for (var i = 0; i < 5; ++i) // gadget level
packet.WriteShort(0);
packet.WriteSingle(Position.X);
packet.WriteSingle(Position.Y);
packet.WriteSingle(Position.Z);
packet.WriteSingle(Rotation.X);
packet.WriteSingle(Rotation.Y);
packet.WriteSingle(Rotation.Z);
packet.WriteSingle(Rotation.W);
packet.WriteSingle(Scale);
packet.WriteInteger(GetQuantity());
packet.WriteByte(InventoryPositionX);
packet.WriteByte(InventoryPositionY);
packet.WriteBoolean(GetIsCorpse()); // is corpse
packet.WritePadding(5);
packet.WriteTFID(COID);
packet.WriteBoolean(false); // will equip
packet.WriteBoolean(false); // is item link
packet.WriteBoolean(false); // is in inventory
packet.WriteByte(SkillLevel1);
packet.WriteByte(SkillLevel2);
packet.WriteByte(SkillLevel3);
packet.WriteBoolean(false); // is identified
packet.WriteBoolean(false); // possible mission item
packet.WriteBoolean(false); // tempitem
packet.WriteBoolean((UnkFlags & UnkFlags.IsKit) != 0);
packet.WriteBoolean(false); // isinfinite
packet.WriteBoolean((UnkFlags & UnkFlags.IsBound) != 0);
packet.WriteShort(UsesLeft);
packet.WriteUtf8StringOn(CustomizedName, 17);
packet.WriteBoolean(MadeFromMemory);
packet.WriteBoolean(false); // is mail
packet.WritePadding(1);
packet.WriteShort((Int16)MaxGadgets);
packet.WriteShort((Int16)RequiredLevel);
packet.WriteShort((Int16)RequiredCombat);
packet.WriteShort((Int16)RequiredPerception);
packet.WriteShort((Int16)RequiredTech);
packet.WriteShort((Int16)RequiredTheory);
packet.WritePadding(2);
packet.WriteInteger(ItemTemplateId);
packet.WritePadding(4);
}