Changeset 369


Ignore:
Timestamp:
Apr 14, 2021, 3:49:11 PM (7 months ago)
Author:
chronos
Message:
  • Fixed: Build under Windows. fpAsync and fpSock are not supported under Windows. Networking needs to be replaced by something else multi-platform.
Location:
trunk/Network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Network/UNetworkClient.pas

    r365 r369  
    66
    77uses
    8   Classes, SysUtils, fpsock, fpAsync, Protocol;
     8  Classes, SysUtils{$IFDEF LINUX}, fpAsync, fpsock{$ENDIF}, Protocol;
    99
     10{$IFDEF LINUX}
    1011type
    1112  { TTCPClientThread }
     
    3940var
    4041  NetworkClient: TNetworkClient;
     42{$ENDIF}
    4143
    4244procedure Client(Command, Player: Integer; var Data); stdcall;
     
    4850  LocalPlayer, Global, UNetworkCommon;
    4951
    50 function LocalServer(Command, Player, Subject: Integer; var Data): Integer; stdcall;
    51 begin
    52   if Assigned(NetworkClient) then
    53     Result := NetworkClient.Server(TCommand(Command), Player, Subject, Data);
    54 end;
    55 
    5652procedure Client(Command, Player: Integer; var Data);
    5753var
    5854  Cmd: TCommand;
    5955begin
     56  {$IFDEF LINUX}
    6057  Cmd := TCommand(Command);
    6158  case Cmd of
     
    7168    end;
    7269  end;
     70  {$ENDIF}
     71end;
     72
     73{$IFDEF LINUX}
     74function LocalServer(Command, Player, Subject: Integer; var Data): Integer; stdcall;
     75begin
     76  if Assigned(NetworkClient) then
     77    Result := NetworkClient.Server(TCommand(Command), Player, Subject, Data);
    7378end;
    7479
     
    167172  inherited;
    168173end;
     174{$ENDIF}
    169175
    170176end.
  • trunk/Network/UNetworkServer.pas

    r367 r369  
    66
    77uses
    8   Classes, SysUtils, fgl, fpAsync, fpsock, Protocol, fphttpclient;
    9 
     8  Classes, SysUtils, fgl{$IFDEF LINUX}, fpAsync, fpsock{$ENDIF}, Protocol, fphttpclient;
     9
     10{$IFDEF LINUX}
    1011type
    1112  TNetworkServer = class;
     
    7980var
    8081  NetworkServer: TNetworkServer;
     82{$ENDIF}
    8183
    8284procedure Client(Command, Player: integer; var Data); stdcall;
     
    9092procedure Client(Command, Player: integer; var Data);
    9193begin
     94  {$IFDEF LINUX}
    9295  if not Assigned(NetworkServer) then begin
    9396    NetworkServer := TNetworkServer.Create;
     
    99102  end;
    100103  NetworkServer.Client(TCommand(Command), Player, Data);
    101 end;
     104  {$ENDIF}
     105end;
     106
     107{$IFDEF LINUX}
    102108
    103109{ TNetworkServerPlayers }
     
    327333end;
    328334
     335{$ENDIF}
     336
    329337end.
    330338
Note: See TracChangeset for help on using the changeset viewer.