PhlexPlexico / G5API

An express API for CS2 Servers using MatchZy and PugSharp to record and manage matches.
MIT License
96 stars 31 forks source link

URLs not being set properly #252

Closed PhlexPlexico closed 1 year ago

PhlexPlexico commented 1 year ago
          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>" 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>" 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.

Originally posted by @Bunker56 in https://github.com/PhlexPlexico/G5API/issues/251#issuecomment-1605613350

PhlexPlexico commented 1 year ago

@Bunker56

Please post the following from your game server when the match is created via rcon or the game server console:

get5_remote_log_url get5_remote_backup_url get5_demo_upload_url

Bunker56 commented 1 year ago

OK

PhlexPlexico commented 1 year ago

Okay the new image is building, I think I forgot to enclose the URLs so this latest push should fix it. Just wait for the image to finish building and then update as needed and try again!

Bunker56 commented 1 year ago

I played the series, the veto worked, but it's a little strange that the deсider map appeared twice in the list, statistics are not written. I decided not to bother, here are the full logs of the played series.

https://g5test.bunker56.ru/match/5 - The match itself csgoserver-console.log G5API-error-0.log

maybe I made a mistake somewhere or didn't catch up...

PhlexPlexico commented 1 year ago

Perfect, thanks for these :) I can now get to some bug fixing here.

PhlexPlexico commented 1 year ago

Okay, would you mind updating your docker-compose to use next instead of latest? This new image should fix the issues you were having.

Alternatively, if you're using just the project, swap your branch to dep-updates and rebuild with yarn tsc and yarn restartprod

PhlexPlexico commented 1 year ago

Okay, I've made one other change to include some more logging on the events being sent to the API. Could you please run another test, even a short match to see if we can get some more information?

If so, could you also run get5_debug 1 before the match as well as get5_pretty_print_json 0 and send the logs of the match again please? It would be extremely helpful :)

Bunker56 commented 1 year ago

docker pull ghcr.io/phlexplexico/g5api:next no veto record, no statistics record. after the veto, the recording of the results stops, the score is 0:0 csgoserver-console.log G5API-error-0.log

Bunker56 commented 1 year ago

build from dep-updates branch no veto record, no statistics record. after the veto, the recording of the results stops, the score is 0:0 csgoserver-console.log G5API-error-0.log

Bunker56 commented 1 year ago

build from master branch there is a record of the veto, but the decider map is duplicated, there is no record of statistics , there is a total score (1:0) csgoserver-console.log G5API-error-0.log

PhlexPlexico commented 1 year ago

Could you also provide the regular log file from the API, not just the error log? There's some debug information in those that I need. Thanks!

Bunker56 commented 1 year ago

for which of the options?

PhlexPlexico commented 1 year ago

Nevermind actually, the game logs with get5_debug 1 were perfect enough for me to test. I've squashed the bug with the header errors. I think there may still be some outlying SQL errors, but the latest push to dep-updates should work way better than the main branch. If you give it about 10 minutes you should be able to pull next again from the docker-compose and should be able to test once more! :)

Thanks for all the help, it means a lot!

Bunker56 commented 1 year ago

No problem.

Bunker56 commented 1 year ago

Screenshot_5 No score. All logs... https://g5test.bunker56.ru/match/11 csgoserver-console.log errors_20230626.log G5API-error-0.log G5API-out-0.log L20230626.log

PhlexPlexico commented 1 year ago

Hah! Thanks for pointing that out - I was so focused on updating player stats that I forgot to increment the map stats scores when the API call came in. Okay, well it's looking like there are less errors as well, which is good! Although it seems the demo upload failed. Could you please check src/public/ and see if anything exists in there? Thanks!

Bunker56 commented 1 year ago

There really are fewer errors There is a demo in src/public/, but not in the /demos folder

Bunker56 commented 1 year ago

One more screen... The same match. It was planted at least one bomb, Screenshot_6

PhlexPlexico commented 1 year ago

Ahhh okay! So my suspicion was right - I need to get to the root of the project now, and not under src.

And yes, I just realized that I missed implementing the round_end event. Just making a few changes and it should be available to test once more shortly :)

PhlexPlexico commented 1 year ago

Alright, new next tag should be up in 5-10 minutes, I think everything you've shown should be fixed now!

Oh, and if you're not using docker make sure you upgrade the database, a new column was added to map_stats!

Bunker56 commented 1 year ago

Now working!.. Demo recording, but not archived in zip BO1 https://g5test.bunker56.ru/match/12 BO3 https://g5test.bunker56.ru/match/13 And little bugs in stats... Screenshot_11 first two maps from maplist in the score (not picked) Screenshot_10 kills/deaths difference Screenshot_7 in the previous version there was "Ban" title (not critical in principle, but...) Screenshot_9

Bunker56 commented 1 year ago

