Changeset 465 for branches/highdpi/Network/NetworkServer.pas
- Timestamp:
- Nov 30, 2023, 10:16:14 PM (12 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Network/NetworkServer.pas
r464 r465 1 unit UNetworkServer; 2 3 {$mode delphi} 1 unit NetworkServer; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils{$IFDEF LINUX}, fgl, fpAsync, fpsock, fphttpclient{$ENDIF}, Protocol; 9 10 {$IFDEF LINUX} 6 Classes, SysUtils{$IFDEF UNIX}, Generics.Collections, fpAsync, fpsock, 7 fphttpclient{$ENDIF}, Protocol; 8 9 {$IFDEF UNIX} 11 10 type 12 11 TNetworkServer = class; … … 57 56 { TNetworkServerPlayers } 58 57 59 TNetworkServerPlayers = class(T FPGObjectList<TNetworkServerPlayer>)58 TNetworkServerPlayers = class(TObjectList<TNetworkServerPlayer>) 60 59 function SearchById(Id: Integer): TNetworkServerPlayer; 61 60 end; … … 66 65 private 67 66 Players: TNetworkServerPlayers; 68 Connections: T FPGObjectList<TNetworkServerConnection>;67 Connections: TObjectList<TNetworkServerConnection>; 69 68 TCPServerThread: TTCPServerThread; 70 69 ServerEventLoop: TEventLoop; 71 70 procedure ConnectExecute(Sender: TConnectionBasedSocket; AStream: TSocketStream); 72 procedure Client(Command: TCommand; Player: integer; var Data);71 procedure Client(Command: TCommand; Player: Integer; var Data); 73 72 public 74 73 TCPServer: TTCPServer; … … 82 81 {$ENDIF} 83 82 84 procedure Client(Command, Player: integer; var Data); stdcall;83 procedure Client(Command, Player: Integer; var Data); stdcall; 85 84 86 85 87 86 implementation 88 87 89 {$IFDEF LINUX}88 {$IFDEF UNIX} 90 89 uses 91 Global, UNetworkCommon;90 Global, NetworkCommon; 92 91 {$ENDIF} 93 92 94 procedure Client(Command, Player: integer; var Data);95 begin 96 {$IFDEF LINUX}93 procedure Client(Command, Player: Integer; var Data); 94 begin 95 {$IFDEF UNIX} 97 96 if not Assigned(NetworkServer) then begin 98 97 NetworkServer := TNetworkServer.Create; … … 107 106 end; 108 107 109 {$IFDEF LINUX}108 {$IFDEF UNIX} 110 109 111 110 { TNetworkServerPlayers } … … 304 303 Players := TNetworkServerPlayers.Create; 305 304 ServerEventLoop := TEventLoop.Create; 306 Connections := T FPGObjectList<TNetworkServerConnection>.Create;305 Connections := TObjectList<TNetworkServerConnection>.Create; 307 306 TCPServer := TTCPServer.Create(nil); 308 307 with TCPServer do begin … … 339 338 end. 340 339 340
Note:
See TracChangeset
for help on using the changeset viewer.