New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/#125 enhance parse moderator event to include player names #134
Feature/#125 enhance parse moderator event to include player names #134
Conversation
Gotta fix conflicts though |
Changes include renaming 'fromInt' to 'fromArmy', setting default values for player names, and player name retrieval from 'armies' object'.
bc3b94d
to
a39e372
Compare
My bad, fork was not in sync and somehow made a mess with the following rebase. I recreated the #125 branch based on the synced develop branch from FAF - This should resolve it, shouldn't? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small steps but great progress 👍 , this looks good!
faf-commons-data/src/main/java/com/faforever/commons/replay/ReplayDataParser.java
Outdated
Show resolved
Hide resolved
faf-commons-data/src/main/java/com/faforever/commons/replay/ReplayDataParser.java
Outdated
Show resolved
Hide resolved
Eh, I changed activeCommandSource by accident as well. I will revert that. Edit: Or was it wrong, tho? @Garanas Can you confirm if -1 or -2 for activeCommandSource? |
I don't think the default value matters, it should always be defined. Observers can not enable the command source, so a value of -1 is not possible. But if you want to be sure-sure, then take a default value of -2 |
Thanks for clarification. -2 it is. |
I would make the command source nullable as well for similar reasons the strings were null for the default values. It is better to not have magic numbers when null can do. |
@Sheikah45 Shouldn't we make fromArmy null as well because of similar default reasons, then? |
I would think so yes |
…ll check for army related to playerNameFromCommandSource
Thanks for the insights. Additionally, I have thrown in another null check in case
|
@magge-faf Sorry kinda of forgot about this. Is this in a good place for you? |
Yes, the PR is finished for me. Don't sweat about it, I know how busy you are with far more important stuff. I would have made a reminder-ping about this PR in a few days. It wasn't affecting my work in Mordor so far, because I can simply import the changes locally. |
This PR addresses issue #133 by adding the player name to the moderator parser
Outlined Steps:
fromInt
tofromArmy
to align with the naming convention used in methodparseGiveResourcesToPlayer
. This makes it more readable when working with thearmies
object.playerNameFromArmy
andplayerNameFromCommandSource
.playerNameFromArmy
from thearmies
object (similar toparseGiveResourcesToPlayer
).playerNameFromCommandSource
viaactiveCommandSource
from thearmies
object.This allows us to access the player names in Mordor like in the following image (I locally imported the faf-java-commons into Mordor and tested the output):
Click to reveal images about the output
@Garanas, the next step would be to bring those events officially to Mordor as seen in the image - I will raise an issue there later/tomorrow. Code is already in the pipeline.
Thanks in advance for your code review @Brutus5000, @Garanas, @Sheikah45
Fixes #133