Renames pvSrc (#277)
This commit is contained in:
parent
4211835b5d
commit
24bf97282e
12 changed files with 533 additions and 533 deletions
|
|
@ -1,6 +1,6 @@
|
|||
namespace Server.Network
|
||||
{
|
||||
public delegate void OnEncodedPacketReceive(NetState state, IEntity ent, EncodedReader pvSrc);
|
||||
public delegate void OnEncodedPacketReceive(NetState state, IEntity ent, EncodedReader reader);
|
||||
|
||||
public class EncodedPacketHandler
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using System;
|
|||
|
||||
namespace Server.Network
|
||||
{
|
||||
public delegate void OnPacketReceive(NetState state, PacketReader pvSrc);
|
||||
public delegate void OnPacketReceive(NetState state, PacketReader reader);
|
||||
|
||||
public delegate TimeSpan ThrottlePacketCallback(NetState state);
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -193,7 +193,7 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
return false;
|
||||
}
|
||||
|
||||
private static void RaceChangeReply(NetState state, PacketReader pvSrc)
|
||||
private static void RaceChangeReply(NetState state, PacketReader reader)
|
||||
{
|
||||
if (!m_Pending.TryGetValue(state, out var raceChangeState))
|
||||
{
|
||||
|
|
@ -210,7 +210,7 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
var owner = raceChangeState.m_Owner;
|
||||
var targetRace = raceChangeState.m_TargetRace;
|
||||
|
||||
if (pvSrc.Length == 5)
|
||||
if (reader.Length == 5)
|
||||
{
|
||||
owner?.OnCancel(pm);
|
||||
|
||||
|
|
@ -222,11 +222,11 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
return;
|
||||
}
|
||||
|
||||
int hue = pvSrc.ReadUInt16();
|
||||
int hairItemId = pvSrc.ReadUInt16();
|
||||
int hairHue = pvSrc.ReadUInt16();
|
||||
int facialHairItemId = pvSrc.ReadUInt16();
|
||||
int facialHairHue = pvSrc.ReadUInt16();
|
||||
int hue = reader.ReadUInt16();
|
||||
int hairItemId = reader.ReadUInt16();
|
||||
int hairHue = reader.ReadUInt16();
|
||||
int facialHairItemId = reader.ReadUInt16();
|
||||
int facialHairHue = reader.ReadUInt16();
|
||||
|
||||
pm.Race = targetRace;
|
||||
pm.Hue = targetRace.ClipSkinHue(hue) | 0x8000;
|
||||
|
|
|
|||
|
|
@ -330,13 +330,13 @@ namespace Server.Items
|
|||
/*public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
|
||||
if (m_Title?.Length > 0)
|
||||
list.Add( 1060658, "Title\t{0}", m_Title ); // ~1_val~: ~2_val~
|
||||
|
||||
|
||||
if (m_Author?.Length > 0)
|
||||
list.Add( 1060659, "Author\t{0}", m_Author ); // ~1_val~: ~2_val~
|
||||
|
||||
|
||||
if (m_Pages?.Length > 0)
|
||||
list.Add( 1060660, "Pages\t{0}", m_Pages.Length ); // ~1_val~: ~2_val~
|
||||
}*/
|
||||
|
|
@ -366,70 +366,70 @@ namespace Server.Items
|
|||
PacketHandlers.Register(0x93, 99, true, OldHeaderChange);
|
||||
}
|
||||
|
||||
public static void OldHeaderChange(NetState state, PacketReader pvSrc)
|
||||
public static void OldHeaderChange(NetState state, PacketReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBook book) || !book.Writable ||
|
||||
if (!(World.FindItem(reader.ReadUInt32()) is BaseBook book) || !book.Writable ||
|
||||
!from.InRange(book.GetWorldLocation(), 1) || !book.IsAccessibleTo(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pvSrc.Seek(4, SeekOrigin.Current); // Skip flags and page count
|
||||
reader.Seek(4, SeekOrigin.Current); // Skip flags and page count
|
||||
|
||||
var title = pvSrc.ReadStringSafe(60);
|
||||
var author = pvSrc.ReadStringSafe(30);
|
||||
var title = reader.ReadStringSafe(60);
|
||||
var author = reader.ReadStringSafe(30);
|
||||
|
||||
book.Title = Utility.FixHtml(title);
|
||||
book.Author = Utility.FixHtml(author);
|
||||
}
|
||||
|
||||
public static void HeaderChange(NetState state, PacketReader pvSrc)
|
||||
public static void HeaderChange(NetState state, PacketReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBook book) || !book.Writable ||
|
||||
if (!(World.FindItem(reader.ReadUInt32()) is BaseBook book) || !book.Writable ||
|
||||
!from.InRange(book.GetWorldLocation(), 1) || !book.IsAccessibleTo(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pvSrc.Seek(4, SeekOrigin.Current); // Skip flags and page count
|
||||
reader.Seek(4, SeekOrigin.Current); // Skip flags and page count
|
||||
|
||||
int titleLength = pvSrc.ReadUInt16();
|
||||
int titleLength = reader.ReadUInt16();
|
||||
|
||||
if (titleLength > 60)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var title = pvSrc.ReadUTF8StringSafe(titleLength);
|
||||
var title = reader.ReadUTF8StringSafe(titleLength);
|
||||
|
||||
int authorLength = pvSrc.ReadUInt16();
|
||||
int authorLength = reader.ReadUInt16();
|
||||
|
||||
if (authorLength > 30)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var author = pvSrc.ReadUTF8StringSafe(authorLength);
|
||||
var author = reader.ReadUTF8StringSafe(authorLength);
|
||||
|
||||
book.Title = Utility.FixHtml(title);
|
||||
book.Author = Utility.FixHtml(author);
|
||||
}
|
||||
|
||||
public static void ContentChange(NetState state, PacketReader pvSrc)
|
||||
public static void ContentChange(NetState state, PacketReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBook book) || !book.Writable ||
|
||||
if (!(World.FindItem(reader.ReadUInt32()) is BaseBook book) || !book.Writable ||
|
||||
!from.InRange(book.GetWorldLocation(), 1) || !book.IsAccessibleTo(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int pageCount = pvSrc.ReadUInt16();
|
||||
int pageCount = reader.ReadUInt16();
|
||||
|
||||
if (pageCount > book.PagesCount)
|
||||
{
|
||||
|
|
@ -438,13 +438,13 @@ namespace Server.Items
|
|||
|
||||
for (var i = 0; i < pageCount; ++i)
|
||||
{
|
||||
int index = pvSrc.ReadUInt16();
|
||||
int index = reader.ReadUInt16();
|
||||
|
||||
if (index >= 1 && index <= book.PagesCount)
|
||||
{
|
||||
--index;
|
||||
|
||||
int lineCount = pvSrc.ReadUInt16();
|
||||
int lineCount = reader.ReadUInt16();
|
||||
|
||||
if (lineCount <= 8)
|
||||
{
|
||||
|
|
@ -452,7 +452,7 @@ namespace Server.Items
|
|||
|
||||
for (var j = 0; j < lineCount; ++j)
|
||||
{
|
||||
if ((lines[j] = pvSrc.ReadUTF8StringSafe()).Length >= 80)
|
||||
if ((lines[j] = reader.ReadUTF8StringSafe()).Length >= 80)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using Server.Network;
|
|||
|
||||
namespace Server.Engines.Mahjong
|
||||
{
|
||||
public delegate void OnMahjongPacketReceive(MahjongGame game, NetState state, PacketReader pvSrc);
|
||||
public delegate void OnMahjongPacketReceive(MahjongGame game, NetState state, PacketReader reader);
|
||||
|
||||
public sealed class MahjongPacketHandlers
|
||||
{
|
||||
|
|
@ -41,25 +41,25 @@ namespace Server.Engines.Mahjong
|
|||
RegisterSubCommand(0x18, MoveDealerIndicator);
|
||||
}
|
||||
|
||||
public static void OnPacket(NetState state, PacketReader pvSrc)
|
||||
public static void OnPacket(NetState state, PacketReader reader)
|
||||
{
|
||||
var game = World.FindItem(pvSrc.ReadUInt32()) as MahjongGame;
|
||||
var game = World.FindItem(reader.ReadUInt32()) as MahjongGame;
|
||||
|
||||
game?.Players.CheckPlayers();
|
||||
|
||||
pvSrc.ReadByte();
|
||||
reader.ReadByte();
|
||||
|
||||
int cmd = pvSrc.ReadByte();
|
||||
int cmd = reader.ReadByte();
|
||||
|
||||
var onReceive = GetSubCommandDelegate(cmd);
|
||||
|
||||
if (onReceive != null)
|
||||
{
|
||||
onReceive(game, state, pvSrc);
|
||||
onReceive(game, state, reader);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvSrc.Trace(state);
|
||||
reader.Trace(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ namespace Server.Engines.Mahjong
|
|||
};
|
||||
}
|
||||
|
||||
public static void ExitGame(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void ExitGame(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game == null)
|
||||
{
|
||||
|
|
@ -97,20 +97,20 @@ namespace Server.Engines.Mahjong
|
|||
game.Players.LeaveGame(from);
|
||||
}
|
||||
|
||||
public static void GivePoints(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void GivePoints(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGamePlayer(state.Mobile) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int to = pvSrc.ReadByte();
|
||||
var amount = pvSrc.ReadInt32();
|
||||
int to = reader.ReadByte();
|
||||
var amount = reader.ReadInt32();
|
||||
|
||||
game.Players.TransferScore(state.Mobile, to, amount);
|
||||
}
|
||||
|
||||
public static void RollDice(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void RollDice(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGamePlayer(state.Mobile) != true)
|
||||
{
|
||||
|
|
@ -120,7 +120,7 @@ namespace Server.Engines.Mahjong
|
|||
game.Dices.RollDices(state.Mobile);
|
||||
}
|
||||
|
||||
public static void BuildWalls(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void BuildWalls(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGameDealer(state.Mobile) != true)
|
||||
{
|
||||
|
|
@ -130,7 +130,7 @@ namespace Server.Engines.Mahjong
|
|||
game.ResetWalls(state.Mobile);
|
||||
}
|
||||
|
||||
public static void ResetScores(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void ResetScores(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGameDealer(state.Mobile) != true)
|
||||
{
|
||||
|
|
@ -140,26 +140,26 @@ namespace Server.Engines.Mahjong
|
|||
game.Players.ResetScores(MahjongGame.BaseScore);
|
||||
}
|
||||
|
||||
public static void AssignDealer(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void AssignDealer(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGameDealer(state.Mobile) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int position = pvSrc.ReadByte();
|
||||
int position = reader.ReadByte();
|
||||
|
||||
game.Players.AssignDealer(position);
|
||||
}
|
||||
|
||||
public static void OpenSeat(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void OpenSeat(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGameDealer(state.Mobile) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int position = pvSrc.ReadByte();
|
||||
int position = reader.ReadByte();
|
||||
|
||||
if (game.Players.GetPlayer(position) == state.Mobile)
|
||||
{
|
||||
|
|
@ -169,98 +169,98 @@ namespace Server.Engines.Mahjong
|
|||
game.Players.OpenSeat(position);
|
||||
}
|
||||
|
||||
public static void ChangeOption(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void ChangeOption(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGameDealer(state.Mobile) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pvSrc.ReadInt16();
|
||||
pvSrc.ReadByte();
|
||||
reader.ReadInt16();
|
||||
reader.ReadByte();
|
||||
|
||||
int options = pvSrc.ReadByte();
|
||||
int options = reader.ReadByte();
|
||||
|
||||
game.ShowScores = (options & 0x1) != 0;
|
||||
game.SpectatorVision = (options & 0x2) != 0;
|
||||
}
|
||||
|
||||
public static void MoveWallBreakIndicator(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void MoveWallBreakIndicator(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGameDealer(state.Mobile) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int y = pvSrc.ReadInt16();
|
||||
int x = pvSrc.ReadInt16();
|
||||
int y = reader.ReadInt16();
|
||||
int x = reader.ReadInt16();
|
||||
|
||||
game.WallBreakIndicator.Move(new Point2D(x, y));
|
||||
}
|
||||
|
||||
public static void TogglePublicHand(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void TogglePublicHand(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGamePlayer(state.Mobile) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pvSrc.ReadInt16();
|
||||
pvSrc.ReadByte();
|
||||
reader.ReadInt16();
|
||||
reader.ReadByte();
|
||||
|
||||
var publicHand = pvSrc.ReadBoolean();
|
||||
var publicHand = reader.ReadBoolean();
|
||||
|
||||
game.Players.SetPublic(game.Players.GetPlayerIndex(state.Mobile), publicHand);
|
||||
}
|
||||
|
||||
public static void MoveTile(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void MoveTile(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGamePlayer(state.Mobile) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int number = pvSrc.ReadByte();
|
||||
int number = reader.ReadByte();
|
||||
|
||||
if (number < 0 || number >= game.Tiles.Length)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pvSrc.ReadByte(); // Current direction
|
||||
reader.ReadByte(); // Current direction
|
||||
|
||||
var direction = GetDirection(pvSrc.ReadByte());
|
||||
var direction = GetDirection(reader.ReadByte());
|
||||
|
||||
pvSrc.ReadByte();
|
||||
reader.ReadByte();
|
||||
|
||||
var flip = pvSrc.ReadBoolean();
|
||||
var flip = reader.ReadBoolean();
|
||||
|
||||
pvSrc.ReadInt16(); // Current Y
|
||||
pvSrc.ReadInt16(); // Current X
|
||||
reader.ReadInt16(); // Current Y
|
||||
reader.ReadInt16(); // Current X
|
||||
|
||||
pvSrc.ReadByte();
|
||||
reader.ReadByte();
|
||||
|
||||
int y = pvSrc.ReadInt16();
|
||||
int x = pvSrc.ReadInt16();
|
||||
int y = reader.ReadInt16();
|
||||
int x = reader.ReadInt16();
|
||||
|
||||
pvSrc.ReadByte();
|
||||
reader.ReadByte();
|
||||
|
||||
game.Tiles[number].Move(new Point2D(x, y), direction, flip, game.Players.GetPlayerIndex(state.Mobile));
|
||||
}
|
||||
|
||||
public static void MoveDealerIndicator(MahjongGame game, NetState state, PacketReader pvSrc)
|
||||
public static void MoveDealerIndicator(MahjongGame game, NetState state, PacketReader reader)
|
||||
{
|
||||
if (game?.Players.IsInGameDealer(state.Mobile) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var direction = GetDirection(pvSrc.ReadByte());
|
||||
var direction = GetDirection(reader.ReadByte());
|
||||
|
||||
var wind = GetWind(pvSrc.ReadByte());
|
||||
var wind = GetWind(reader.ReadByte());
|
||||
|
||||
int y = pvSrc.ReadInt16();
|
||||
int x = pvSrc.ReadInt16();
|
||||
int y = reader.ReadInt16();
|
||||
int x = reader.ReadInt16();
|
||||
|
||||
game.DealerIndicator.Move(new Point2D(x, y), direction, wind);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -334,20 +334,20 @@ namespace Server.Items
|
|||
PacketHandlers.Register(0x56, 11, true, OnMapCommand);
|
||||
}
|
||||
|
||||
private static void OnMapCommand(NetState state, PacketReader pvSrc)
|
||||
private static void OnMapCommand(NetState state, PacketReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
if (!(World.FindItem(pvSrc.ReadUInt32()) is MapItem map))
|
||||
if (!(World.FindItem(reader.ReadUInt32()) is MapItem map))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int command = pvSrc.ReadByte();
|
||||
int number = pvSrc.ReadByte();
|
||||
int command = reader.ReadByte();
|
||||
int number = reader.ReadByte();
|
||||
|
||||
int x = pvSrc.ReadInt16();
|
||||
int y = pvSrc.ReadInt16();
|
||||
int x = reader.ReadInt16();
|
||||
int y = reader.ReadInt16();
|
||||
|
||||
switch (command)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -232,13 +232,13 @@ namespace Server.Items
|
|||
PacketHandlers.Register(0x71, 0, true, BBClientRequest);
|
||||
}
|
||||
|
||||
public static void BBClientRequest(NetState state, PacketReader pvSrc)
|
||||
public static void BBClientRequest(NetState state, PacketReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
int packetID = pvSrc.ReadByte();
|
||||
int packetID = reader.ReadByte();
|
||||
|
||||
if (!(World.FindItem(pvSrc.ReadUInt32()) is BaseBulletinBoard board) || !board.CheckRange(from))
|
||||
if (!(World.FindItem(reader.ReadUInt32()) is BaseBulletinBoard board) || !board.CheckRange(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -246,23 +246,23 @@ namespace Server.Items
|
|||
switch (packetID)
|
||||
{
|
||||
case 3:
|
||||
BBRequestContent(from, board, pvSrc);
|
||||
BBRequestContent(from, board, reader);
|
||||
break;
|
||||
case 4:
|
||||
BBRequestHeader(from, board, pvSrc);
|
||||
BBRequestHeader(from, board, reader);
|
||||
break;
|
||||
case 5:
|
||||
BBPostMessage(from, board, pvSrc);
|
||||
BBPostMessage(from, board, reader);
|
||||
break;
|
||||
case 6:
|
||||
BBRemoveMessage(from, board, pvSrc);
|
||||
BBRemoveMessage(from, board, reader);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void BBRequestContent(Mobile from, BaseBulletinBoard board, PacketReader pvSrc)
|
||||
public static void BBRequestContent(Mobile from, BaseBulletinBoard board, PacketReader reader)
|
||||
{
|
||||
if (!(World.FindItem(pvSrc.ReadUInt32()) is BulletinMessage msg) || msg.Parent != board)
|
||||
if (!(World.FindItem(reader.ReadUInt32()) is BulletinMessage msg) || msg.Parent != board)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -270,9 +270,9 @@ namespace Server.Items
|
|||
from.Send(new BBMessageContent(board, msg));
|
||||
}
|
||||
|
||||
public static void BBRequestHeader(Mobile from, BaseBulletinBoard board, PacketReader pvSrc)
|
||||
public static void BBRequestHeader(Mobile from, BaseBulletinBoard board, PacketReader reader)
|
||||
{
|
||||
if (!(World.FindItem(pvSrc.ReadUInt32()) is BulletinMessage msg) || msg.Parent != board)
|
||||
if (!(World.FindItem(reader.ReadUInt32()) is BulletinMessage msg) || msg.Parent != board)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -280,9 +280,9 @@ namespace Server.Items
|
|||
from.Send(new BBMessageHeader(board, msg));
|
||||
}
|
||||
|
||||
public static void BBPostMessage(Mobile from, BaseBulletinBoard board, PacketReader pvSrc)
|
||||
public static void BBPostMessage(Mobile from, BaseBulletinBoard board, PacketReader reader)
|
||||
{
|
||||
var thread = World.FindItem(pvSrc.ReadUInt32()) as BulletinMessage;
|
||||
var thread = World.FindItem(reader.ReadUInt32()) as BulletinMessage;
|
||||
|
||||
if (thread != null && thread.Parent != board)
|
||||
{
|
||||
|
|
@ -315,14 +315,14 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
var subject = pvSrc.ReadUTF8StringSafe(pvSrc.ReadByte());
|
||||
var subject = reader.ReadUTF8StringSafe(reader.ReadByte());
|
||||
|
||||
if (subject.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var lines = new string[pvSrc.ReadByte()];
|
||||
var lines = new string[reader.ReadByte()];
|
||||
|
||||
if (lines.Length == 0)
|
||||
{
|
||||
|
|
@ -331,15 +331,15 @@ namespace Server.Items
|
|||
|
||||
for (var i = 0; i < lines.Length; ++i)
|
||||
{
|
||||
lines[i] = pvSrc.ReadUTF8StringSafe(pvSrc.ReadByte());
|
||||
lines[i] = reader.ReadUTF8StringSafe(reader.ReadByte());
|
||||
}
|
||||
|
||||
board.PostMessage(from, thread, subject, lines);
|
||||
}
|
||||
|
||||
public static void BBRemoveMessage(Mobile from, BaseBulletinBoard board, PacketReader pvSrc)
|
||||
public static void BBRemoveMessage(Mobile from, BaseBulletinBoard board, PacketReader reader)
|
||||
{
|
||||
if (!(World.FindItem(pvSrc.ReadUInt32()) is BulletinMessage msg) || msg.Parent != board)
|
||||
if (!(World.FindItem(reader.ReadUInt32()) is BulletinMessage msg) || msg.Parent != board)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,37 +142,37 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
public static void OnReceive(NetState state, PacketReader pvSrc)
|
||||
public static void OnReceive(NetState state, PacketReader reader)
|
||||
{
|
||||
pvSrc.ReadByte(); // 1: <4.0.1a, 2>=4.0.1a
|
||||
reader.ReadByte(); // 1: <4.0.1a, 2>=4.0.1a
|
||||
|
||||
var info = new HardwareInfo();
|
||||
|
||||
info.InstanceID = pvSrc.ReadInt32();
|
||||
info.OSMajor = pvSrc.ReadInt32();
|
||||
info.OSMinor = pvSrc.ReadInt32();
|
||||
info.OSRevision = pvSrc.ReadInt32();
|
||||
info.CpuManufacturer = pvSrc.ReadByte();
|
||||
info.CpuFamily = pvSrc.ReadInt32();
|
||||
info.CpuModel = pvSrc.ReadInt32();
|
||||
info.CpuClockSpeed = pvSrc.ReadInt32();
|
||||
info.CpuQuantity = pvSrc.ReadByte();
|
||||
info.PhysicalMemory = pvSrc.ReadInt32();
|
||||
info.ScreenWidth = pvSrc.ReadInt32();
|
||||
info.ScreenHeight = pvSrc.ReadInt32();
|
||||
info.ScreenDepth = pvSrc.ReadInt32();
|
||||
info.DXMajor = pvSrc.ReadInt16();
|
||||
info.DXMinor = pvSrc.ReadInt16();
|
||||
info.VCDescription = pvSrc.ReadUnicodeStringLESafe(64);
|
||||
info.VCVendorID = pvSrc.ReadInt32();
|
||||
info.VCDeviceID = pvSrc.ReadInt32();
|
||||
info.VCMemory = pvSrc.ReadInt32();
|
||||
info.Distribution = pvSrc.ReadByte();
|
||||
info.ClientsRunning = pvSrc.ReadByte();
|
||||
info.ClientsInstalled = pvSrc.ReadByte();
|
||||
info.PartialInstalled = pvSrc.ReadByte();
|
||||
info.Language = pvSrc.ReadUnicodeStringLESafe(4);
|
||||
info.Unknown = pvSrc.ReadStringSafe(64);
|
||||
info.InstanceID = reader.ReadInt32();
|
||||
info.OSMajor = reader.ReadInt32();
|
||||
info.OSMinor = reader.ReadInt32();
|
||||
info.OSRevision = reader.ReadInt32();
|
||||
info.CpuManufacturer = reader.ReadByte();
|
||||
info.CpuFamily = reader.ReadInt32();
|
||||
info.CpuModel = reader.ReadInt32();
|
||||
info.CpuClockSpeed = reader.ReadInt32();
|
||||
info.CpuQuantity = reader.ReadByte();
|
||||
info.PhysicalMemory = reader.ReadInt32();
|
||||
info.ScreenWidth = reader.ReadInt32();
|
||||
info.ScreenHeight = reader.ReadInt32();
|
||||
info.ScreenDepth = reader.ReadInt32();
|
||||
info.DXMajor = reader.ReadInt16();
|
||||
info.DXMinor = reader.ReadInt16();
|
||||
info.VCDescription = reader.ReadUnicodeStringLESafe(64);
|
||||
info.VCVendorID = reader.ReadInt32();
|
||||
info.VCDeviceID = reader.ReadInt32();
|
||||
info.VCMemory = reader.ReadInt32();
|
||||
info.Distribution = reader.ReadByte();
|
||||
info.ClientsRunning = reader.ReadByte();
|
||||
info.ClientsInstalled = reader.ReadByte();
|
||||
info.PartialInstalled = reader.ReadByte();
|
||||
info.Language = reader.ReadUnicodeStringLESafe(4);
|
||||
info.Unknown = reader.ReadStringSafe(64);
|
||||
|
||||
info.TimeReceived = DateTime.UtcNow;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
|
||||
private static void OnPartyTrack(NetState state, PacketReader pvSrc)
|
||||
private static void OnPartyTrack(NetState state, PacketReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var party = Party.Get(from);
|
||||
|
|
@ -36,13 +36,13 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
|
||||
private static void OnGuildTrack(NetState state, PacketReader pvSrc)
|
||||
private static void OnGuildTrack(NetState state, PacketReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
if (from.Guild is Guild guild)
|
||||
{
|
||||
var locations = pvSrc.ReadByte() != 0;
|
||||
var locations = reader.ReadByte() != 0;
|
||||
|
||||
var packet = new Packets.GuildTrack(from, guild, locations);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ namespace Server.Misc
|
|||
return null;
|
||||
}
|
||||
|
||||
public static void DecodeBundledPacket(NetState state, PacketReader pvSrc)
|
||||
public static void DecodeBundledPacket(NetState state, PacketReader reader)
|
||||
{
|
||||
int packetID = pvSrc.ReadByte();
|
||||
int packetID = reader.ReadByte();
|
||||
|
||||
var ph = GetHandler(packetID);
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ namespace Server.Misc
|
|||
}
|
||||
else
|
||||
{
|
||||
ph.OnReceive(state, pvSrc);
|
||||
ph.OnReceive(state, reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1010,7 +1010,7 @@ namespace Server.Multis
|
|||
}
|
||||
}
|
||||
|
||||
public static void Designer_Sync(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Sync(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
@ -1022,7 +1022,7 @@ namespace Server.Multis
|
|||
DesignContext.Find(from)?.Foundation.DesignState.SendDetailedInfoTo(state);
|
||||
}
|
||||
|
||||
public static void Designer_Clear(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Clear(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1054,7 +1054,7 @@ namespace Server.Multis
|
|||
newDesign.SendDetailedInfoTo(state);
|
||||
}
|
||||
|
||||
public static void Designer_Restore(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Restore(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1086,7 +1086,7 @@ namespace Server.Multis
|
|||
backupDesign.SendDetailedInfoTo(state);
|
||||
}
|
||||
|
||||
public static void Designer_Backup(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Backup(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1108,7 +1108,7 @@ namespace Server.Multis
|
|||
context.Foundation.BackupState = copyState;
|
||||
}
|
||||
|
||||
public static void Designer_Revert(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Revert(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1268,7 +1268,7 @@ namespace Server.Multis
|
|||
RestoreRelocatedEntities();
|
||||
}
|
||||
|
||||
public static void Designer_Commit(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Commit(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1474,7 +1474,7 @@ namespace Server.Multis
|
|||
return true;
|
||||
}
|
||||
|
||||
public static void Designer_Delete(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Delete(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1493,10 +1493,10 @@ namespace Server.Multis
|
|||
*/
|
||||
|
||||
// Read data detailing which component to delete
|
||||
var itemID = pvSrc.ReadInt32();
|
||||
var x = pvSrc.ReadInt32();
|
||||
var y = pvSrc.ReadInt32();
|
||||
var z = pvSrc.ReadInt32();
|
||||
var itemID = reader.ReadInt32();
|
||||
var x = reader.ReadInt32();
|
||||
var y = reader.ReadInt32();
|
||||
var z = reader.ReadInt32();
|
||||
|
||||
// Verify component is deletable
|
||||
var design = context.Foundation.DesignState;
|
||||
|
|
@ -1564,7 +1564,7 @@ namespace Server.Multis
|
|||
}
|
||||
}
|
||||
|
||||
public static void Designer_Stairs(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Stairs(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1584,9 +1584,9 @@ namespace Server.Multis
|
|||
*/
|
||||
|
||||
// Read data detailing stair type and location
|
||||
var itemID = pvSrc.ReadInt32();
|
||||
var x = pvSrc.ReadInt32();
|
||||
var y = pvSrc.ReadInt32();
|
||||
var itemID = reader.ReadInt32();
|
||||
var x = reader.ReadInt32();
|
||||
var y = reader.ReadInt32();
|
||||
|
||||
// Validate stair multi ID
|
||||
var design = context.Foundation.DesignState;
|
||||
|
|
@ -1639,7 +1639,7 @@ namespace Server.Multis
|
|||
}
|
||||
}
|
||||
|
||||
public static void Designer_Build(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Build(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1656,9 +1656,9 @@ namespace Server.Multis
|
|||
*/
|
||||
|
||||
// Read data detailing component graphic and location
|
||||
var itemID = pvSrc.ReadInt32();
|
||||
var x = pvSrc.ReadInt32();
|
||||
var y = pvSrc.ReadInt32();
|
||||
var itemID = reader.ReadInt32();
|
||||
var x = reader.ReadInt32();
|
||||
var y = reader.ReadInt32();
|
||||
|
||||
// Add component
|
||||
var design = context.Foundation.DesignState;
|
||||
|
|
@ -1685,7 +1685,7 @@ namespace Server.Multis
|
|||
design.OnRevised();
|
||||
}
|
||||
|
||||
public static void Designer_Close(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Close(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1734,7 +1734,7 @@ namespace Server.Multis
|
|||
context.Foundation.RestoreRelocatedEntities();
|
||||
}
|
||||
|
||||
public static void Designer_Level(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Level(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1754,7 +1754,7 @@ namespace Server.Multis
|
|||
*/
|
||||
|
||||
// Read data detailing the target level
|
||||
var newLevel = pvSrc.ReadInt32();
|
||||
var newLevel = reader.ReadInt32();
|
||||
|
||||
// Validate target level
|
||||
if (newLevel < 1 || newLevel > context.MaxLevels)
|
||||
|
|
@ -1772,11 +1772,11 @@ namespace Server.Multis
|
|||
context.Foundation.SendInfoTo(state);
|
||||
}
|
||||
|
||||
public static void QueryDesignDetails(NetState state, PacketReader pvSrc)
|
||||
public static void QueryDesignDetails(NetState state, PacketReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
if (World.FindItem(pvSrc.ReadUInt32()) is HouseFoundation foundation && from.Map == foundation.Map &&
|
||||
if (World.FindItem(reader.ReadUInt32()) is HouseFoundation foundation && from.Map == foundation.Map &&
|
||||
from.InRange(foundation.GetWorldLocation(), 24) &&
|
||||
from.CanSee(foundation))
|
||||
{
|
||||
|
|
@ -1787,7 +1787,7 @@ namespace Server.Multis
|
|||
}
|
||||
}
|
||||
|
||||
public static void Designer_Roof(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_Roof(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1798,10 +1798,10 @@ namespace Server.Multis
|
|||
}
|
||||
|
||||
// Read data detailing component graphic and location
|
||||
var itemID = pvSrc.ReadInt32();
|
||||
var x = pvSrc.ReadInt32();
|
||||
var y = pvSrc.ReadInt32();
|
||||
var z = pvSrc.ReadInt32();
|
||||
var itemID = reader.ReadInt32();
|
||||
var x = reader.ReadInt32();
|
||||
var y = reader.ReadInt32();
|
||||
var z = reader.ReadInt32();
|
||||
|
||||
// Add component
|
||||
var design = context.Foundation.DesignState;
|
||||
|
|
@ -1841,7 +1841,7 @@ namespace Server.Multis
|
|||
design.OnRevised();
|
||||
}
|
||||
|
||||
public static void Designer_RoofDelete(NetState state, IEntity e, EncodedReader pvSrc)
|
||||
public static void Designer_RoofDelete(NetState state, IEntity e, EncodedReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
var context = DesignContext.Find(from);
|
||||
|
|
@ -1853,10 +1853,10 @@ namespace Server.Multis
|
|||
}
|
||||
|
||||
// Read data detailing which component to delete
|
||||
var itemID = pvSrc.ReadInt32();
|
||||
var x = pvSrc.ReadInt32();
|
||||
var y = pvSrc.ReadInt32();
|
||||
var z = pvSrc.ReadInt32();
|
||||
var itemID = reader.ReadInt32();
|
||||
var x = reader.ReadInt32();
|
||||
var y = reader.ReadInt32();
|
||||
var z = reader.ReadInt32();
|
||||
|
||||
// Verify component is deletable
|
||||
var design = context.Foundation.DesignState;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue