Ignore:
Timestamp:
Apr 6, 2021, 8:11:02 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Merged trunk branch version r348 into highdpi branch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/GameServer.pas

    r303 r349  
    1515  FirstBookCompatibleVersion = $010103;
    1616
    17   // notifications
    18   ntCreateWorld = 0;
    19   ntInitModule = $100;
    20   ntInitLocalHuman = $1FF;
    21   ntDLLError = $200;
    22   ntAIError = $2FF;
    23   ntClientError = $300;
    24   ntInitPlayers = $400;
    25   ntDeactivationMissing = $410;
    26   ntSetAIName = $420;
    27   ntException = $500;
    28   ntLoadBegin = $600;
    29   ntLoadState = $601;
    30   ntEndInfo = $6FC;
    31   ntBackOn = $6FD;
    32   ntBackOff = $6FE;
    33   ntLoadError = $6FF;
    34   ntStartDone = $700;
    35   ntStartGo = $701;
    36   ntStartGoRefresh = $702;
    37   ntStartGoRefreshMaps = $703;
    38   ntChangeClient = $800;
    39   ntNextPlayer = $810;
    40   ntDeinitModule = $900;
    41 
    4217  // module flags
    4318  fMultiple = $10000000;
     
    4520  fUsed = $40000000;
    4621
    47   // save map tile flags
    48   smOwned = $20;
    49   smUnit = $40;
    50   smCity = $80;
    51 
    5222  maxBrain = 255;
    5323
    5424type
    55   TNotifyFunction = procedure(ID: integer);
     25  // notifications
     26  TNotify = (
     27    ntCreateWorld,
     28    ntInitModule,
     29    ntInitLocalHuman,
     30    ntDLLError,
     31    ntAIError,
     32    ntClientError,
     33    ntInitPlayers,
     34    ntDeactivationMissing,
     35    ntSetAIName,
     36    ntException,
     37    ntLoadBegin,
     38    ntLoadState,
     39    ntEndInfo,
     40    ntBackOn,
     41    ntBackOff,
     42    ntLoadError,
     43    ntStartDone,
     44    ntStartGo,
     45    ntStartGoRefresh,
     46    ntStartGoRefreshMaps,
     47    ntChangeClient,
     48    ntNextPlayer,
     49    ntDeinitModule
     50  );
     51
     52  TNotifyFunction = procedure(ID: TNotify; Index: Integer = 0);
    5653
    5754  TBrainType = (btNoTerm, btSuperVirtual, btTerm, btRandom, btAI);
     
    370367    (CCPlayer < 0) then
    371368  begin
    372     Notify(ntDeactivationMissing + p);
     369    Notify(ntDeactivationMissing, p);
    373370    ForceClientDeactivation;
    374371  end
     
    518515    if Kind = btAI then
    519516    begin { get client function }
    520       Notify(ntInitModule + Brains.IndexOf(bix));
     517      Notify(ntInitModule, Brains.IndexOf(bix));
    521518      if Flags and fDotNet > 0 then
    522519        Client := DotNetClient
     
    527524        begin
    528525          Client := nil;
    529           Notify(ntDLLError + Brains.IndexOf(bix));
     526          Notify(ntDLLError, Brains.IndexOf(bix));
    530527        end
    531528        else
     
    533530          Client := GetProcAddress(hm, 'client');
    534531          if @Client = nil then
    535             Notify(ntClientError + Brains.IndexOf(bix));
    536         end
    537       end
     532            Notify(ntClientError, Brains.IndexOf(bix));
     533        end;
     534      end;
    538535    end;
    539536    if @Client <> nil then
     
    550547        DataSize := 0;
    551548      Flags := Flags or InitModuleData.Flags;
    552     end
    553   end
     549    end;
     550  end;
    554551end;
    555552
     
    586583  MapFile := nil;
    587584  try
    588     MapFile := TFileStream.Create(GetMapsDir + DirectorySeparator + FileName,
    589       fmOpenRead or fmShareExclusive);
     585    MapFile := TFileStream.Create(FileName, fmOpenRead or fmShareExclusive);
    590586    MapFile.Position := 0;
    591587    MapFile.read(s[1], 8); { file id }
     
    735731  if bix[0].Kind <> btNoTerm then
    736732    Notify(ntInitLocalHuman);
     733
    737734  BrainUsed := [];
    738735  for p := 0 to nPl - 1 do
     
    793790
    794791  GTurn := 0;
    795   for i := 0 to 27 do
     792  for i := 0 to nWonder - 1 do
    796793    with GWonder[i] do
    797794    begin
     
    960957        else
    961958          NotifyMessage := '';
    962         Notify(ntSetAIName + p1);
    963       end
     959        Notify(ntSetAIName, p1);
     960      end;
    964961  end;
    965962
     
    12831280    end;
    12841281    if not MovieMode then
    1285       Notify(ntLoadState + CL.Progress * 128 div 1000);
     1282      Notify(ntLoadState, CL.Progress * 128 div 1000);
    12861283  end;
    12871284
     
    32553252            begin
    32563253              if Brains[i].Kind = btAI then
    3257                 Notify(ntDeinitModule + i);
     3254                Notify(ntDeinitModule, i);
    32583255              CallClient(i, cBreakGame, nil^);
    32593256            end;
     
    42174214                else if built[NewProject and cpIndex] > 0 then
    42184215                  result := eInvalid
    4219                 else if (NewProject and cpIndex < 28) and
    4220                   (GWonder[NewProject and cpIndex].CityID <> -1) then
     4216                else if (NewProject and cpIndex < nWonder) and
     4217                  (GWonder[NewProject and cpIndex].CityID <> WonderNotBuiltYet) then
    42214218                  result := eViolation // wonder already exists
    42224219                else if (NewProject and cpIndex = imSpacePort) and
Note: See TracChangeset for help on using the changeset viewer.