Skip to content
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

Improve round end information, and add DiscordRoundEnded plugin #256

Merged
merged 7 commits into from
Jan 2, 2023

Conversation

ect0s
Copy link
Contributor

@ect0s ect0s commented Sep 29, 2022


Adds round-tickets regex to logparser; this will fire when the server prints new log lines related to tickets and factions.

Adds round-ended regex to log parser and event; this event forwards round tickets where we have both a winner and a loser to the main server object.

discord-roundended: This plugin is similar but functionally different from round winner, due to cases where the server experiences a draw.

This is an initial commit, and will need additional work.

Currently known issues:

We only see round-tickets when the map is not a draw, this is fairly often, however our current round-winner event always fires (though incorrectly labels all matches with a winner, even if they are a draw).

The larger issue is the changes required in DBlog and elsewhere to smooth things over, these will result in schema changes that require DBlog to alter tables.

Further, in the case of FTP logging, we currently assume the log and rcon state are closely coupled, this is not always the case;

This means plugins like discord-roundwinner, that take the previous map are not guaranteed to be correct, and further issues around how we construct that data abound (layers.json missing data, see #222 )

The well defined path here should be stable, but edge cases around FTPlogging and such make the "draw" path much harder to handle.

[2022.09.28-18.23.37:222][892]LogSquadTrace: [DedicatedServer]DetermineMatchWinner(): Local Militia Group won on Kamdesh Highlands
[2022.09.28-18.23.37:222][892]LogSquadTrace: [DedicatedServer]DetermineMatchWinner(): The game was a draw on Kamdesh Highlands
[2022.09.28-18.23.37:223][892]LogGameState: Match State Changed from InProgress to WaitingPostMatch

The above is a map with a draw,

Currently NEW_GAME will report


Local Militia Group won on Kamdesh Highlands

But this is incorrect, and the new log lines will not appear, leaving an ambiguous state.

Adds round-tickets regex to logparser; this will fire when the server prints new log lines related to tickets and factions.

Adds round-ended regex to log parser and event; this event forwards round tickets where we have both a winner and a loser to the main server object.

discord-roundended: This plugin is similar but functionally different from round winner, due to cases where the server experiences a draw.
@werewolfboy13
Copy link
Collaborator

Got this error on mine when I added it.
image

Missing Early Return
@ect0s
Copy link
Contributor Author

ect0s commented Oct 7, 2022

It appears I missed the early return for draws

Got this error on mine when I added it. image

This should be fixed

@ect0s
Copy link
Contributor Author

ect0s commented Oct 7, 2022

[2022.09.29-10.47.59:424][474]LogSquadGameEvents: Display: Team 2, RUS 49th Combined Arms Army ( Russian Ground Forces ) has won the match with 294 Tickets on layer Narva RAAS v5 (level Narva)!
[2022.09.29-10.47.59:424][474]LogSquadGameEvents: Display: Team 1, USMC 3rd Light Armored Recon Battalion ( United States Marine Corps ) has lost the match with 296 Tickets on layer Narva RAAS v5 (level Narva)!

It appears the ticket totals we get may not always be super accurate. Squad has long had an issue of tickets getting subtracted during/after the scoreboard appears, I believe this is the issue under the hood.

Will need additional testing to see how this occurs. The above was generated on a map that timed out after the test server emptied for the night

@watchful-eyes
Copy link

[2022.09.29-10.47.59:424][474]LogSquadGameEvents: Display: Team 2, RUS 49th Combined Arms Army ( Russian Ground Forces ) has won the match with 294 Tickets on layer Narva RAAS v5 (level Narva)!
[2022.09.29-10.47.59:424][474]LogSquadGameEvents: Display: Team 1, USMC 3rd Light Armored Recon Battalion ( United States Marine Corps ) has lost the match with 296 Tickets on layer Narva RAAS v5 (level Narva)!

It appears the ticket totals we get may not always be super accurate. Squad has long had an issue of tickets getting subtracted during/after the scoreboard appears, I believe this is the issue under the hood.

Will need additional testing to see how this occurs. The above was generated on a map that timed out after the test server emptied for the night

Is that really the case?
Yes it inacurrate but it gets layer info directly from log and ticket counts doesn't have effect in code.

@ect0s
Copy link
Contributor Author

ect0s commented Oct 7, 2022

Is that really the case?

Yes, the above log lines are directly from testing.

In the past, before OWI added the 'victory flags' animations to the scoreboard, you would often see tickets getting adjusted slightly during the scoreboard screen. It was entirely possibly that before moving to the next match both teams would have negative tickets.

Yes it inacurrate but it gets layer info directly from log and ticket counts doesn't have effect in code.

The accuracy is an issue if anyone starts tracking ticket differentials. The data may be harder to understand if the winning team has less tickets logged than the loser.

The tickets don't have an effect in code until someone decides to write plugins off the event, or include them in Dblog etc

Copy link
Collaborator

@werewolfboy13 werewolfboy13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on live server.

@werewolfboy13 werewolfboy13 enabled auto-merge (squash) December 28, 2022 23:17
Copy link
Contributor

@Sentennial Sentennial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on private server.
Three tests shown in order in SS below.

  1. Match ended in draw
  2. Match ended with 1 ticket difference
  3. Match ended with 2 ticket difference

results

Copy link

@Coolisbetter Coolisbetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve

edit: oops wrong account, lol

Copy link
Contributor

@Sentennial Sentennial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

triage perms approve

Copy link
Collaborator

@Thomas-Smyth Thomas-Smyth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR.

squad-server/log-parser/round-ended.js Show resolved Hide resolved
@Thomas-Smyth Thomas-Smyth changed the title Add round-tickets and round-ended events; discord-roundended plugin Improve round end information, and add DiscordRoundEnded plugin Jan 1, 2023
@Thomas-Smyth Thomas-Smyth added core feature request Feature request related to the core SquadJS API minor Minor Change labels Jan 1, 2023
@Thomas-Smyth Thomas-Smyth disabled auto-merge January 2, 2023 18:59
@Thomas-Smyth Thomas-Smyth merged commit 2f0cd85 into Team-Silver-Sphere:master Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature request Feature request related to the core SquadJS API minor Minor Change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants