Changeset 29 for trunk/GameServer.pas
- Timestamp:
- Jan 8, 2017, 10:20:03 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 11 11 lib 12 12 heaptrclog.trc 13 c-evo
-
- Property svn:ignore
-
trunk/GameServer.pas
r24 r29 183 183 T: TextFile; 184 184 s: string; 185 185 Key: string; 186 Value: string; 186 187 begin 187 188 Notify := NotifyFunction; … … 204 205 nBrain := bixFirstAI; 205 206 bixBeginner := bixFirstAI; 206 if FindFirst(HomeDir + ' *.ai.txt', $21, f) = 0 then207 if FindFirst(HomeDir + 'AI' + DirectorySeparator + '*.ai.txt', $21, f) = 0 then 207 208 repeat 208 209 with Brain[nBrain] do 209 210 begin 210 211 FileName := Copy(f.Name, 1, Length(f.Name) - 7); 211 DLLName := HomeDir + FileName;212 DLLName := HomeDir + 'AI' + DirectorySeparator + FileName; 212 213 Name := Copy(f.Name, 1, Length(f.Name) - 7); 213 214 Credits := ''; … … 216 217 Initialized := false; 217 218 ServerVersion := 0; 218 AssignFile(T, HomeDir + f.Name);219 AssignFile(T, HomeDir + 'AI' + DirectorySeparator + f.Name); 219 220 Reset(T); 220 221 while not EOF(T) do … … 222 223 ReadLn(T, s); 223 224 s := trim(s); 224 if Copy(s, 1, 5) = '#NAME' then 225 Name := Copy(s, 7, 255) 226 else if Copy(s, 1, 10) = '#.NET' then 225 if Pos(' ', S) > 0 then begin 226 Key := Copy(S, 1, Pos(' ', S) - 1); 227 Value := Trim(Copy(S, Pos(' ', S) + 1, Length(S))); 228 end else begin 229 Key := S; 230 Value := ''; 231 end; 232 if Key = '#NAME' then 233 Name := Value 234 else if Key = '#.NET' then 227 235 Flags := Flags or fDotNet 228 else if Copy(s, 1, 9)= '#BEGINNER' then236 else if Key = '#BEGINNER' then 229 237 bixBeginner := nBrain 230 else if Copy(s, 1, 5) = '#PATH' then 231 DLLName := HomeDir + trim(Copy(s, 7, 255)) 232 else if Copy(s, 1, 12) = '#GAMEVERSION' then 233 for i := 13 to Length(s) do 234 case s[i] of 238 else if Key = '#PATH' then 239 DLLName := HomeDir + 'AI' + DirectorySeparator + Value 240 {$IFDEF WINDOWS}{$IFDEF CPU32} 241 else if Key = '#PATH_WIN32' then 242 DLLName := HomeDir + 'AI' + DirectorySeparator + Value 243 {$ENDIF}{$ENDIF} 244 {$IFDEF WINDOWS}{$IFDEF CPU64} 245 else if Key = '#PATH_WIN64' then 246 DLLName := HomeDir + 'AI' + DirectorySeparator + Value 247 {$ENDIF}{$ENDIF} 248 {$IFDEF LINUX}{$IFDEF CPU32} 249 else if Key = '#PATH_LINUX32' then 250 DLLName := HomeDir + 'AI' + DirectorySeparator + Value 251 {$ENDIF}{$ENDIF} 252 {$IFDEF LINUX}{$IFDEF CPU64} 253 else if Key = '#PATH_LINUX64' then 254 DLLName := HomeDir + 'AI' + DirectorySeparator + Value 255 {$ENDIF}{$ENDIF} 256 else if Key = '#GAMEVERSION' then 257 for i := 1 to Length(Value) do 258 case Value[i] of 235 259 '0' .. '9': 236 260 ServerVersion := ServerVersion and $FFFF00 + ServerVersion and 237 $FF * 10 + ord( s[i]) - 48;261 $FF * 10 + ord(Value[i]) - 48; 238 262 '.': 239 263 ServerVersion := ServerVersion shl 8; 240 264 end 241 else if Copy(s, 1, 8)= '#CREDITS' then242 Credits := Copy(s, 10, 255)265 else if Key = '#CREDITS' then 266 Credits := Value 243 267 end; 244 268 CloseFile(T);
Note:
See TracChangeset
for help on using the changeset viewer.