mirror of https://github.com/dirtbags/moth.git
Merge branch 'master' of cfl:/var/projects/gctf
This commit is contained in:
commit
e328814054
|
@ -1,27 +1,3 @@
|
||||||
<pre>
|
<pre>
|
||||||
00000000 61 61 9e 23 01 0c 0c 40 0d 05 40 29 13 08 0d 01
|
0000 0001 0011 0010 0110 0111 _
|
||||||
00000010 05 0c 4e 40 40 33 0f 0d 05 40 19 05 01 12 13 40
|
|
||||||
00000020 01 07 0f 4d 4d 0e 05 16 05 12 40 0d 09 0e 04 40
|
|
||||||
00000030 08 0f 17 40 0c 0f 0e 07 6a 10 12 05 03 09 13 05
|
|
||||||
00000040 0c 19 4d 4d 08 01 16 09 0e 07 40 0c 09 14 14 0c
|
|
||||||
00000050 05 40 0f 12 40 0e 0f 40 0d 0f 0e 05 19 40 09 0e
|
|
||||||
00000060 40 0d 19 40 10 15 12 13 05 4c 40 01 0e 04 40 0e
|
|
||||||
00000070 0f 14 08 09 0e 07 6a 10 01 12 14 09 03 15 0c 01
|
|
||||||
00000080 12 40 14 aa 61 62 9d 0f 40 09 0e 14 05 12 05 13
|
|
||||||
00000090 14 40 0d 05 40 0f 0e 40 13 08 0f 12 05 4c 40 29
|
|
||||||
000000a0 40 14 08 0f 15 07 08 14 40 29 40 17 0f 15 0c 04
|
|
||||||
000000b0 40 13 01 09 0c 40 01 02 0f 15 14 40 01 6a 0c 09
|
|
||||||
000000c0 14 14 0c 05 40 01 0e 04 40 13 05 05 40 14 08 05
|
|
||||||
000000d0 40 17 01 14 05 12 19 40 10 01 12 14 40 0f 06 40
|
|
||||||
000000e0 14 08 05 40 17 0f 12 0c 04 4e 40 40 29 14 40 09
|
|
||||||
000000f0 13 40 01 40 17 01 19 40 29 40 08 01 16 05 40 0f
|
|
||||||
00000100 06 6a 04 12 09 16 09 3b 61 63 9c 0e 07 40 0f 06
|
|
||||||
00000110 06 40 14 08 05 40 13 10 0c 05 05 0e 40 01 0e 04
|
|
||||||
00000120 40 12 05 07 15 0c 01 14 09 0e 07 40 14 08 05 40
|
|
||||||
00000130 03 09 12 03 15 0c 01 14 09 0f 0e 4e 40 40 37 08
|
|
||||||
00000140 05 0e 05 16 05 12 40 29 6a 06 09 0e 04 40 0d 19
|
|
||||||
00000150 13 05 0c 06 40 07 12 0f 17 09 0e 07 40 07 12 09
|
|
||||||
00000160 0d 40 01 02 0f 15 14 40 14 08 05 40 0d 0f 15 14
|
|
||||||
00000170 08 5b 40 17 08 05 0e 05 16 05 12 40 09 14 40 09
|
|
||||||
00000180 13 40 01 40 04 01 0d 10 4c 6a 04 bb __ __ __
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
61 64 9b
|
0101
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<pre>
|
||||||
|
00000000 61 61 9e 23 01 0c 0c 40 0d 05 40 29 13 08 0d 01
|
||||||
|
00000010 05 0c 4e 40 40 33 0f 0d 05 40 19 05 01 12 13 40
|
||||||
|
00000020 01 07 0f 4d 4d 0e 05 16 05 12 40 0d 09 0e 04 40
|
||||||
|
00000030 08 0f 17 40 0c 0f 0e 07 6a 10 12 05 03 09 13 05
|
||||||
|
00000040 0c 19 4d 4d 08 01 16 09 0e 07 40 0c 09 14 14 0c
|
||||||
|
00000050 05 40 0f 12 40 0e 0f 40 0d 0f 0e 05 19 40 09 0e
|
||||||
|
00000060 40 0d 19 40 10 15 12 13 05 4c 40 01 0e 04 40 0e
|
||||||
|
00000070 0f 14 08 09 0e 07 6a 10 01 12 14 09 03 15 0c 01
|
||||||
|
00000080 12 40 14 aa 61 62 9d 0f 40 09 0e 14 05 12 05 13
|
||||||
|
00000090 14 40 0d 05 40 0f 0e 40 13 08 0f 12 05 4c 40 29
|
||||||
|
000000a0 40 14 08 0f 15 07 08 14 40 29 40 17 0f 15 0c 04
|
||||||
|
000000b0 40 13 01 09 0c 40 01 02 0f 15 14 40 01 6a 0c 09
|
||||||
|
000000c0 14 14 0c 05 40 01 0e 04 40 13 05 05 40 14 08 05
|
||||||
|
000000d0 40 17 01 14 05 12 19 40 10 01 12 14 40 0f 06 40
|
||||||
|
000000e0 14 08 05 40 17 0f 12 0c 04 4e 40 40 29 14 40 09
|
||||||
|
000000f0 13 40 01 40 17 01 19 40 29 40 08 01 16 05 40 0f
|
||||||
|
00000100 06 6a 04 12 09 16 09 3b 61 63 9c 0e 07 40 0f 06
|
||||||
|
00000110 06 40 14 08 05 40 13 10 0c 05 05 0e 40 01 0e 04
|
||||||
|
00000120 40 12 05 07 15 0c 01 14 09 0e 07 40 14 08 05 40
|
||||||
|
00000130 03 09 12 03 15 0c 01 14 09 0f 0e 4e 40 40 37 08
|
||||||
|
00000140 05 0e 05 16 05 12 40 29 6a 06 09 0e 04 40 0d 19
|
||||||
|
00000150 13 05 0c 06 40 07 12 0f 17 09 0e 07 40 07 12 09
|
||||||
|
00000160 0d 40 01 02 0f 15 14 40 14 08 05 40 0d 0f 15 14
|
||||||
|
00000170 08 5b 40 17 08 05 0e 05 16 05 12 40 09 14 40 09
|
||||||
|
00000180 13 40 01 40 04 01 0d 10 4c 6a 04 bb __ __ __
|
||||||
|
</pre>
|
|
@ -0,0 +1 @@
|
||||||
|
61 64 9b
|
|
@ -48,7 +48,7 @@ def displacePoly(points, disp, limits, coordSequence=False):
|
||||||
maxX, maxY = limits
|
maxX, maxY = limits
|
||||||
basePoints = []
|
basePoints = []
|
||||||
for point in points:
|
for point in points:
|
||||||
x,y = point[0] + disp[0], point[1] + disp[1]
|
x,y = int(point[0] + disp[0]), int(point[1] + disp[1])
|
||||||
|
|
||||||
# Check if duplication is needed on each axis
|
# Check if duplication is needed on each axis
|
||||||
if x > maxX:
|
if x > maxX:
|
||||||
|
|
|
@ -203,17 +203,17 @@ class Pflanzarr:
|
||||||
|
|
||||||
html = ['<html>',
|
html = ['<html>',
|
||||||
'<head><title>Game %d results</title>',
|
'<head><title>Game %d results</title>',
|
||||||
'<link href="../ctf.css" rel="stylesheet" type="text/css">',
|
'<link href="/ctf.css" rel="stylesheet" type="text/css">',
|
||||||
'</head>',
|
'</head>',
|
||||||
'<body>',
|
'<body>',
|
||||||
'<table><tr><th>Team<th>Kills<th>Cause of Death']
|
'<table><tr><th>Team<th>Kills<th>Cause of Death']
|
||||||
for tank in tanks:
|
for tank in tanks:
|
||||||
if tank is winner:
|
if tank is winner:
|
||||||
rowStyle = 'style="font-weight:bold; '\
|
rowStyle = 'style="font-weight:bold; '\
|
||||||
'background-color:%s"' % tank._color
|
'background-color:%s"' % tank.color
|
||||||
else:
|
else:
|
||||||
rowStyle = 'style="background-color:%s"' % tank._color
|
rowStyle = 'style="background-color:%s"' % tank.color
|
||||||
if name:
|
if tank.name:
|
||||||
name = xml.sax.saxutils.escape(tank.name)
|
name = xml.sax.saxutils.escape(tank.name)
|
||||||
else:
|
else:
|
||||||
name = '#default'
|
name = '#default'
|
||||||
|
@ -250,9 +250,9 @@ class Pflanzarr:
|
||||||
clearFrames = ['rm', '-rf', '%s' % self._imageDir]
|
clearFrames = ['rm', '-rf', '%s' % self._imageDir]
|
||||||
|
|
||||||
print 'Making Movie'
|
print 'Making Movie'
|
||||||
subprocess.call(movieCmd)
|
# subprocess.call(movieCmd)
|
||||||
# subprocess.call(movieCmd, stderr=open('/dev/null', 'w'),
|
subprocess.call(movieCmd, stderr=open('/dev/null', 'w'),
|
||||||
# stdout=open('/dev/null', 'w'))
|
stdout=open('/dev/null', 'w'))
|
||||||
subprocess.call(clearFrames)
|
subprocess.call(clearFrames)
|
||||||
|
|
||||||
def _outputErrors(self, tank):
|
def _outputErrors(self, tank):
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
#! /usr/bin/python
|
#! /usr/bin/python
|
||||||
|
|
||||||
import optparse
|
|
||||||
import shutil
|
|
||||||
import time
|
|
||||||
import asyncore
|
|
||||||
import asynchat
|
import asynchat
|
||||||
|
import asyncore
|
||||||
|
import optparse
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import socket
|
||||||
|
import time
|
||||||
from tanks import Pflanzarr
|
from tanks import Pflanzarr
|
||||||
|
|
||||||
T = 60*5
|
T = 60*5
|
||||||
|
@ -41,7 +43,7 @@ class Flagger(asynchat.async_chat):
|
||||||
self.flag = team
|
self.flag = team
|
||||||
|
|
||||||
|
|
||||||
def run_tanks():
|
def run_tanks(args, turns, flagger):
|
||||||
p = Pflanzarr.Pflanzarr(args[0], args[1])
|
p = Pflanzarr.Pflanzarr(args[0], args[1])
|
||||||
p.run(turns)
|
p.run(turns)
|
||||||
|
|
||||||
|
@ -58,7 +60,7 @@ def run_tanks():
|
||||||
highest = gameNums[0]
|
highest = gameNums[0]
|
||||||
for num in gameNums:
|
for num in gameNums:
|
||||||
if highest - MAX_HIST > num and not (num % HIST_STEP == 0):
|
if highest - MAX_HIST > num and not (num % HIST_STEP == 0):
|
||||||
shutil.rmtree(os.path.join(path, num))
|
shutil.rmtree(os.path.join(path, str(num)))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
winner = open('/var/lib/tanks/winner').read().strip()
|
winner = open('/var/lib/tanks/winner').read().strip()
|
||||||
|
@ -84,7 +86,7 @@ def main():
|
||||||
asyncore.loop(60, count=1)
|
asyncore.loop(60, count=1)
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if now - lastrun >= 60:
|
if now - lastrun >= 60:
|
||||||
run_tanks()
|
run_tanks(args, turns, flagger)
|
||||||
lastrun = now
|
lastrun = now
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue