mirror of https://github.com/dirtbags/moth.git
I hate neale.
This commit is contained in:
parent
a1faaed722
commit
4f44d0bbb6
|
@ -48,7 +48,7 @@ def displacePoly(points, disp, limits, coordSequence=False):
|
|||
maxX, maxY = limits
|
||||
basePoints = []
|
||||
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
|
||||
if x > maxX:
|
||||
|
|
|
@ -203,16 +203,16 @@ class Pflanzarr:
|
|||
|
||||
html = ['<html>',
|
||||
'<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>',
|
||||
'<body>',
|
||||
'<table><tr><th>Team<th>Kills<th>Cause of Death']
|
||||
for tank in tanks:
|
||||
if tank is winner:
|
||||
rowStyle = 'style="font-weight:bold; '\
|
||||
'background-color:%s"' % tank._color
|
||||
'background-color:%s"' % tank.color
|
||||
else:
|
||||
rowStyle = 'style="background-color:%s"' % tank._color
|
||||
rowStyle = 'style="background-color:%s"' % tank.color
|
||||
if name:
|
||||
name = xml.sax.saxutils.escape(tank.name)
|
||||
else:
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#! /usr/bin/python
|
||||
|
||||
import asynchat
|
||||
import asyncore
|
||||
import optparse
|
||||
import shutil
|
||||
import socket
|
||||
import time
|
||||
import asyncore
|
||||
import asynchat
|
||||
from tanks import Pflanzarr
|
||||
|
||||
T = 60*5
|
||||
|
@ -41,7 +42,7 @@ class Flagger(asynchat.async_chat):
|
|||
self.flag = team
|
||||
|
||||
|
||||
def run_tanks():
|
||||
def run_tanks(args, turns):
|
||||
p = Pflanzarr.Pflanzarr(args[0], args[1])
|
||||
p.run(turns)
|
||||
|
||||
|
@ -84,7 +85,7 @@ def main():
|
|||
asyncore.loop(60, count=1)
|
||||
now = time.time()
|
||||
if now - lastrun >= 60:
|
||||
run_tanks()
|
||||
run_tanks(args, turns)
|
||||
lastrun = now
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue