Open Monstrofil opened 1 year ago
That is definitely battle results.
Here we can see credits accounted for the battle.
I did not find any records of 'headers' in game client, but that does not mean they are not there.
Finally found where WG/Lesta transforms plain arrays into the dictionary.
<m61be8af2.BattleResultsSystem.BattleResultsSystem instance at 0x000002895478D548>
postProcessing
Unfortunately it's so closly tied to DataHub that it's hard to extract conversion code and also the conversion code is so hardcoded that it's hard to reimplement it in other places =/
>>> system = err[-1].tb_next.tb_next.tb_next.tb_frame.f_locals['self']
>>> dir(system)
['_EventListener__mapListeners', '_System__eventHandlers', '__doc__', '__init__', '__module__', '_collection', '_getComponent', '_getData', '_getEntity', '_hub', 'add', 'addHandler', 'addListener', 'applyEconomics', 'applyGlobalboostInfo', 'applyQuestInfo', 'classID', 'clear', 'collection', 'fillWithPlayer', 'fini', 'finiComponents', 'hasListener', 'hideAutoReplanishment', 'inContext', 'initComponents', 'outContext', 'postProcessing', 'preProcessing', 'remove', 'removeAllListeners', 'removeHandler', 'removeListener', 'update']
>>> dir(system.postProcessing)
['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__format__', '__func__', '__get__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'im_class', 'im_func', 'im_self']
>>> dis.dis(system.postProcessing)
0 0 JUMP_ABSOLUTE 12
>> 3 LOAD_GLOBAL 7 (noDamage)
6 LOAD_FAST 19 (try =)
9 LOAD_ATTR 9 (fillWithPlayer)
>> 12 LOAD_FAST 1 (entity)
15 JUMP_ABSOLUTE 24
18 <14>
19 <149> 11195
22 SETUP_WITH 27345 (to 27370)
25 STOP_CODE
26 STOP_CODE
27 STORE_FAST 2 (in elif j try u)
30 LOAD_FAST 2 (in elif j try u)
33 LOAD_ATTR 1 (players)
36 STORE_FAST 3 (] import q)
39 LOAD_FAST 2 (in elif j try u)
42 LOAD_ATTR 2 (buildings)
45 STORE_FAST 4 (5 1)
48 LOAD_FAST 2 (in elif j try u)
51 LOAD_ATTR 3 (me)
54 STORE_FAST 5 (d e)
57 LOAD_FAST 2 (in elif j try u)
60 LOAD_ATTR 4 (privateData)
63 STORE_FAST 6 (t f def &)
66 LOAD_FAST 2 (in elif j try u)
69 LOAD_ATTR 5 (common)
72 STORE_FAST 7 (| {)
75 LOAD_FAST 6 (t f def &)
78 POP_JUMP_IF_TRUE 85
81 LOAD_CONST 0 (None)
84 RETURN_VALUE
>> 85 LOAD_FAST 5 (d e)
88 LOAD_CONST 1 ('team_damage')
91 BINARY_SUBSCR
92 LOAD_CONST 2 (0)
95 COMPARE_OP 4 (>)
98 JUMP_IF_TRUE_OR_POP 144
101 LOAD_FAST 5 (d e)
104 LOAD_CONST 3 ('team_planes_killed')
107 BINARY_SUBSCR
108 LOAD_CONST 2 (0)
111 COMPARE_OP 4 (>)
114 JUMP_IF_TRUE_OR_POP 144
117 LOAD_FAST 6 (t f def &)
120 LOAD_CONST 4 ('is_afk')
123 BINARY_SUBSCR
124 JUMP_IF_TRUE_OR_POP 144
127 LOAD_FAST 6 (t f def &)
130 LOAD_CONST 5 ('is_leaver')
133 BINARY_SUBSCR
134 JUMP_IF_TRUE_OR_POP 144
137 LOAD_FAST 6 (t f def &)
140 LOAD_CONST 6 ('is_tshooter')
143 BINARY_SUBSCR
>> 144 LOAD_FAST 6 (t f def &)
147 LOAD_CONST 7 ('is_abuse_detected')
150 STORE_SUBSCR
151 LOAD_FAST 6 (t f def &)
154 LOAD_CONST 7 ('is_abuse_detected')
157 BINARY_SUBSCR
158 POP_JUMP_IF_FALSE 181
161 LOAD_FAST 6 (t f def &)
164 LOAD_CONST 8 ('battles_to_clean_abuse')
167 BINARY_SUBSCR
168 POP_JUMP_IF_FALSE 181
171 LOAD_FAST 6 (t f def &)
174 LOAD_CONST 8 ('battles_to_clean_abuse')
177 BINARY_SUBSCR
178 JUMP_FORWARD 3 (to 184)
>> 181 LOAD_CONST 2 (0)
>> 184 LOAD_FAST 6 (t f def &)
187 LOAD_CONST 8 ('battles_to_clean_abuse')
190 STORE_SUBSCR
191 LOAD_FAST 6 (t f def &)
194 LOAD_CONST 9 ('abuser_status')
197 BINARY_SUBSCR
198 LOAD_CONST 10 (2)
201 COMPARE_OP 2 (==)
204 POP_JUMP_IF_FALSE 217
207 LOAD_FAST 6 (t f def &)
210 LOAD_CONST 8 ('battles_to_clean_abuse')
213 BINARY_SUBSCR
214 JUMP_FORWARD 3 (to 220)
>> 217 LOAD_CONST 2 (0)
>> 220 LOAD_FAST 6 (t f def &)
223 LOAD_CONST 11 ('battles_to_clean_abuse_confirmed')
226 STORE_SUBSCR
227 LOAD_FAST 6 (t f def &)
230 LOAD_CONST 11 ('battles_to_clean_abuse_confirmed')
233 BINARY_SUBSCR
234 LOAD_CONST 2 (0)
237 COMPARE_OP 2 (==)
240 POP_JUMP_IF_FALSE 269
243 LOAD_FAST 6 (t f def &)
246 LOAD_CONST 9 ('abuser_status')
249 BINARY_SUBSCR
250 LOAD_CONST 12 (1)
253 COMPARE_OP 2 (==)
256 POP_JUMP_IF_FALSE 269
259 LOAD_FAST 6 (t f def &)
262 LOAD_CONST 8 ('battles_to_clean_abuse')
265 BINARY_SUBSCR
266 JUMP_FORWARD 3 (to 272)
>> 269 LOAD_CONST 2 (0)
>> 272 LOAD_FAST 6 (t f def &)
275 LOAD_CONST 13 ('battles_to_clean_abuse_suspect')
278 STORE_SUBSCR
279 LOAD_FAST 5 (d e)
282 LOAD_CONST 14 ('scouting_damage')
285 BINARY_SUBSCR
286 LOAD_FAST 5 (d e)
289 LOAD_CONST 15 ('scouting_fires')
292 BINARY_SUBSCR
293 BINARY_ADD
294 LOAD_FAST 5 (d e)
297 LOAD_CONST 16 ('agro_total')
300 BINARY_SUBSCR
301 BINARY_ADD
302 LOAD_FAST 5 (d e)
305 LOAD_CONST 17 ('first_ships_spotted')
308 BINARY_SUBSCR
309 BINARY_ADD
310 LOAD_FAST 5 (d e)
313 LOAD_CONST 18 ('first_planes_spotted')
316 BINARY_SUBSCR
317 BINARY_ADD
318 LOAD_FAST 5 (d e)
321 LOAD_CONST 19 ('tpds_spotted')
324 BINARY_SUBSCR
325 BINARY_ADD
326 LOAD_FAST 5 (d e)
329 LOAD_CONST 20 ('cp_capture_points')
332 BINARY_SUBSCR
333 BINARY_ADD
334 LOAD_FAST 5 (d e)
337 LOAD_CONST 21 ('cp_dropped_points')
340 BINARY_SUBSCR
341 BINARY_ADD
342 LOAD_FAST 5 (d e)
345 LOAD_CONST 22 ('team_captured_points')
348 BINARY_SUBSCR
349 BINARY_ADD
350 LOAD_FAST 5 (d e)
353 LOAD_CONST 23 ('team_dropped_points')
356 BINARY_SUBSCR
357 BINARY_ADD
358 LOAD_FAST 5 (d e)
361 LOAD_CONST 24 ('battle_picked_drop_points')
364 BINARY_SUBSCR
365 BINARY_ADD
366 LOAD_FAST 5 (d e)
369 LOAD_CONST 25 ('enemy_energy_burned')
372 BINARY_SUBSCR
373 BINARY_ADD
374 LOAD_FAST 5 (d e)
377 LOAD_CONST 26 ('total_command_activity')
380 STORE_SUBSCR
381 BUILD_LIST 0
384 STORE_FAST 8 (-=)
387 SETUP_LOOP 1029 (to 1419)
390 LOAD_FAST 5 (d e)
393 LOAD_CONST 27 ('interactions')
396 BINARY_SUBSCR
397 LOAD_ATTR 6 (iteritems)
400 CALL_FUNCTION 0
403 GET_ITER
>> 404 FOR_ITER 1011 (to 1418)
407 UNPACK_SEQUENCE 2
410 STORE_FAST 9 (elif z assert for)
413 STORE_FAST 10 (lambda x o)
416 LOAD_GLOBAL 7 (noDamage)
419 LOAD_FAST 10 (lambda x o)
422 LOAD_GLOBAL 8 (DAMAGE_FIELDS_SHIP)
425 CALL_FUNCTION 2
428 POP_JUMP_IF_FALSE 437
431 JUMP_ABSOLUTE 404
434 JUMP_FORWARD 0 (to 437)
>> 437 LOAD_FAST 3 (] import q)
440 LOAD_FAST 9 (elif z assert for)
443 BINARY_SUBSCR
444 STORE_FAST 11 (k 8)
447 LOAD_FAST 0 (self)
450 LOAD_ATTR 9 (fillWithPlayer)
453 LOAD_FAST 11 (k 8)
456 LOAD_FAST 5 (d e)
459 LOAD_FAST 10 (lambda x o)
462 CALL_FUNCTION 3
465 POP_TOP
466 LOAD_GLOBAL 10 (False)
469 STORE_FAST 12 (m while =)
472 LOAD_FAST 10 (lambda x o)
475 LOAD_CONST 28 ('module_crits')
478 BINARY_SUBSCR
479 LOAD_FAST 10 (lambda x o)
482 LOAD_CONST 29 ('module_kills')
485 BINARY_SUBSCR
486 BINARY_ADD
487 LOAD_FAST 10 (lambda x o)
490 LOAD_CONST 30 ('total_modules_hits')
493 STORE_SUBSCR
494 LOAD_FAST 11 (k 8)
497 LOAD_CONST 31 ('is_alive')
500 BINARY_SUBSCR
501 POP_JUMP_IF_TRUE 1392
504 LOAD_FAST 11 (k 8)
507 LOAD_CONST 32 ('killer_db_id')
510 BINARY_SUBSCR
511 STORE_FAST 13 (try 6)
514 LOAD_FAST 11 (k 8)
517 LOAD_CONST 33 ('killer_building_id')
520 BINARY_SUBSCR
521 STORE_FAST 14 (try >> o y)
524 LOAD_CONST 0 (None)
527 STORE_FAST 15 (q { or)
530 LOAD_FAST 13 (try 6)
533 LOAD_CONST 2 (0)
536 COMPARE_OP 3 (!=)
539 POP_JUMP_IF_FALSE 635
542 LOAD_FAST 3 (] import q)
545 LOAD_FAST 13 (try 6)
548 BINARY_SUBSCR
549 STORE_FAST 15 (q { or)
552 LOAD_FAST 15 (q { or)
555 LOAD_CONST 34 ('vehicle_type_id')
558 BINARY_SUBSCR
559 LOAD_FAST 10 (lambda x o)
562 LOAD_CONST 35 ('killer_shipId')
565 STORE_SUBSCR
566 LOAD_FAST 15 (q { or)
569 LOAD_CONST 36 ('team_id')
572 BINARY_SUBSCR
573 LOAD_FAST 5 (d e)
576 LOAD_CONST 36 ('team_id')
579 BINARY_SUBSCR
580 COMPARE_OP 2 (==)
583 LOAD_FAST 10 (lambda x o)
586 LOAD_CONST 37 ('killer_is_ally')
589 STORE_SUBSCR
590 LOAD_FAST 15 (q { or)
593 LOAD_CONST 38 ('is_abuser')
596 BINARY_SUBSCR
597 LOAD_FAST 10 (lambda x o)
600 LOAD_CONST 39 ('is_killer_tk')
603 STORE_SUBSCR
604 LOAD_FAST 15 (q { or)
607 LOAD_CONST 40 ('is_prebattle_ally')
610 BINARY_SUBSCR
611 LOAD_FAST 10 (lambda x o)
614 LOAD_CONST 41 ('is_killer_in_my_division')
617 STORE_SUBSCR
618 LOAD_FAST 15 (q { or)
621 LOAD_CONST 42 ('is_bot')
624 BINARY_SUBSCR
625 LOAD_FAST 10 (lambda x o)
628 LOAD_CONST 43 ('is_killer_bot')
631 STORE_SUBSCR
632 JUMP_FORWARD 0 (to 635)
>> 635 LOAD_FAST 14 (try >> o y)
638 JUMP_ABSOLUTE 1281
>> 641 CALL_FUNCTION 2
644 POP_TOP
645 JUMP_FORWARD 0 (to 648)
>> 648 SETUP_LOOP 139 (to 790)
651 LOAD_FAST 2 (in elif j try u)
654 LOAD_ATTR 30 (interactions)
657 LOAD_ATTR 6 (iteritems)
660 CALL_FUNCTION 0
663 GET_ITER
>> 664 FOR_ITER 122 (to 789)
667 UNPACK_SEQUENCE 2
670 STORE_FAST 30 (* print ])
673 STORE_FAST 31 (assert not >> =)
676 SETUP_LOOP 107 (to 786)
679 LOAD_FAST 31 (assert not >> =)
682 GET_ITER
>> 683 FOR_ITER 99 (to 785)
686 STORE_FAST 32 (q f or)
689 LOAD_CONST 71 ('playerId')
692 LOAD_FAST 32 (q f or)
695 COMPARE_OP 6 (in)
698 POP_JUMP_IF_FALSE 766
701 LOAD_FAST 3 (] import q)
704 LOAD_FAST 32 (q f or)
707 LOAD_CONST 71 ('playerId')
710 BINARY_SUBSCR
711 BINARY_SUBSCR
712 STORE_FAST 11 (k 8)
715 LOAD_FAST 11 (k 8)
718 POP_JUMP_IF_FALSE 743
721 LOAD_FAST 0 (self)
724 LOAD_ATTR 9 (fillWithPlayer)
727 LOAD_FAST 11 (k 8)
730 LOAD_FAST 5 (d e)
733 LOAD_FAST 32 (q f or)
736 CALL_FUNCTION 3
739 POP_TOP
740 JUMP_ABSOLUTE 782
>> 743 LOAD_GLOBAL 31 (LOG_DEBUG)
746 LOAD_CONST 72 ('WARNING')
749 LOAD_CONST 73 ('no player for id')
752 LOAD_FAST 32 (q f or)
755 LOAD_CONST 71 ('playerId')
758 BINARY_SUBSCR
759 CALL_FUNCTION 3
762 POP_TOP
763 JUMP_ABSOLUTE 683
>> 766 LOAD_GLOBAL 31 (LOG_DEBUG)
769 LOAD_CONST 72 ('WARNING')
772 LOAD_CONST 74 ('no playerId for')
775 LOAD_FAST 32 (q f or)
778 CALL_FUNCTION 3
781 POP_TOP
>> 782 JUMP_ABSOLUTE 683
>> 785 POP_BLOCK
>> 786 JUMP_ABSOLUTE 664
>> 789 POP_BLOCK
>> 790 LOAD_FAST 7 (| {)
793 LOAD_ATTR 32 (get)
796 LOAD_CONST 75 ('battle_logic_info')
799 CALL_FUNCTION 1
802 STORE_FAST 33 (** ] w del 7)
805 LOAD_FAST 33 (** ] w del 7)
808 POP_JUMP_IF_FALSE 963
811 LOAD_FAST 33 (** ] w del 7)
814 LOAD_ATTR 32 (get)
817 LOAD_CONST 60 ('tasks')
820 CALL_FUNCTION 1
823 STORE_FAST 34 (9 [ 5 j)
826 LOAD_FAST 34 (9 [ 5 j)
829 POP_JUMP_IF_FALSE 963
832 LOAD_GLOBAL 33 (filterSecondaryPVETasks)
835 LOAD_FAST 34 (9 [ 5 j)
838 LOAD_FAST 6 (t f def &)
841 LOAD_CONST 36 ('team_id')
844 BINARY_SUBSCR
845 CALL_FUNCTION 2
848 STORE_FAST 35 (8 print w)
851 LOAD_FAST 35 (8 print w)
854 LOAD_ATTR 34 (sort)
857 LOAD_CONST 50 ('key')
860 LOAD_CONST 76 (<code object 69029943604 at 000002893BAC7E30, file "28380393646326556", line -1>)
863 MAKE_FUNCTION 0
866 CALL_FUNCTION 256
869 POP_TOP
870 SETUP_LOOP 74 (to 947)
873 LOAD_FAST 35 (8 print w)
876 GET_ITER
>> 877 FOR_ITER 66 (to 946)
880 STORE_FAST 36 (n from)
883 LOAD_FAST 36 (n from)
886 LOAD_ATTR 35 (update)
889 BUILD_MAP 1
892 LOAD_GLOBAL 36 (TaskSystem)
895 LOAD_ATTR 37 (getText)
898 LOAD_FAST 36 (n from)
901 LOAD_CONST 46 ('name')
904 BINARY_SUBSCR
905 POP_JUMP_IF_FALSE 918
908 LOAD_FAST 36 (n from)
911 LOAD_CONST 46 ('name')
914 BINARY_SUBSCR
915 JUMP_FORWARD 7 (to 925)
>> 918 LOAD_FAST 36 (n from)
921 LOAD_CONST 77 ('id')
924 BINARY_SUBSCR
>> 925 LOAD_FAST 36 (n from)
928 LOAD_CONST 78 ('messageData')
931 BINARY_SUBSCR
932 CALL_FUNCTION 2
935 LOAD_CONST 79 ('text')
938 STORE_MAP
939 CALL_FUNCTION 1
942 POP_TOP
943 JUMP_ABSOLUTE 877
>> 946 POP_BLOCK
>> 947 LOAD_FAST 35 (8 print w)
>> 950 LOAD_FAST 33 (** ] w del 7)
953 LOAD_CONST 60 ('tasks')
956 STORE_SUBSCR
957 JUMP_ABSOLUTE 963
960 JUMP_FORWARD 0 (to 963)
>> 963 LOAD_FAST 6 (t f def &)
966 LOAD_CONST 80 ('bonus_currency')
969 BINARY_SUBSCR
970 LOAD_FAST 5 (d e)
973 LOAD_CONST 81 ('bonusCurrency')
976 STORE_SUBSCR
977 LOAD_FAST 5 (d e)
980 LOAD_CONST 82 ('resources')
983 BINARY_SUBSCR
984 LOAD_FAST 5 (d e)
987 LOAD_CONST 83 ('personalResources')
990 STORE_SUBSCR
991 LOAD_FAST 5 (d e)
994 LOAD_CONST 84 ('resources_team')
997 BINARY_SUBSCR
998 LOAD_FAST 5 (d e)
1001 LOAD_CONST 85 ('teamResources')
1004 STORE_SUBSCR
1005 BUILD_LIST 0
1008 STORE_FAST 37 (exec finally)
1011 LOAD_FAST 6 (t f def &)
1014 LOAD_ATTR 32 (get)
1017 LOAD_CONST 4 ('is_afk')
1020 CALL_FUNCTION 1
1023 POP_JUMP_IF_FALSE 1042
1026 LOAD_FAST 37 (exec finally)
1029 LOAD_ATTR 17 (append)
1032 LOAD_CONST 86 ('afk')
1035 CALL_FUNCTION 1
1038 POP_TOP
1039 JUMP_FORWARD 0 (to 1042)
>> 1042 LOAD_FAST 6 (t f def &)
1045 LOAD_ATTR 32 (get)
1048 LOAD_CONST 6 ('is_tshooter')
1051 CALL_FUNCTION 1
1054 POP_JUMP_IF_FALSE 1073
1057 LOAD_FAST 37 (exec finally)
1060 LOAD_ATTR 17 (append)
1063 LOAD_CONST 87 ('tshots')
1066 CALL_FUNCTION 1
1069 POP_TOP
1070 JUMP_FORWARD 0 (to 1073)
>> 1073 LOAD_FAST 6 (t f def &)
1076 LOAD_ATTR 32 (get)
1079 LOAD_CONST 5 ('is_leaver')
1082 CALL_FUNCTION 1
1085 POP_JUMP_IF_FALSE 1104
1088 LOAD_FAST 37 (exec finally)
1091 LOAD_ATTR 17 (append)
1094 LOAD_CONST 88 ('leaver')
1097 CALL_FUNCTION 1
1100 POP_TOP
1101 JUMP_FORWARD 0 (to 1104)
>> 1104 LOAD_FAST 37 (exec finally)
1107 LOAD_FAST 5 (d e)
1110 LOAD_CONST 89 ('abuse_components')
1113 STORE_SUBSCR
1114 LOAD_FAST 6 (t f def &)
1117 LOAD_ATTR 32 (get)
1120 LOAD_CONST 9 ('abuser_status')
1123 LOAD_CONST 2 (0)
1126 CALL_FUNCTION 2
1129 LOAD_FAST 5 (d e)
1132 LOAD_CONST 90 ('abuse_status')
1135 STORE_SUBSCR
1136 LOAD_CONST 0 (None)
1139 RETURN_VALUE
1140 LOAD_FAST 2 (in elif j try u)
1143 BINARY_SUBSCR
1144 LOAD_CONST 24 ('battle_picked_drop_points')
1147 BINARY_SUBSCR
1148 POP_BLOCK
1149 STORE_SUBSCR
1150 BINARY_SUBSCR
1151 LOAD_FAST 6 (t f def &)
1154 LOAD_CONST 59 (<code object 68811780373 at 000002893BAC7D30, file "28380393646326556", line -1>)
1157 DUP_TOP
1158 <149> 33091
1161 <200> 10893
1164 <254> 33767
1167 POP_TOP
1168 STOP_CODE
1169 JUMP_FORWARD 0 (to 1172)
>> 1172 LOAD_CONST 58 (<code object 68991130928 at 000002893BAC7C30, file "28380393646326556", line -1>)
1175 LOAD_ATTR 23 (applyEconomics)
1178 LOAD_CONST 38 ('is_abuser')
1181 LOAD_FAST 12 (m while =)
1184 LOAD_GLOBAL 12 (ShipParams)
1187 BINARY_SUBSCR
1188 LOAD_CONST 59 (<code object 68811780373 at 000002893BAC7D30, file "28380393646326556", line -1>)
1191 LOAD_CONST 22 ('team_captured_points')
1194 LOAD_CONST 80 ('bonus_currency')
1197 CALL_FUNCTION_KW 6442
1200 INPLACE_LSHIFT
1201 BINARY_OR
1202 JUMP_ABSOLUTE 38392
1205 <204> 39872
1208 MAP_ADD 13678
1211 INPLACE_DIVIDE
1212 <162> 14864
1215 <172> 44480
1218 <154> 57377
1221 <152> 10852
1224 STOP_CODE
1225 STORE_FAST 23 (continue yield z)
1228 LOAD_FAST 10 (lambda x o)
1231 POP_JUMP_IF_FALSE 169
...
Nevermind ^^
Most of raw data was pretty easy to extract. results.zip
Is it supported in 12.8.0 or later versions? only 12_7_0 has related constants.py
@wihn2021 data compression mechanism that wg used in post-battle stats is too complex and too closely tied to client script that I don't want to spend time supporting it.
@wihn2021 data compression mechanism that wg used in post-battle stats is too complex and too closely tied to client script that I don't want to spend time supporting it.
Okay. It's pityful to hear that, for I'm interested in extracting results from replays to make cool statistics
Latest replay versions have new message id, which I think is related to the post battle results.
Here is part of information that we can get there:
Most likely somewhere should be something like 'header' for those arrays, just as WG did for other in-battle stuff. postbattle.zip