-
Notifications
You must be signed in to change notification settings - Fork 0
/
game_commands.py
92 lines (60 loc) · 2.09 KB
/
game_commands.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
from twisted.protocols.amp import Command, String, Integer, ListOf
class Move(Command):
arguments = [('uid', Integer()),
('direction', String())]
response = [('ok', Integer())]
class MoveObject(Command):
arguments = [('uid', Integer()),
('x', Integer()),
('y', Integer())]
response = [('ok', Integer())]
class UID(Command):
arguments = [('uid', Integer())]
response = [('ok', Integer())]
class SendMap(Command):
arguments = [('sec_map', ListOf(ListOf(Integer())))]
response = [('ok', Integer())]
class CreateObject(Command):
arguments = [('obj_data', ListOf(Integer()))]
response = [('ok', Integer())]
class CreateObjects(Command):
arguments = [('obj_data', ListOf(ListOf(Integer())))]
response = [('ok', Integer())]
class Login(Command):
arguments = [('team', Integer())]
response = [('uid', Integer())]
class PlayerShoot(Command):
# create a shot on the clients
arguments = [('uid', Integer()),
('direction', String()),
('x', Integer()),
('y', Integer())]
response = [('ok', Integer())]
class PlayerHit(Command):
arguments = [('uid', Integer()),
('dmg', Integer())]
response = [('ok', Integer())]
class PlayerRevive(Command):
arguments = [('uid', Integer())]
response = [('ok', Integer())]
class Shoot(Command):
# send shoot action to the server
arguments = [('uid', Integer()),
('direction', String())]
response = [('ok', Integer())]
class LogoutPlayer(Command):
arguments = [('uid', Integer())]
response = [('ok', Integer())]
class UpdateScore(Command):
arguments = [('blue', Integer()),
('red', Integer())]
response = [('ok', Integer())]
class RestartRound(Command):
arguments = [('uid', Integer())]
response = [('ok', Integer())]
class AddBot(Command):
arguments = [('team', Integer())]
response = [('ok', Integer())]
class DeleteBot(Command):
arguments = [('team', Integer())]
response = [('ok', Integer())]