Skip to content

Comments

Rust improvement#12

Open
Makosai wants to merge 38 commits intomasterfrom
rust-improvement
Open

Rust improvement#12
Makosai wants to merge 38 commits intomasterfrom
rust-improvement

Conversation

@Makosai
Copy link
Member

@Makosai Makosai commented Apr 29, 2025

This pull request changes the structure of the entire app. There was an issue in the way it was designed where it was a little difficult and annoying to interact with it from a Game Engine. I've rewritten the entire app, organized it better into individual structs, and simplified the amount of bytes being stored so RAM usage is just about minimal. The last thing I need to do is implement the Cluster and auth server. I can copy over the internal functionality of each command. I also added some new commands too related to diagnostic and determining how many players there are in a server.

The cluster server will need a permanent connection to the MasterServer so whenever a player requests a list of all servers and information on those servers, the cluster can reply with that information. I'll probably have it to where every 5 seconds, all cluster servers are pinged with a command that asks for information about them.

  • Server version should return the version from the constants field. This is only used to warn of incompatible versions. It'll eventually kick cluster servers off if the versions are too different. Only needs to be requested on registration.
  • Server uptime doesn't need to be requested. Just store the current timestamp the moment they're registered.
  • Server player count is something that's needed to see how many players are online as well as the max connections.

Makosai added 20 commits April 27, 2025 21:29
These changes follows the structure of the client with a bit of a change. It also has a ServerClient which does just about the same as a Client while exposing a bit of its senders to allow the MasterServer to send messages through it. It also strips down the amount of data that's being stored. We don't need to store the ID, that's tied to the index and the loop already. It's redundant. We also don't need to store the name of the client on the master server. Maybe on the cluster. But on the Master Server we're just redirecting people.

It also adds some notes on the approach for the auth server. Finally! :)
- Migrate to using shared::network for ClusterInfo
- Import the Security module again
- Change ServerClient to MasterClient
- Add helper functions for sending data
- Improve the Connected event so it takes an ID
-
This update seems to have improved the performance of logging by 4x. I haven't done any serious benchmarking but after stress-testing it, I saw noticeable improvements.
- Diagnostics CheckServerVersion was removed since that should be sent before any other command.
- Improve enums.
- Changed the bind address.
…earch.

This also removed ctrlc since we use tokio's ctrlc.
@Makosai Makosai added the help wanted Extra attention is needed label May 6, 2025
@Makosai
Copy link
Member Author

Makosai commented Jun 4, 2025

Sustenet v0.1.5 - This project handles all of the updates that should be implemented going forward.

@Makosai Makosai self-assigned this Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant