Skip to content

Commit

Permalink
Added who we are waiting for
Browse files Browse the repository at this point in the history
  • Loading branch information
FenixFeather committed Dec 3, 2013
1 parent 1c4a77a commit 2c478f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions cards-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ def update(s):
# time.sleep(30)
while True:
try:
update("Waiting for others...")
if me.myTurn():
myTurn, slowPlayer = me.myTurn()
update("Waiting for {0}...".format(slowPlayer))
if myTurn:
print("Your turn!")
me.updateTurnInfo()
if me.isJudge:
Expand Down Expand Up @@ -186,7 +187,7 @@ def update(s):
update("Waiting for judgement.. ")
time.sleep(0.5)
time.sleep(0.5)
update("Waiting for others.. ")
update("Waiting for {0}.. ".format(slowPlayer))
time.sleep(0.5)
except KeyboardInterrupt:
sys.exit(0)
Expand Down
6 changes: 3 additions & 3 deletions cards-server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
#TODO:Send cards to people, who are we waiting for?
#TODO:who are we waiting for?
#An outline of an engine for concept-to-description/category matching card game.

import random
Expand Down Expand Up @@ -162,7 +162,7 @@ def newRound(self):
conn,addr = self.serv.accept()
data = pickle.loads(conn.recv(self.BUFSIZE))
if str(data[1]) == 'myturn':
conn.send(pickle.dumps(hash(player) == data[0]))
conn.send(pickle.dumps((hash(player) == data[0],player.name)))
conn.close()
elif str(data[1]) == 'roundEnd':
conn.send(pickle.dumps(False))
Expand Down Expand Up @@ -190,7 +190,7 @@ def newRound(self):
conn,addr = self.serv.accept()
data = pickle.loads(conn.recv(self.BUFSIZE))
if str(data[1]) == 'myturn':
conn.send(pickle.dumps(hash(self.judge) == data[0]))
conn.send(pickle.dumps((hash(player) == data[0],player.name)))
conn.close()
elif str(data[1]) == 'roundEnd':
conn.send(pickle.dumps(False))
Expand Down

0 comments on commit 2c478f4

Please sign in to comment.