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

big refactor #171

Merged
merged 80 commits into from
Oct 17, 2022
Merged

big refactor #171

merged 80 commits into from
Oct 17, 2022

Conversation

BobTheBob9
Copy link
Member

No description provided.

@BobTheBob9
Copy link
Member Author

oh my fucking god does it commit the postbuild command

@GeckoEidechse GeckoEidechse added needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge labels Oct 8, 2022
@GeckoEidechse

This comment was marked as outdated.

Copy link
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

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

Fails connecting to any gameserver rn

@GeckoEidechse
Copy link
Member

Fails connecting to any gameserver rn

Fixed with 708bfed

@pg9182
Copy link
Member

pg9182 commented Oct 9, 2022

ghcr.io/pg9182/northstar-dedicated-ci:1-tf2.0.11.0-ns1.9.7-ci.59de24a5.16.3212510647-nslauncher.b281d360.3212449064-nsmods.2637aa4e

Includes standalone datatables from @BobTheBob9. Use NS_EXTRA_ARGUMENTS=-nopakdedi (but not for sp coop). Slightly reduces the RAM usage (~10-60 MB). Eliminates the need for r2/paks/*.rpak (590MB dedi size reduction = 2GB optimized mp dedi).

Copy link
Member

@pg9182 pg9182 left a comment

Choose a reason for hiding this comment

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

Dedicated server fails to register with the master server. Tries to add itself multiple times (it's inconsistent); the first one works, but the other ones fail and breaks the auth process.

ns-aitdm-1  | [02:09:14] [info] changing mod search path from z:\tmp\ns490603817\R2Northstar\mods\Northstar.Custom\mod to R2Northstar/mods\Northstar.CustomServers
ns-aitdm-1  | [02:09:14] [info] SERVER CodeCallback CodeCallback_PostEntityInit called
ns-aitdm-1  | [02:09:14] [info] Not executing custom callbacks for CodeCallback CodeCallback_PostEntityInit
ns-aitdm-1  | [02:09:14] [info] [SERVER SCRIPT] Code Script: _init
ns-aitdm-1  | [02:09:14] [info] loading took 15.629472999999999s
ns-aitdm-1  | [02:09:15] [error] Failed reading masterserver response: got fastify error response
ns-aitdm-1  | [02:09:15] [error] {"success":false,"error":{"enum":"DUPLICATE_SERVER","msg":"A server with this port already exists for your IP address"}}
ns-aitdm-1  | [02:09:20] [error] Failed reading masterserver response: got fastify error response
ns-aitdm-1  | [02:09:20] [error] {"success":false,"error":{"enum":"DUPLICATE_SERVER","msg":"A server with this port already exists for your IP address"}}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/add_server?port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&maxPlayers=12&password=","remotePort":40762},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/add_server?port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&maxPlayers=12&password=","remotePort":10064},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/add_server?port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&maxPlayers=12&password=","remotePort":64186},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/update_values?id=a4ccf7b6afe1d16288025f26fd2a0764&port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&playerCount=0&maxPlayers=12&password=","remotePort":22456},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/update_values?id=a4ccf7b6afe1d16288025f26fd2a0764&port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&playerCount=0&maxPlayers=12&password=","remotePort":40762},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/update_values?id=a4ccf7b6afe1d16288025f26fd2a0764&port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&playerCount=0&maxPlayers=12&password=","remotePort":31646},"msg":"incoming request"}

* Port ms presence reporter to std::async

* Fix crash due to std::optional being assigned nullptr.

* Fix formatting.

* Wait 20 seconds if MS returns DUPLICATE_SERVER.
@Erlite
Copy link
Contributor

Erlite commented Oct 12, 2022

Dedicated server fails to register with the master server. Tries to add itself multiple times (it's inconsistent); the first one works, but the other ones fail and breaks the auth process.

ns-aitdm-1  | [02:09:14] [info] changing mod search path from z:\tmp\ns490603817\R2Northstar\mods\Northstar.Custom\mod to R2Northstar/mods\Northstar.CustomServers
ns-aitdm-1  | [02:09:14] [info] SERVER CodeCallback CodeCallback_PostEntityInit called
ns-aitdm-1  | [02:09:14] [info] Not executing custom callbacks for CodeCallback CodeCallback_PostEntityInit
ns-aitdm-1  | [02:09:14] [info] [SERVER SCRIPT] Code Script: _init
ns-aitdm-1  | [02:09:14] [info] loading took 15.629472999999999s
ns-aitdm-1  | [02:09:15] [error] Failed reading masterserver response: got fastify error response
ns-aitdm-1  | [02:09:15] [error] {"success":false,"error":{"enum":"DUPLICATE_SERVER","msg":"A server with this port already exists for your IP address"}}
ns-aitdm-1  | [02:09:20] [error] Failed reading masterserver response: got fastify error response
ns-aitdm-1  | [02:09:20] [error] {"success":false,"error":{"enum":"DUPLICATE_SERVER","msg":"A server with this port already exists for your IP address"}}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/add_server?port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&maxPlayers=12&password=","remotePort":40762},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/add_server?port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&maxPlayers=12&password=","remotePort":10064},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/add_server?port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&maxPlayers=12&password=","remotePort":64186},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/update_values?id=a4ccf7b6afe1d16288025f26fd2a0764&port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&playerCount=0&maxPlayers=12&password=","remotePort":22456},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/update_values?id=a4ccf7b6afe1d16288025f26fd2a0764&port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&playerCount=0&maxPlayers=12&password=","remotePort":40762},"msg":"incoming request"}
{"time":"October 09 2022 02:09AM UTC","req":{"method":"POST","url":"/server/update_values?id=a4ccf7b6afe1d16288025f26fd2a0764&port=13314&authPort=13315&name=docker%209655a3f87b68%20testing%20server&description=go%20away&map=mp_colony02&playlist=aitdm&playerCount=0&maxPlayers=12&password=","remotePort":31646},"msg":"incoming request"}

Fixed by the above PR.

@GeckoEidechse
Copy link
Member

There seems to be an issue where other players cannot a refactor server and just "Authentication Failed" instead...

Error on client

[2022-10-17 00:57:32.764] [error] Failed reading masterserver response: got fastify error response
[2022-10-17 00:57:32.764] [error] {"success":false,"error":{"enum":"JSON_PARSE_ERROR","msg":"Error parsing json response"}}

@GeckoEidechse
Copy link
Member

Also @emma-miler seems to have an issue with Northstar not launching properly on first run after cold start.

emma-miler and others added 3 commits October 16, 2022 19:35
The size check added in the refactor was incorrect:

- 56306: expected pdata size based on the pdef
- 512: allowance for trailing junk (r2 adds 137 bytes of trailing junk)
- 100: for some wiggle room

Co-Authored-By: pg9182 <96569817+pg9182@users.noreply.github.com>
A certain someone forgot to put an `0x` in front of their hex number, meaning the offset is wrong.
This would cause token to be leaked again
@GeckoEidechse
Copy link
Member

GeckoEidechse commented Oct 17, 2022

TODOs:

  • Regression check for
    • token leak
    • ClientCommand
    • DevTextBufferWrite
    • emit

@GeckoEidechse
Copy link
Member

Seems like update values has some big delay on refactor not a blocking issue but should get fixed before v1.10 release.

Copy link
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

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

Apart from update values regression, I didn't notice any issues in testing with dedi docker server and around 4-8 players on Hetzner CPX21.

(Did not check code)

Copy link
Member

@pg9182 pg9182 left a comment

Choose a reason for hiding this comment

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

  • No perf issues with the dedi on docker.
  • Wine 7.0 works for the dedi after my backported fixes.
  • Master server stuff works, auth works fine for both listen and dedi. Updated pdata max size is confirmed.
  • Some races in the master server code, but shouldn't be a problem in practice and can be fixed later.
  • aitdm, cp, and ttdm work fine (and the disconnect crash regression is fixed).
  • gamemode_fd mods branch works fine.
  • Dedi without rpaks for all but sp_coop seems to work fine, needs bob's latest mods commit.
  • Reportedly issues with delays for update_values for playercount; I'll look into that soon.
  • Client and server work fine with atlas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge needs code review Changes from PR still need to be reviewed in code needs testing Changes from the PR still need to be tested
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

9 participants