chore: Use var everywhere (#2294)
This commit is contained in:
parent
0b34cc4417
commit
ebaf104935
267 changed files with 873 additions and 873 deletions
|
|
@ -38,7 +38,7 @@ namespace Server.Network
|
|||
|
||||
using var builder = new PacketContainerBuilder(stackalloc byte[minLength]);
|
||||
|
||||
Span<byte> buffer = builder.GetSpan(OutgoingEntityPackets.MaxWorldEntityPacketLength);
|
||||
var buffer = builder.GetSpan(OutgoingEntityPackets.MaxWorldEntityPacketLength);
|
||||
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,14 +31,14 @@ public static class MapUO
|
|||
|
||||
public static void QueryGuildMemberLocations(NetState state, SpanReader reader)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
var from = state.Mobile;
|
||||
|
||||
state.SendGuildMemberLocations(from, from.Guild as Guild, reader.ReadBoolean());
|
||||
}
|
||||
|
||||
public static void QueryPartyMemberLocations(NetState state, SpanReader reader)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
var from = state.Mobile;
|
||||
var party = Party.Get(from);
|
||||
|
||||
if (party != null)
|
||||
|
|
@ -62,7 +62,7 @@ public static class MapUO
|
|||
writer.Write((byte)0x02); // Command
|
||||
writer.Write(count > 0 && sendLocations);
|
||||
|
||||
bool sendPacket = false;
|
||||
var sendPacket = false;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var m = guild!.Members[i];
|
||||
|
|
@ -121,11 +121,11 @@ public static class MapUO
|
|||
writer.Seek(2, SeekOrigin.Current);
|
||||
writer.Write((byte)0x01); // Command
|
||||
|
||||
bool sendPacket = false;
|
||||
var sendPacket = false;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var pmi = party!.Members[i];
|
||||
Mobile mob = pmi?.Mobile;
|
||||
var mob = pmi?.Mobile;
|
||||
|
||||
if (mob?.NetState == null || mob == from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ public static class IncomingAccountPackets
|
|||
var female = genderRace % 2 != 0;
|
||||
|
||||
var raceID = state.StygianAbyss ? (byte)(genderRace < 4 ? 0 : genderRace / 2 - 1) : (byte)(genderRace / 2);
|
||||
Race race = Race.Races[raceID] ?? Race.DefaultRace;
|
||||
var race = Race.Races[raceID] ?? Race.DefaultRace;
|
||||
|
||||
var info = state.CityInfo;
|
||||
var a = state.Account;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public static class IncomingEntityPackets
|
|||
}
|
||||
else
|
||||
{
|
||||
Serial s = (Serial)value;
|
||||
var s = (Serial)value;
|
||||
|
||||
if (s.IsMobile)
|
||||
{
|
||||
|
|
@ -106,7 +106,7 @@ public static class IncomingEntityPackets
|
|||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
Serial s = (Serial)reader.ReadUInt32();
|
||||
var s = (Serial)reader.ReadUInt32();
|
||||
|
||||
if (s.IsMobile)
|
||||
{
|
||||
|
|
@ -169,7 +169,7 @@ public static class IncomingEntityPackets
|
|||
|
||||
while (reader.Remaining > 0)
|
||||
{
|
||||
Serial s = (Serial)reader.ReadUInt32();
|
||||
var s = (Serial)reader.ReadUInt32();
|
||||
|
||||
if (s.IsMobile)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ public static partial class IncomingExtendedCommandPackets
|
|||
return;
|
||||
}
|
||||
|
||||
Item spellbook = reader.ReadInt16() == 1 ? World.FindItem((Serial)reader.ReadUInt32()) : null;
|
||||
var spellbook = reader.ReadInt16() == 1 ? World.FindItem((Serial)reader.ReadUInt32()) : null;
|
||||
|
||||
var spellID = reader.ReadInt16() - 1;
|
||||
Spellbook.CastSpellRequest(from, spellID, spellbook);
|
||||
|
|
@ -361,7 +361,7 @@ public static partial class IncomingExtendedCommandPackets
|
|||
|
||||
var from = state.Mobile;
|
||||
|
||||
Serial s = (Serial)reader.ReadUInt32();
|
||||
var s = (Serial)reader.ReadUInt32();
|
||||
|
||||
if (s.IsMobile)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public static class IncomingItemPackets
|
|||
reader.ReadByte(); // Grid Location?
|
||||
}
|
||||
|
||||
Serial dest = (Serial)reader.ReadUInt32();
|
||||
var dest = (Serial)reader.ReadUInt32();
|
||||
|
||||
var loc = new Point3D(x, y, z);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public static class IncomingMovementPackets
|
|||
}
|
||||
|
||||
var steps = reader.ReadByte();
|
||||
for (int i = 0; i < steps; i++)
|
||||
for (var i = 0; i < steps; i++)
|
||||
{
|
||||
var t1 = reader.ReadUInt64(); // start time?
|
||||
var t2 = reader.ReadUInt64(); // end time?
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public static class IncomingTargetingPackets
|
|||
}
|
||||
}
|
||||
|
||||
int hue = 0;
|
||||
var hue = 0;
|
||||
var valid = false;
|
||||
|
||||
var eable = t.DisallowMultis
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Server.Network
|
|||
{
|
||||
int cmd = reader.ReadByte();
|
||||
|
||||
PacketHandler ph = packetHandlers[cmd];
|
||||
var ph = packetHandlers[cmd];
|
||||
|
||||
if (ph == null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue