Changeset 336 for trunk/GameServer.pas


Ignore:
Timestamp:
Mar 31, 2021, 10:49:44 PM (3 years ago)
Author:
chronos
Message:
  • Modify: Change Notify function to have separate enumeration type and integer value. Previously was combined into single integer.
  • Fixed: Paint correctly loading progress dialog on Linux.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GameServer.pas

    r328 r336  
    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;
     
    4823
    4924type
    50   TNotifyFunction = procedure(ID: integer);
     25  // notifications
     26  TNotify = (
     27    ntCreateWorld = 0,
     28    ntInitModule = $100,
     29    ntInitLocalHuman = $1FF,
     30    ntDLLError = $200,
     31    ntAIError = $2FF,
     32    ntClientError = $300,
     33    ntInitPlayers = $400,
     34    ntDeactivationMissing = $410,
     35    ntSetAIName = $420,
     36    ntException = $500,
     37    ntLoadBegin = $600,
     38    ntLoadState = $601,
     39    ntEndInfo = $6FC,
     40    ntBackOn = $6FD,
     41    ntBackOff = $6FE,
     42    ntLoadError = $6FF,
     43    ntStartDone = $700,
     44    ntStartGo = $701,
     45    ntStartGoRefresh = $702,
     46    ntStartGoRefreshMaps = $703,
     47    ntChangeClient = $800,
     48    ntNextPlayer = $810,
     49    ntDeinitModule = $900
     50  );
     51
     52  TNotifyFunction = procedure(ID: TNotify; Index: Integer = 0);
    5153
    5254  TBrainType = (btNoTerm, btSuperVirtual, btTerm, btRandom, btAI);
     
    365367    (CCPlayer < 0) then
    366368  begin
    367     Notify(ntDeactivationMissing + p);
     369    Notify(ntDeactivationMissing, p);
    368370    ForceClientDeactivation;
    369371  end
     
    513515    if Kind = btAI then
    514516    begin { get client function }
    515       Notify(ntInitModule + Brains.IndexOf(bix));
     517      Notify(ntInitModule, Brains.IndexOf(bix));
    516518      if Flags and fDotNet > 0 then
    517519        Client := DotNetClient
     
    522524        begin
    523525          Client := nil;
    524           Notify(ntDLLError + Brains.IndexOf(bix));
     526          Notify(ntDLLError, Brains.IndexOf(bix));
    525527        end
    526528        else
     
    528530          Client := GetProcAddress(hm, 'client');
    529531          if @Client = nil then
    530             Notify(ntClientError + Brains.IndexOf(bix));
    531         end
    532       end
     532            Notify(ntClientError, Brains.IndexOf(bix));
     533        end;
     534      end;
    533535    end;
    534536    if @Client <> nil then
     
    545547        DataSize := 0;
    546548      Flags := Flags or InitModuleData.Flags;
    547     end
    548   end
     549    end;
     550  end;
    549551end;
    550552
     
    730732  if bix[0].Kind <> btNoTerm then
    731733    Notify(ntInitLocalHuman);
     734
    732735  BrainUsed := [];
    733736  for p := 0 to nPl - 1 do
     
    955958        else
    956959          NotifyMessage := '';
    957         Notify(ntSetAIName + p1);
    958       end
     960        Notify(ntSetAIName, p1);
     961      end;
    959962  end;
    960963
     
    12781281    end;
    12791282    if not MovieMode then
    1280       Notify(ntLoadState + CL.Progress * 128 div 1000);
     1283      Notify(ntLoadState, CL.Progress * 128 div 1000);
    12811284  end;
    12821285
     
    32503253            begin
    32513254              if Brains[i].Kind = btAI then
    3252                 Notify(ntDeinitModule + i);
     3255                Notify(ntDeinitModule, i);
    32533256              CallClient(i, cBreakGame, nil^);
    32543257            end;
Note: See TracChangeset for help on using the changeset viewer.