Module commands
[hide private]
[frames] | no frames]

Source Code for Module commands

 1  ''' 
 2  List of amp commands 
 3  ''' 
 4  from twisted.protocols import amp 
 5   
 6  #client -> server 
7 -class Connect(amp.Command):
8 arguments = [('ip',amp.String())] 9 response = [('id',amp.Integer()),('cur',amp.ListOf(amp.Integer())),('map',amp.String())]
10 #-1 means not available,cur is list of current players 11
12 -class StartGame(amp.Command):
13 pass
14
15 -class AddPlayer(amp.Command):
16 arguments = [('pid',amp.Integer())]
17 18 #both
19 -class BuildUnit(amp.Command):
20 arguments = [('pid',amp.Integer()),('tid',amp.String()),('vid',amp.String()),('uid',amp.Integer()),('buid',amp.Integer())]
21 #bUid is uid of the builder 22 23
24 -class RemoveUnit(amp.Command):
25 arguments = [('pid',amp.Integer()),('uid',amp.Integer())]
26 27 #server -> client
28 -class UpdateHealth(amp.Command):
29 # update unit health based on build status, attack status etc... 30 arguments = [('pid',amp.Integer()),('uid',amp.Integer()),('h',amp.Integer()),('tid',amp.String()),('vid',amp.String())]
31 32 #both
33 -class MoveTroop(amp.Command):
34 arguments = [('pid',amp.Integer()),('uid',amp.Integer()),('vid',amp.Integer()),('path',amp.ListOf(amp.Integer()))] #can't move to core
35 36 #server -> client
37 -class UpdateLocation(amp.Command):
38 arguments = [('pid',amp.Integer()),('uid',amp.Integer()),('vid',amp.Integer())]
39 #uid of unit, id of vertex 40
41 -class Attack(amp.Command):
42 arguments = [('tpid',amp.Integer()),('tuid',amp.Integer()),('val',amp.Integer())]
43
44 -class AttackAnimation(amp.Command): #if no path, stop
45 arguments = [('pid',amp.Integer()),('uid',amp.Integer()),('tpid',amp.Integer()),('tuid',amp.Integer()),('path',amp.ListOf(amp.String()))] #can't move to core 46