summaryrefslogtreecommitdiff
path: root/tools/protocol.py
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-09-29 16:01:12 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-11-19 13:43:08 -0800
commit29ec8b3f3910b4b9bb0724953c9628dc039df06b (patch)
tree3a381f4755d093706484dab81205cbbd9ca97c55 /tools/protocol.py
parent3b936892f84bfd464cd846ec49053b4402fced98 (diff)
downloadtmwa-29ec8b3f3910b4b9bb0724953c9628dc039df06b.tar.gz
tmwa-29ec8b3f3910b4b9bb0724953c9628dc039df06b.tar.bz2
tmwa-29ec8b3f3910b4b9bb0724953c9628dc039df06b.tar.xz
tmwa-29ec8b3f3910b4b9bb0724953c9628dc039df06b.zip
Avoid loops when generating protocol, to make description/ordering easier
Diffstat (limited to 'tools/protocol.py')
-rwxr-xr-xtools/protocol.py86
1 files changed, 52 insertions, 34 deletions
diff --git a/tools/protocol.py b/tools/protocol.py
index 85266ae..3c33b2c 100755
--- a/tools/protocol.py
+++ b/tools/protocol.py
@@ -3190,23 +3190,32 @@ def build_context():
fixed_size=6,
)
# 0x2b10, 0x2b11
- for (id, cat) in [
- (0x2728, login_char.r),
- (0x2729, login_char.s),
- ]:
- cat(id, 'update account reg2',
- head=[
- at(0, u16, 'packet id'),
- at(2, u16, 'packet length'),
- at(4, account_id, 'account id'),
- ],
- head_size=8,
- repeat=[
- at(0, var_name, 'name'),
- at(32, u32, 'value'),
- ],
- repeat_size=36,
- )
+ login_char.r(0x2728, 'update account reg2',
+ head=[
+ at(0, u16, 'packet id'),
+ at(2, u16, 'packet length'),
+ at(4, account_id, 'account id'),
+ ],
+ head_size=8,
+ repeat=[
+ at(0, var_name, 'name'),
+ at(32, u32, 'value'),
+ ],
+ repeat_size=36,
+ )
+ login_char.s(0x2729, 'update account reg2',
+ head=[
+ at(0, u16, 'packet id'),
+ at(2, u16, 'packet length'),
+ at(4, account_id, 'account id'),
+ ],
+ head_size=8,
+ repeat=[
+ at(0, var_name, 'name'),
+ at(32, u32, 'value'),
+ ],
+ repeat_size=36,
+ )
login_char.r(0x272a, 'unban request',
fixed=[
at(0, u16, 'packet id'),
@@ -3496,23 +3505,32 @@ def build_context():
fixed_size=34,
)
# 0x2728, 0x2729
- for (id, cat) in [
- (0x2b10, char_map.r),
- (0x2b11, char_map.s),
- ]:
- cat(id, 'account reg2 update',
- head=[
- at(0, u16, 'packet id'),
- at(2, u16, 'packet length'),
- at(4, account_id, 'account id'),
- ],
- head_size=8,
- repeat=[
- at(0, var_name, 'name'),
- at(32, u32, 'value'),
- ],
- repeat_size=36,
- )
+ char_map.r(0x2b10, 'account reg2 update',
+ head=[
+ at(0, u16, 'packet id'),
+ at(2, u16, 'packet length'),
+ at(4, account_id, 'account id'),
+ ],
+ head_size=8,
+ repeat=[
+ at(0, var_name, 'name'),
+ at(32, u32, 'value'),
+ ],
+ repeat_size=36,
+ )
+ char_map.s(0x2b11, 'account reg2 update',
+ head=[
+ at(0, u16, 'packet id'),
+ at(2, u16, 'packet length'),
+ at(4, account_id, 'account id'),
+ ],
+ head_size=8,
+ repeat=[
+ at(0, var_name, 'name'),
+ at(32, u32, 'value'),
+ ],
+ repeat_size=36,
+ )
char_map.s(0x2b12, 'divorce notify',
fixed=[
at(0, u16, 'packet id'),