Permalink
Browse files

bugfix for contest

  • Loading branch information...
1 parent 787bd62 commit 30146fbf2592a86b5b7b457f2482605f3bb843d2 @halida committed Apr 17, 2012
Showing with 9 additions and 8 deletions.
  1. +2 −1 srcs/game.py
  2. +4 −4 srcs/map/fight_here.yml
  3. +2 −1 srcs/map/map.py
  4. +0 −1 srcs/zmq_game_server.py
  5. +1 −1 website/config.rb
View
@@ -124,7 +124,8 @@ def set_player_op(self, id, kw):
if kw['op'] == 'moves':
moves = []
for count, _from, to in kw['moves']:
- if count == 0: continue
+ count = int(count)
+ if count <= 0: continue
# 检查moves合法性
owner, armies = self.holds[_from]
if owner != n:
View
@@ -3,9 +3,9 @@ desc: ""
author: resty
version: 0.1
-max_round: 8000
-max_player: 3
-min_player: 3
+max_round: 200
+max_player: 4
+min_player: 2
start_unit: 100
starts:
- A
@@ -352,4 +352,4 @@ routes:
-
+
View
@@ -3,7 +3,7 @@
"""
module: map
"""
-import yaml, string
+import yaml, string, random
class Map:
# planet tokens
@@ -70,6 +70,7 @@ def load(self, data):
self.starts = [self.planet_name_to_id[name]
for name in self.meta['starts']]
+ random.shuffle(self.starts)
def test():
"""
View
@@ -84,7 +84,6 @@ def run(self, max_waits=10.0, enable_no_resp_die=True, min_waits=2.0,
# 为了防止错误命令搞挂服务器, 加上错误处理
except Exception as e:
- raise
error_msg = str(e)
result = dict(status=error_msg, data=rc)
logging.debug(error_msg)
View
@@ -1,4 +1,4 @@
-GAME_SERVER = "localhost:9999"
+GAME_SERVER = "pythonvsruby.org:9999"
###
# Compass
###

0 comments on commit 30146fb

Please sign in to comment.