Skip to content

Commit a583e4e

Browse files
committed
Writes STDOUT to log.txt
1 parent b6c2683 commit a583e4e

File tree

7 files changed

+517
-111
lines changed

7 files changed

+517
-111
lines changed

client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#host = (sys.argv[4],int(sys.argv[5]))
1616
host = ("localhost",8001)
1717

18+
log = open("log.txt",'w')
19+
sys.stdout = log
20+
1821
map = []
1922
bmap = []
2023
exp = []
@@ -236,6 +239,8 @@ def read(id):
236239
team = 0
237240
teamn = 0
238241

242+
sock = socket(AF_INET,SOCK_STREAM)
243+
239244
while True:
240245
if start == "running":
241246
#print players["Bot0"].speed

client.py~

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ start = "lobby"
1515
#host = (sys.argv[4],int(sys.argv[5]))
1616
host = ("localhost",8001)
1717

18+
log = open("log.txt",'w')
19+
sys.stdout = log
20+
1821
map = []
1922
bmap = []
2023
exp = []
@@ -45,7 +48,7 @@ bg = pygame.image.load("Images/"+"bg.png").convert()
4548
shade = pygame.image.load("Images/"+"shade.png").convert_alpha()
4649
fighter = pygame.image.load("Images/"+"fighter.png").convert_alpha()
4750
target = pygame.image.load("Images/"+"target.png").convert_alpha()
48-
font = pygame.font.Font("",20)
51+
font = pygame.font.Font("font.ttf",20)
4952
victory = None
5053
vcount = 0
5154

@@ -236,6 +239,8 @@ classn = 0
236239
team = 0
237240
teamn = 0
238241

242+
sock = socket(AF_INET,SOCK_STREAM)
243+
239244
while True:
240245
if start == "running":
241246
#print players["Bot0"].speed

lobby.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import socket
2+
from socket import *
3+
4+
def lobby_accept():
5+
sock = socket(AF_INET,SOCK_STREAM)
6+
sock.bind(('',8001))
7+
while True:
8+
sock.listen(1)
9+
sock,addr = sock.accept()
10+
len = sock.recv(2)
11+
call = sock.recv(int(len))

lobby.py~

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import socket
2+
from socket import *
3+
4+
def lobby_accept():
5+
sock = socket(AF_INET,SOCK_STREAM)
6+
sock.bind(('',8001))
7+
while True:
8+
sock.listen(1)
9+
sock,addr = sock.accept()
10+
len = sock.recv(2)
11+
call = sock.recv(int(len))

0 commit comments

Comments
 (0)