Ignore:
Timestamp:
Nov 30, 2023, 10:16:14 PM (12 months ago)
Author:
chronos
Message:
  • Modified: Updated high dpi branch from trunk.
  • Modified: Use generics.collections instead of fgl.
  • Modified: Compile with Delphi syntax.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Network/NetworkServer.pas

    r464 r465  
    1 unit UNetworkServer;
    2 
    3 {$mode delphi}
     1unit NetworkServer;
    42
    53interface
    64
    75uses
    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}
    1110type
    1211  TNetworkServer = class;
     
    5756  { TNetworkServerPlayers }
    5857
    59   TNetworkServerPlayers = class(TFPGObjectList<TNetworkServerPlayer>)
     58  TNetworkServerPlayers = class(TObjectList<TNetworkServerPlayer>)
    6059    function SearchById(Id: Integer): TNetworkServerPlayer;
    6160  end;
     
    6665  private
    6766    Players: TNetworkServerPlayers;
    68     Connections: TFPGObjectList<TNetworkServerConnection>;
     67    Connections: TObjectList<TNetworkServerConnection>;
    6968    TCPServerThread: TTCPServerThread;
    7069    ServerEventLoop: TEventLoop;
    7170    procedure ConnectExecute(Sender: TConnectionBasedSocket; AStream: TSocketStream);
    72     procedure Client(Command: TCommand; Player: integer; var Data);
     71    procedure Client(Command: TCommand; Player: Integer; var Data);
    7372  public
    7473    TCPServer: TTCPServer;
     
    8281{$ENDIF}
    8382
    84 procedure Client(Command, Player: integer; var Data); stdcall;
     83procedure Client(Command, Player: Integer; var Data); stdcall;
    8584
    8685
    8786implementation
    8887
    89 {$IFDEF LINUX}
     88{$IFDEF UNIX}
    9089uses
    91   Global, UNetworkCommon;
     90  Global, NetworkCommon;
    9291{$ENDIF}
    9392
    94 procedure Client(Command, Player: integer; var Data);
    95 begin
    96   {$IFDEF LINUX}
     93procedure Client(Command, Player: Integer; var Data);
     94begin
     95  {$IFDEF UNIX}
    9796  if not Assigned(NetworkServer) then begin
    9897    NetworkServer := TNetworkServer.Create;
     
    107106end;
    108107
    109 {$IFDEF LINUX}
     108{$IFDEF UNIX}
    110109
    111110{ TNetworkServerPlayers }
     
    304303  Players := TNetworkServerPlayers.Create;
    305304  ServerEventLoop := TEventLoop.Create;
    306   Connections := TFPGObjectList<TNetworkServerConnection>.Create;
     305  Connections := TObjectList<TNetworkServerConnection>.Create;
    307306  TCPServer := TTCPServer.Create(nil);
    308307  with TCPServer do begin
     
    339338end.
    340339
     340
Note: See TracChangeset for help on using the changeset viewer.