Skip to content

🎉 Replace old Http and MasterServer code with a new API interface#165

Draft
Zentro wants to merge 9 commits intoRigsOfRods:masterfrom
Zentro:newapi
Draft

🎉 Replace old Http and MasterServer code with a new API interface#165
Zentro wants to merge 9 commits intoRigsOfRods:masterfrom
Zentro:newapi

Conversation

@Zentro
Copy link
Member

@Zentro Zentro commented Feb 11, 2025

As part of the efforts to modernize multiplayer and online experiences, these changes will allow for the server to interact with the "new" API.

As part of these changes:

  • You will now need to register a API key for your server to be listed
  • The config file will now include a server identifier and the API key
  • The server will no longer quit if it can't reach the "master server"
  • The user authentication system will no longer depend on the API
    What does this mean? You no longer have to copy and paste a long token into your client. Instead, you can create one directly from your client and use it to identify yourself as a server "admin" or "mod." If you're logged in with your forum account, your client will automatically send a temporary challenge request to the API. The server can then use this request to verify your identity against the API and assign you the "ranked" role.

Zentro and others added 9 commits February 1, 2025 22:15
the HTTP response code may end up being 0 when endpoint isn't configured.
Default value is 'http://127.0.0.1:8080' because that's what Zentro used during development.
The production value is 'https://v2.api.rigsofrods.org' but that may obviously change.
* always-empty variable `Client::m_api_key_key` causing config not to work.
* undefined function `Config::GetApiKeyKey()` causing linking error.
* unitialized variable `Client::m_api_active`, causing rorserver to attempt deauth on shutdown even in LAN mode.
* misnamed variable in sequencer.cpp, causing compile error.
@ohlidalp
Copy link
Member

ohlidalp commented Sep 1, 2025

I've dusted this off, adding commits I had in my repo and making sure it builds and runs. I haven't tested the auth tho.

Changes:

  • added config entry "apihost" specifying the API endpoint - Default value is 'http://127.0.0.1:8080/' for easy local testing.
  • fixed config entry "apikey" not having effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants