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

Basic persistance #24

Merged
merged 5 commits into from
Sep 2, 2024
Merged

Conversation

seionmoya
Copy link
Collaborator

@seionmoya seionmoya commented Sep 2, 2024

It's a much larger patchset than I would like, but one thing required another thing, and another thing, and... you get the idea.

Overview

On server startup:

  • Load all accounts in Fuyu/Accounts/

How registration works:

  1. User can register an account (username, password and edition)
  2. accountId is int, The account registration will find gaps in ids and fill automatically
  3. Once registration is done, save account to disk

How login works:

  1. User can login to an existing account (username, password)
  2. If the login is successful, return a new session id (generated from MongoId)
  3. The returned session id is used for starting EFT

On EFT wipe profile:

  • When done, save account to disk

Other changes

  • Login server (fuyu) is on localhost:8000 and EFT Main server (eft-main) is on localhost:8001
  • The start server button is gone. I think having a separate server management tool is better
  • Added initial EFT: Arena code to the launcher
  • Launcher flow has been reworked to support login/registration

Notes

I am using multi-threading whever possible as I want Fuyu to account for large-scale systems and for machines with many cores (most EFT players have high-end systems to run the game with at least 12 virtual threads available).

Discussion

I personally do not like AccountTable loading in the accounts from AccountTable.Load, maybe a separate DatabaseSourceProvider or something needs to be created that populated the database on load. This way the database is not responsible for both holding the data and providing sources.

I noticed that ConcurrentDictionary<T> and ConcurrentBag<T> are much faster than manual locking. I'll remove the locking system in a separate patch, and replace Dictionary<T>/List<T> with their threadsafe counterparts respectively.

I think I want EFT's servers to run on localhost:801x and Arena's servers on localhost:802x.

The launcher really needs some work but I'm absolutely crap at it. I want a login/register/account/settings screen relatively simular to that of SPT's. The workflow is rather nice, but it would be nice to support a server list so users can select the server they want to use (in case they want to play on multiple different servers)

@seionmoya seionmoya added the enhancement New feature or request label Sep 2, 2024
@seionmoya seionmoya self-assigned this Sep 2, 2024
@seionmoya seionmoya merged commit 564f299 into project-fika:main Sep 2, 2024
1 check failed
@seionmoya seionmoya deleted the basic-persistance branch September 2, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant