-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDistrictStarter.py
68 lines (57 loc) · 1.37 KB
/
DistrictStarter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import os
import subprocess
import sys
import random
NUM_DISTRICTS = 2
districtNames = [
'Alignment',
'Axle',
'Backfire',
'Biofuel',
'Camshaft',
'Catalyst',
'Chrome',
'Driveshaft',
'Bumper',
'Defogger',
'Exhaust',
'Fender',
'Foglight',
'Formula',
'Fumes',
'Gasket',
'Grease',
'Gridlock',
'Hatchback',
'Hazard',
'Horsepower',
'Hot Rod',
'Hydraulics',
'Ignition',
'Isolator',
'Lugnut',
'Mudflap',
'Muffler',
'Nozzle',
'Overdrive',
'Pinstripe',
'Relay',
'Reverse'
]
cutDistrictNames = random.sample(districtNames, NUM_DISTRICTS)
startingNum = 200000000
minObjIdBase = 200100000
maxObjIdBase = 200149999
isWindows = sys.platform == 'win32'
os.chdir('startup/win32' if isWindows else 'startup/unix')
for index, elem in enumerate(cutDistrictNames):
subprocess.shell = True
districtName = str(cutDistrictNames[index])
os.environ['DISTRICT_NAME'] = districtName
os.environ['BASE_CHANNEL'] = str(startingNum)
os.environ['MIN_OBJ_ID'] = str(minObjIdBase)
os.environ['MAX_OBJ_ID'] = str(maxObjIdBase)
os.system('start cmd /c districtStarter.bat' if isWindows else f'screen -dmS "{districtName}" ./districtStarter.sh')
startingNum = startingNum + 1000000
minObjIdBase = minObjIdBase + 1000000
maxObjIdBase = maxObjIdBase + 1000000