Changeset 196 for trunk/UCore.pas
- Timestamp:
- May 16, 2018, 9:56:24 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r195 r196 9 9 UGame, UApplicationInfo, UPersistentForm, UScaleDPI, UCoolTranslator, 10 10 URegistry, ULastOpenedList, Registry, Menus, UGeometry, UFormClient, 11 UGameServer, UGameClient, fgl ;11 UGameServer, UGameClient, fgl, UServerList; 12 12 13 13 type … … 91 91 FormClients: TFPGObjectList<TFormClient>; 92 92 Clients: TClients; 93 ServerList: TServerList; 93 94 procedure Spectate(Player: TPlayer); 94 95 procedure UpdateActions; 95 96 procedure Init; 97 procedure Done; 96 98 property Initialized: Boolean read FInitialized; 97 99 end; … … 295 297 try 296 298 FormNew.Load(Server); 299 FormNew.ServerList := ServerList; 297 300 if FormNew.ShowModal = mrOk then begin 298 301 FormNew.Save(Server); … … 392 395 ForceDirectories(GetAppConfigDir(False)); 393 396 FormClients := TFPGObjectList<TFormClient>.Create; 397 ServerList := TServerList.Create; 394 398 end; 395 399 396 400 procedure TCore.DataModuleDestroy(Sender: TObject); 397 401 begin 402 FreeAndNil(ServerList); 398 403 if Assigned(FormPlayersStats) then FreeAndNil(FormPlayersStats); 399 404 if Assigned(FormUnitMoves) then FreeAndNil(FormUnitMoves); … … 401 406 FreeAndNil(FormClients); 402 407 FreeAndNil(StoredDimension); 403 Game.SaveConfig(XMLConfig1, 'Game');404 Server.SaveConfig(XMLConfig1, 'Server');405 SaveConfig;406 408 FreeAndNil(Server); 407 409 FreeAndNil(Game); … … 546 548 Game.LoadConfig(XMLConfig1, 'Game'); 547 549 Server.LoadConfig(XMLConfig1, 'Server'); 550 ServerList.LoadConfig(XmlConfig1, 'ServerList'); 548 551 549 552 CommandLineParams; … … 556 559 end; 557 560 561 procedure TCore.Done; 562 begin 563 Game.SaveConfig(XMLConfig1, 'Game'); 564 Server.SaveConfig(XMLConfig1, 'Server'); 565 ServerList.SaveConfig(XmlConfig1, 'ServerList'); 566 SaveConfig; 567 XMLConfig1.Flush; 568 end; 569 558 570 end. 559 571
Note:
See TracChangeset
for help on using the changeset viewer.