R2Northstar / Northstar

Repo for packaged Northstar releases
https://northstar.tf/
MIT License
1.69k stars 129 forks source link

Starting and then leaving a listen server on an account without persistence can break authentication #374

Open ASpoonPlaysGames opened 1 year ago

ASpoonPlaysGames commented 1 year ago

Steps to reproduce: (will need a local ms for testing probably)

  1. start northstar with a new account (one that doesn't have data on the masterserver)
  2. go into the lobby
  3. click on "private match" to start a listen server
  4. exit out of the private match, do not click "quit to main menu"
  5. you should get disconnected for "Invalid Name"
  6. authentication is now broken, you will get the following error when you try to go back into the lobby image

I am unable to reproduce this on the main masterserver, I think because I already have account data on there?

ASpoonPlaysGames commented 1 year ago

oh yh running uiscript_reset which normally re-auths you and lets you bypass/fix various problems also doesn't fix this, the mainmenupromos no longer load at all, and the issue persists?

This could be something to do with how ive got my local MS set up, but idk, havent rly got any docs on how to set it up properly or what i might be doing wrong

pg9182 commented 1 year ago

you will get the following error when you try to go back into the lobby

What's the API error in the logs?

pg9182 commented 1 year ago

the mainmenupromos no longer load at all, and the issue persists?

That makes me think it's at least partly a launcher issue.

pg9182 commented 1 year ago

This could be something to do with how ive got my local MS set up

You should just be able to do a go run ./cmd/atlas, and set the masterserver url in both ns config files to http://127.0.0.1:8081/. If you want to disable all token checks and stryder auth, set ATLAS_API0_INSECURE_DEV_NO_CHECK_PLAYER_AUTH=1 in an env file (you need to pass the filename like go run ./cmd/atlas whatever.env. If you want to remap the source IPs for requests (e.g., to map internal IPs to the public IP when running locally), use ATLAS_DEV_MAP_IP with comma-separated values like 192.168.0.0/24=1.2.3.4 or 127.0.0.1=192.168.1.2.

And, if you're on windows, it's easiest if you set the env var CGO_ENABLED=0 when building to disable sqlite, which needs a C compiler.

ASpoonPlaysGames commented 1 year ago

you will get the following error when you try to go back into the lobby

What's the API error in the logs?

Not at my PC right now, but I believe it was the "document is empty" parse error

pg9182 commented 1 year ago

This issue is caused by a port conflict. I've updated the default atlas port to 8080 instead of 8081, so it should work fine now.

pg9182 commented 1 year ago

We also need to handle HTTP errors properly instead of passing empty buffers to rapidjson on error.