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

Server (Relay) #254

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

worstmilk
Copy link

@worstmilk worstmilk commented Jul 8, 2021

Based on #67 I said to myself, if i could make a server work in a couple of hours i would make a pull request.
So, here i am...

List:

  • Split Commands to shared library
  • Multiple clients can join
  • Basicly make it all "work"
  • "Synchronize" save game to server
  • Make the Pause/Unpause/Time work.
  • Test functionality some more
  • Refactor server/client classes for less code duplication
  • Change project to .NET core
  • Refactor namespaces
  • Optimize save game synchronization (At this moment its hooked into the save method)
  • Add documentation
  • More?

My plan is to work on above functionality in the next couple of days.
.NET Core/AspNetCore will be high on the list to support some modern tech (Like webserver etc)

@DominicMaas
Copy link
Member

I don't have time to look though this at the moment (and I'll be out of town next week).

Is the basic idea to send commands to the relay server, which then relays the commands to all connected clients?

Does the relay server become the actual server and everyone else becomes clients?

Is there still the option to host and connect as before (One user is the server, the other is the client).

@DominicMaas
Copy link
Member

Keep in mind this project (https://github.com/CitiesSkylinesMultiplayer/HolePunchTest), which I may end up integrating soon at some point (NAT hole punching for traditional client-server though NAT).

I might have to do the repo restructure in another blank PR and then rebase all these others PRs before things get too messy.

@worstmilk
Copy link
Author

I don't have time to look though this at the moment (and I'll be out of town next week).

Is the basic idea to send commands to the relay server, which then relays the commands to all connected clients?

Does the relay server become the actual server and everyone else becomes clients?

Is there still the option to host and connect as before (One user is the server, the other is the client).

No problem.

Yes exactly as you describe.
In fact, I haven't changed the client code one bit.
All the functionality still remains the same.

@worstmilk
Copy link
Author

worstmilk commented Jul 9, 2021

Keep in mind this project (https://github.com/CitiesSkylinesMultiplayer/HolePunchTest), which I may end up integrating soon at some point (NAT hole punching for traditional client-server though NAT).

I might have to do the repo restructure in another blank PR and then rebase all these others PRs before things get too messy.

It would be possible to create a separate project for this.
Having minimal changes on the codebase
The only problem is that the packet id's are generated and not fixed.
That's the whole reason the shared protocol project exists.
If we could make the packet id's fixed the server can exist without the need of the client and only support a small subset of commands.

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