From d0557ab86f1af5812ec59a3efbbb94ccadc5334a Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 27 Nov 2013 20:15:33 +0100 Subject: [PATCH] * More UMapManagement --- Server/UMapManagement.pas | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Server/UMapManagement.pas b/Server/UMapManagement.pas index 75e647c..c0d06b8 100644 --- a/Server/UMapManagement.pas +++ b/Server/UMapManagement.pas @@ -30,7 +30,7 @@ unit UMapManagement; interface uses - Classes, SysUtils, UPacket, UInterfaces, UXmlHelper, + Classes, SysUtils, UPacket, UInterfaces, UXmlHelper, UEnhancedMemoryStream, DOM, fgl; type @@ -43,6 +43,7 @@ type FName: String; FPath: String; FDescription: String; + procedure WriteToStream(AStream: TEnhancedMemoryStream); public constructor Create(AOwner: IInvalidate); constructor Deserialize(AOwner: IInvalidate; AElement: TDOMElement); @@ -66,10 +67,25 @@ type function Remove(const Item: TMapState): Integer; end; + //Network + + { TMapStateListPacket } + + TMapStateListPacket = class(TPacket) + constructor Create(AMapStates: TMapStates); + end; + implementation { TMapState } +procedure TMapState.WriteToStream(AStream: TEnhancedMemoryStream); +begin + AStream.WriteStringNull(FName); + AStream.WriteStringNull(FPath); + AStream.WriteStringNull(FDescription); +end; + constructor TMapState.Create(AOwner: IInvalidate); begin inherited Create; @@ -149,5 +165,13 @@ begin Invalidate; end; +{ TMapStateListPacket } + +constructor TMapStateListPacket.Create(AMapStates: TMapStates); +begin + inherited Create($0F, 0); + FStream.WriteByte($01); +end; + end.