One more match,,, New docker image https://g5test.bunker56.ru/match/14 csgoserver-console.log errors_20230626.log G5API-error-0.log G5API-out-0.log L20230626.log

Bunker56 commented 1 year ago

oops!.. somehow fast for 4 rounds, or does it seem to me? Screenshot_12

PhlexPlexico commented 1 year ago

Perfect, looks like things are working forf the most part!

The front end needs to be updated because it's looking for ban in the database, but I decided to make things universal and use veto instead. So that's something small.

The map selection is just an issue with some logic in how those are determined. The old plugin used to send what map is being played during the map start call, but no longer does that so we have to deduce it based on the information we got. Since you're using the in game veto system, it should be picking that up but I guess there is an error in my SQL query.

K/D difference seems odd, I'll take a look.

And timing wise the start time begins on map start and map end, it's possible for 4 rounds to be completed in a short time frame, but I'll look :)

Bunker56 commented 1 year ago

Perfect, looks like things are working forf the most part!

Exactly!

The front end needs to be updated because it's looking for ban in the database, but I decided to make things universal and use veto instead. So that's something small.

In principle, this is not critical. As for everything else, I think it's a matter of time. :)

PhlexPlexico commented 1 year ago

Not a problem! I think I should be able to work on this in a few hours and make the fixes necessary, then it should all work!

Once again, thank you SO much for all the testing! I can only cover so much, especially since I don't have a server/people to test right now. It's much appreciated :)

Bunker56 commented 1 year ago

Anytime... I'm interested myself... Moreover, the option with the 0.10 plugin was considered, but since a second wind has opened... :)

PhlexPlexico commented 1 year ago

Okay, the latest push to that branch and next on the docker image should have fixed everything that has been reported, and G5V has been updated as well to show "ban" if "veto" or "ban" exist in the database! Feel free to give it a go!

Bunker56 commented 1 year ago

I'm getting started.

Bunker56 commented 1 year ago

Voila!..

Screenshot_13 Screenshot_14

csgoserver-console.log errors_20230627.log G5API-error-0.log G5API-out-0.log L20230627.log

Bunker56 commented 1 year ago

[get5] HTTP response body: {"message":"Unknown column 'player_stat_id' in 'field list'"} Is something wrong with me?

PhlexPlexico commented 1 year ago

Nope, that's something I need to take care of! One second here :)

E: Looking at the error logs it appears there is an edge case that I didn't notice before, and that's player IDs not existing before being called... I'll need a few more minutes to make some changes and maybe one more test to hopefully squash all the bugs with stat reporting.

Bunker56 commented 1 year ago

No problem.

PhlexPlexico commented 1 year ago

Alright, latest change is pushed, should be available in about 10 minutes once the image builds!

Bunker56 commented 1 year ago

OK, lets try,,,

Bunker56 commented 1 year ago

8 maps, 2 overtimes, demo downloading,, it`s OK. Screenshot_15 Screenshot_16

https://g5test.bunker56.ru/match/16 csgoserver-console.log errors_20230627.log G5API-error-0.log G5API-out-0.log L20230627.log

PhlexPlexico commented 1 year ago

Pertfect! Looking at the logs there is still a few events complaining after the match has finished, but that isn't really a problem. Looks like this should be good to move forward and release!!

Thank you very much for all the help :)

Bunker56 commented 1 year ago

What about Wingman ? ;) use cvars? "wingman": true in 0.14

PhlexPlexico commented 1 year ago

As for right now, I believe usage of cvars should be sufficient to set the game up for wingman :)

Bunker56 commented 1 year ago

usage of cvars

Front-end? Screenshot_17

PhlexPlexico commented 1 year ago

image Just in the CVARs there - put in the cvar you wish then hit tab to complete it :)

Bunker56 commented 1 year ago

Unknown command "set_wingman"

PhlexPlexico commented 1 year ago

I mean, that's just an example, not an actual CVAR. You will have to set your cvars there - right now there is no support for get5's wingman in the config - and I'm unsure if it's something I want to spend time implementing either

Bunker56 commented 1 year ago

logically. By the way, there is no point, it can do with a plugin like "Blocker Plant", I've already tried.

PhlexPlexico commented 1 year ago

Well, I probably won't touch the front-end, but I'll try my hand at making something on the API that can support the wingman option in the match config. How about that?

Bunker56 commented 1 year ago

Why not? Let`s try...

PhlexPlexico commented 1 year ago

Front end was easier than expected,it should be in there to toggle when creating matches now :)

Bunker56 commented 1 year ago

It`s working!.. But something with stats https://g5test.bunker56.ru/match/20 Screenshot_18 Screenshot_19 csgoserver-console.log errors_20230627.log G5API-error-0.log G5API-out-0.log L20230627.log

Bunker56 commented 1 year ago

For the purity of the experiment, I will try to recreate the database and try again...

PhlexPlexico commented 1 year ago

I guess for BNK#3 what was their first action? Planting the bomb? Or a kill/death?