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

V2 API Route #251

Merged
merged 34 commits into from
Jun 23, 2023
Merged

V2 API Route #251

merged 34 commits into from
Jun 23, 2023

Conversation

PhlexPlexico
Copy link
Owner

@PhlexPlexico PhlexPlexico commented Jun 12, 2023

This is going to be a bit of a longer WIP branch, but this has some sweeping changes that should make this compatible with the latest versions of get5. If there is an older version, it will still look for the G5WS plugin, however it is now no longer required as of Get5 0.14.

This is the feature list that needs to be incorporated for the API that holds the connection to the game server:

Series Flow

  • Veto
    • Map Veto
    • Map Pick
    • Side Pick
  • OnMapResult
  • OnSeriesResult
  • OnBackupRestore (for remote backups)

Map Flow

  • OnGoingLive (update map stat info on the API side).
  • OnMatchPaused
  • OnMatchUnpaused
  • OnPlayerDeath (the new stats update will reside here)
    - [ ] OnPlayerBecameMVP
  • OnRoundEnd
  • OnBombPlanted
  • OnBombDefused

Misc

  • Documentation
  • Cleanup of duplicate functionality
  • Docker build/tagging
  • Dockerfile cleanup to ensure it can still actually launch within a docker conatiner
  • Remote Backups
  • Remote Demo Uploads

There is still a few other changes that need to be made, such as extending new features for match configs (like more refined veto selection and choices) that may make it into this PR, but it is still undecided.

This update will also attempt to start converting some of this project into TypeScript, as there has been quite a few issues I've ran into with typing.

Begin extra stats documentation.
Update database to use actual steam IDs and whatnot.
Remove extra player stats from legacy api since they were not finished.

Update serverrcon.js
- Breakout packet handling to its own function.
- Check version for 0.14 or higher. TBD if we can use 0.13.
- Set log and backup URLs and keys to use API keys.
- Fix formatting

Update prodrun to point to dist for compiled js.
Everything mainly in src now, types in types, services (like db and various service calls to database) in services, etc.

Bring in start of finding API key and match id. These will be checked before being sent off to different cases.
Removed OnSeriesInit as it is not needed.

Forfeits are not implemented, but may not be needed right now, can check on round end instead and update as needed.
Finish map and series finishing.

Start on pick/ban updates.
Update mapupdate to not use team ids from database.

Update various TS calls to user lowercase identifiers.
@PhlexPlexico PhlexPlexico marked this pull request as draft June 12, 2023 22:17
@PhlexPlexico PhlexPlexico added the enhancement New feature or request label Jun 12, 2023
@PhlexPlexico PhlexPlexico linked an issue Jun 12, 2023 that may be closed by this pull request
10 tasks
Adjust imports on map flow service.

Update api.ts to include new cases for the series flow.
Include OnPlayerDeath and OnMatchPaused and OnMatchUnpaused.

Update serverrcon to include demo, logs, and backups.

Update match creation to get version number if we select a server.
Since these are game specific, we will not create public API calls for this.
Update github actions to deploy next and version tag.

Begin work on demo uploads.
@PhlexPlexico PhlexPlexico force-pushed the v2-api branch 3 times, most recently from 3e2bccf to ccc7e40 Compare June 16, 2023 18:26
Update package json version.
Update leaderboard swagger to add success option.

Consider moving components to their own JS files for easier typing and location.
Include more docs for the MapFlowService.
@PhlexPlexico PhlexPlexico marked this pull request as ready for review June 17, 2023 06:20
@PhlexPlexico PhlexPlexico added the pending feedback When awaiting testing from users. label Jun 18, 2023
Fix match registering version numbers for get5.
This should fix the bug of multiple matches being generated with the same server.

Only update game server if the server is alive and available as well.
@PhlexPlexico
Copy link
Owner Author

Can confirm basic match creation is working as intended while making older versions still compatible with the old G5WS plugin.

@PhlexPlexico
Copy link
Owner Author

And also https://phlex.avidgamers.me is now pointing to the new instance. So if anyone out there wants to test, that is available!

@PhlexPlexico
Copy link
Owner Author

One or two possible issues that may have to be rectified after review and initial testing

  • Team Logos not transferring over, need to do this on series init somehow. However, team logos were already fairly broken to begin with.
  • backups and demos may not save in the public folder, but under src/public. Will need to verify that this isn't the case.

@PhlexPlexico
Copy link
Owner Author

I think aside from team logos, this should be good to merge now. Even without team logos, this is now working as intended I believe.

@PhlexPlexico PhlexPlexico merged commit c92bfb7 into master Jun 23, 2023
1 check passed
@PhlexPlexico PhlexPlexico deleted the v2-api branch June 23, 2023 18:10
@Bunker56
Copy link

Bunker56 commented Jun 24, 2023

Docker 24.0.2
Get5 0.14.7 (default cfg)
[get5.smx] Event HTTP request failed due to a network or configuration error. Make sure you have enclosed your event URL in quotes.
do I need additional plugin settings or did I fail to see something?

@Bunker56
Copy link

Bunker56 commented Jun 24, 2023

Sorry!.. I will unsubscribe in more detail later, while there is no possibility...

@PhlexPlexico
Copy link
Owner Author

PhlexPlexico commented Jun 24, 2023

So did you figure it out? You could also check the API logs and see if there's any error on its end.

Also if there is an error, please create an issue :)

@Bunker56
Copy link

one more thing confuses me, there is a get5_remote_log_url parameter in the plugin documentation, but it is not in the config file. Could it be the case?

@PhlexPlexico
Copy link
Owner Author

PhlexPlexico commented Jun 24, 2023

"get5_remote_log_url ".concat(
apiString.endsWith("/")
? apiString.concat("v2")
: apiString.concat("/v2")
)

See here, it's set during the match setup, as well as a handful of other url settings for get5. The config file does not set these as they need to be set via rcon.

@PhlexPlexico
Copy link
Owner Author

And please, if you need any more questions answered, feel free to create a new Discussion :)

@Bunker56
Copy link

Bunker56 commented Jun 24, 2023

this is a piece of the log with an error that was in the previous API, the API logs are fine, there are no errors
BNK#3: !r
L 06/24/2023 - 18:27:12: "BNK#3<3><STEAM_1:1:537158178>" say "!r"
src/common/httpclient.cpp (808) : pHost && *pHost
src/common/httpclient.cpp (808) : pHost && *pHost
L 06/24/2023 - 18:27:12: [get5.smx] Event HTTP request failed due to a network or configuration error. Make sure you have enclosed your event URL in quotes.
BNK#1: !r
L 06/24/2023 - 18:27:26: "BNK#1<6><STEAM_1:1:537225542>" say "!r"
src/common/httpclient.cpp (808) : pHost && *pHost
src/common/httpclient.cpp (808) : pHost && *pHost
L 06/24/2023 - 18:27:26: [get5.smx] Event HTTP request failed due to a network or configuration error. Make sure you have enclosed your event URL in quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pending feedback When awaiting testing from users.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request] V2 API
2 participants