You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal is to introduce a new sim callback with the sole responsibility to inform the moderators. At the moment we (ab)use the GiveResourcesToPlayer callback which is also (ab)used by chat messages. Therefore we'll effectively extend the functionality of the following file/class:
Create a new class called ModeratorEvent, similar to ChatMessage except that there's no receiver field.
Create a new private field ModeratorEvents in the ReplayDataParser class. This will be an array list of type ModeratorEvent, just like the chat messages are.
In the function parseTicks we want to extend the case CMDST_LUA_SIM_CALLBACK to also check for the ModeratorEvent sim callback. The format of the sim callback is as follows:
These should be parsed and pushed into the previously mentioned private field ModeratorEvents. An (untested) example can be found in: #102
Notes
It may be interesting to also store the active command source in the ModeratorEvent class. If the player in question is not meddling with the callbacks, it should represent the same value as the From field in the callback.
The text was updated successfully, but these errors were encountered:
* Added ModeratorEvent to ReplayDataParser and handled activeCommandSource (#121)
* WIP
* Removed unused code
* Removed unnecessary code and added basic unit testing for testParseModeratorEvent
* Changed from Float to Integer, represents focus army
* Switched to using Java records instead of traditional classes for less boilerplate code
Description
The goal is to introduce a new sim callback with the sole responsibility to inform the moderators. At the moment we (ab)use the
GiveResourcesToPlayer
callback which is also (ab)used by chat messages. Therefore we'll effectively extend the functionality of the following file/class:Checklist
ModeratorEvent
, similar to ChatMessage except that there's no receiver field.ModeratorEvents
in the ReplayDataParser class. This will be an array list of typeModeratorEvent
, just like the chat messages are.parseTicks
we want to extend the caseCMDST_LUA_SIM_CALLBACK
to also check for theModeratorEvent
sim callback. The format of the sim callback is as follows:And as an example:
These should be parsed and pushed into the previously mentioned private field
ModeratorEvents
. An (untested) example can be found in: #102Notes
It may be interesting to also store the active command source in the
ModeratorEvent
class. If the player in question is not meddling with the callbacks, it should represent the same value as theFrom
field in the callback.The text was updated successfully, but these errors were encountered: