Changeset 349 for branches/highdpi/GameServer.pas
- Timestamp:
- Apr 6, 2021, 8:11:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/GameServer.pas
r303 r349 15 15 FirstBookCompatibleVersion = $010103; 16 16 17 // notifications18 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 42 17 // module flags 43 18 fMultiple = $10000000; … … 45 20 fUsed = $40000000; 46 21 47 // save map tile flags48 smOwned = $20;49 smUnit = $40;50 smCity = $80;51 52 22 maxBrain = 255; 53 23 54 24 type 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); 56 53 57 54 TBrainType = (btNoTerm, btSuperVirtual, btTerm, btRandom, btAI); … … 370 367 (CCPlayer < 0) then 371 368 begin 372 Notify(ntDeactivationMissing +p);369 Notify(ntDeactivationMissing, p); 373 370 ForceClientDeactivation; 374 371 end … … 518 515 if Kind = btAI then 519 516 begin { get client function } 520 Notify(ntInitModule +Brains.IndexOf(bix));517 Notify(ntInitModule, Brains.IndexOf(bix)); 521 518 if Flags and fDotNet > 0 then 522 519 Client := DotNetClient … … 527 524 begin 528 525 Client := nil; 529 Notify(ntDLLError +Brains.IndexOf(bix));526 Notify(ntDLLError, Brains.IndexOf(bix)); 530 527 end 531 528 else … … 533 530 Client := GetProcAddress(hm, 'client'); 534 531 if @Client = nil then 535 Notify(ntClientError +Brains.IndexOf(bix));536 end 537 end 532 Notify(ntClientError, Brains.IndexOf(bix)); 533 end; 534 end; 538 535 end; 539 536 if @Client <> nil then … … 550 547 DataSize := 0; 551 548 Flags := Flags or InitModuleData.Flags; 552 end 553 end 549 end; 550 end; 554 551 end; 555 552 … … 586 583 MapFile := nil; 587 584 try 588 MapFile := TFileStream.Create(GetMapsDir + DirectorySeparator + FileName, 589 fmOpenRead or fmShareExclusive); 585 MapFile := TFileStream.Create(FileName, fmOpenRead or fmShareExclusive); 590 586 MapFile.Position := 0; 591 587 MapFile.read(s[1], 8); { file id } … … 735 731 if bix[0].Kind <> btNoTerm then 736 732 Notify(ntInitLocalHuman); 733 737 734 BrainUsed := []; 738 735 for p := 0 to nPl - 1 do … … 793 790 794 791 GTurn := 0; 795 for i := 0 to 27do792 for i := 0 to nWonder - 1 do 796 793 with GWonder[i] do 797 794 begin … … 960 957 else 961 958 NotifyMessage := ''; 962 Notify(ntSetAIName +p1);963 end 959 Notify(ntSetAIName, p1); 960 end; 964 961 end; 965 962 … … 1283 1280 end; 1284 1281 if not MovieMode then 1285 Notify(ntLoadState +CL.Progress * 128 div 1000);1282 Notify(ntLoadState, CL.Progress * 128 div 1000); 1286 1283 end; 1287 1284 … … 3255 3252 begin 3256 3253 if Brains[i].Kind = btAI then 3257 Notify(ntDeinitModule +i);3254 Notify(ntDeinitModule, i); 3258 3255 CallClient(i, cBreakGame, nil^); 3259 3256 end; … … 4217 4214 else if built[NewProject and cpIndex] > 0 then 4218 4215 result := eInvalid 4219 else if (NewProject and cpIndex < 28) and4220 (GWonder[NewProject and cpIndex].CityID <> -1) then4216 else if (NewProject and cpIndex < nWonder) and 4217 (GWonder[NewProject and cpIndex].CityID <> WonderNotBuiltYet) then 4221 4218 result := eViolation // wonder already exists 4222 4219 else if (NewProject and cpIndex = imSpacePort) and
Note:
See TracChangeset
for help on using the changeset viewer.