2007-09-29 13:16:00 +00:00
|
|
|
#from random import choice
|
|
|
|
|
|
|
|
import random
|
|
|
|
import os
|
|
|
|
|
2007-12-09 13:36:54 +00:00
|
|
|
masterservers = ["localhost 8300"]
|
2007-09-29 13:16:00 +00:00
|
|
|
|
|
|
|
maps = [
|
|
|
|
["dm1", "dm2", "dm6"],
|
|
|
|
["dm1", "dm2", "dm6"],
|
|
|
|
["ctf1", "ctf2", "ctf3"],
|
|
|
|
]
|
|
|
|
|
|
|
|
servernames = [
|
|
|
|
"%s playhouse",
|
|
|
|
"%s own server",
|
|
|
|
]
|
|
|
|
|
|
|
|
nicks = []
|
|
|
|
for l in file("scripts/nicks.txt"):
|
|
|
|
nicks += l.replace(":port80c.se.quakenet.org 353 matricks_ = #pcw :", "").strip().split()
|
|
|
|
inick = 0
|
|
|
|
|
|
|
|
def get_nick():
|
|
|
|
global inick, nicks
|
2008-11-15 13:29:56 +00:00
|
|
|
inick = (inick+1)%len(nicks)
|
2007-09-29 13:16:00 +00:00
|
|
|
return nicks[inick].replace("`", "\`")
|
|
|
|
|
2008-11-15 13:29:56 +00:00
|
|
|
for s in xrange(0, 350):
|
2007-11-04 21:36:03 +00:00
|
|
|
cmd = "./fake_server_d_d "
|
2007-09-29 13:16:00 +00:00
|
|
|
cmd += '-n "%s" ' % (random.choice(servernames) % get_nick())
|
|
|
|
for m in masterservers:
|
|
|
|
cmd += '-m %s '%m
|
|
|
|
|
|
|
|
max = random.randint(2, 16)
|
|
|
|
cmd += "-x %d " % max
|
|
|
|
|
|
|
|
t = random.randint(0, 2)
|
|
|
|
|
|
|
|
cmd += '-a "%s" ' % random.choice(maps[t])
|
|
|
|
cmd += '-g %d ' % random.randint(0, 100)
|
|
|
|
cmd += '-t %d ' % t # dm, tdm, ctf
|
2007-09-30 11:48:06 +00:00
|
|
|
cmd += "-f %d " % random.randint(0, 1) # password protected
|
2007-09-29 13:16:00 +00:00
|
|
|
|
|
|
|
for p in xrange(0, random.randint(0, max)):
|
|
|
|
cmd += '-p "%s" %d ' % (get_nick(), random.randint(0, 20))
|
|
|
|
|
|
|
|
print cmd
|
|
|
|
os.popen2(cmd)
|
|
|
|
|