Changeset 367 for trunk/GameServer.pas
- Timestamp:
- Apr 14, 2021, 9:12:03 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GameServer.pas
r365 r367 64 64 BrainNetworkClient: TBrain; 65 65 BrainNetworkServer: TBrain; 66 67 NetworkEnabled: Boolean; 66 68 67 69 procedure Init(NotifyFunction: TNotifyFunction); … … 157 159 end; 158 160 161 procedure CallAllPlayers(Command: Integer; var Data); 162 var 163 I: Integer; 164 begin 165 for I := 0 to nPl - 1 do 166 if Assigned(bix[I]) then 167 CallPlayer(Command, I, Data); 168 end; 169 159 170 procedure CallClient(bix, Command: integer; var Data); 160 171 begin … … 208 219 BrainSuperVirtual.Initialized := False; 209 220 BrainSuperVirtual.Kind := btSuperVirtual; 210 BrainNetworkClient := Brains.AddNew; 211 BrainNetworkClient.FileName := ':NetworkClient'; 212 BrainNetworkClient.Flags := fMultiple; 213 BrainNetworkClient.Initialized := False; 214 BrainNetworkClient.ServerVersion := Version; 215 BrainNetworkClient.Kind := btNetworkClient; 221 if NetworkEnabled then begin 222 BrainNetworkClient := Brains.AddNew; 223 BrainNetworkClient.FileName := ':NetworkClient'; 224 BrainNetworkClient.Flags := fMultiple; 225 BrainNetworkClient.Initialized := False; 226 BrainNetworkClient.ServerVersion := Version; 227 BrainNetworkClient.Kind := btNetworkClient; 228 end; 216 229 BrainTerm := Brains.AddNew; 217 230 BrainTerm.FileName := ':StdIntf'; … … 225 238 BrainRandom.Initialized := False; 226 239 BrainRandom.Kind := btRandom; 227 BrainNetworkServer := Brains.AddNew; 228 BrainNetworkServer.FileName := ':NetworkServer'; 229 BrainNetworkServer.Flags := fMultiple; 230 BrainNetworkServer.Initialized := False; 231 BrainNetworkServer.ServerVersion := Version; 232 BrainNetworkServer.Kind := btNetworkServer; 240 if NetworkEnabled then begin 241 BrainNetworkServer := Brains.AddNew; 242 BrainNetworkServer.FileName := ':NetworkServer'; 243 BrainNetworkServer.Flags := fMultiple; 244 BrainNetworkServer.Initialized := False; 245 BrainNetworkServer.ServerVersion := Version; 246 BrainNetworkServer.Kind := btNetworkServer; 247 end; 233 248 234 249 if FindFirst(GetAiDir + DirectorySeparator + '*', faDirectory or faArchive or faReadOnly, f) = 0 then … … 1330 1345 begin 1331 1346 CL.State := FormerCLState; 1332 Break 1333 end 1347 Break; 1348 end; 1334 1349 end; 1335 1350 {$IFOPT O-}InvalidTreatyMap := 0; {$ENDIF} … … 1339 1354 Newlx, Newly, NewLandMass, NewMaxTurn: integer); 1340 1355 var 1341 p: integer;1356 I: Integer; 1342 1357 begin 1343 1358 Notify(ntStartDone); … … 1364 1379 StartGame; 1365 1380 NoLogChanges; 1366 for p := 0 to nPl - 1 do 1367 if Assigned(bix[p]) then 1368 CallPlayer(cGetReady, p, nil^); 1381 CallAllPlayers(cGetReady, nil^); 1369 1382 LogChanges; 1370 1383 CL.Put(sTurn, 0, 0, nil); … … 1374 1387 nLogOpened := -1; 1375 1388 LastEndClientCommand := -1; 1376 bix[0].Client(cShowGame, 0, nil^); 1389 CallPlayer(cShowGame, 0, nil^); 1390 for I := 0 to nPl - 1 do 1391 if Assigned(bix[I]) and (bix[I].Kind = btNetworkServer) then 1392 CallPlayer(cShowGame, I, nil^); 1377 1393 Notify(ntBackOff); 1378 1394 Inform(pTurn);
Note:
See TracChangeset
for help on using the changeset viewer.