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

Refactor/mutliplayer #326

Draft
wants to merge 30 commits into
base: develop
Choose a base branch
from
Draft

Refactor/mutliplayer #326

wants to merge 30 commits into from

Conversation

susch19
Copy link
Member

@susch19 susch19 commented Feb 28, 2024

No description provided.

susch19 and others added 30 commits October 6, 2022 21:40
* removed comas, as it is not maintained anymore
* use pooled memory streams for less gcs
* register IMapGenerator as it is required for the complex planet
* fixed wrong nullability on package payload, as it  is nullable and shouldn't use the nullability helper

Co-authored-by: Marcus Aurelius <[email protected]>
* so that we can have support for starting params and also commands
* implemented start command
* did a bit of cleanup in server main
* use tcp listener and tcpclient instead of sockets
* moved to valuetask for less allocations
* more or less removed some unrequired code
* removed sync of packages in baseclient, because the async might not need this (atleast in our tests)

Co-authored-by: jvbsl <[email protected]>
* to stop the simulation during running
* added configurable  port for start with default 8888, so it's backwars  compatible
* because the set default value function seems to not work, so we use the action
* fixed not compiling, because tcp listener doesn't exist anymore and was just wrongly rebased

Co-authored-by: Marcus Aurelius <[email protected]>
* because it now has the job to start and stop games
* removed the old gameservice, as it had no references left
* replaced planet with planet id at alot of places, because this way we can simplify column loading
* because of dependencies that were introduced by removing the ContainerRessourceManager resulted in errors
* reworked extension a bit, to support the new initialization order

Co-authored-by: Marcus Aurelius <[email protected]>
* so we don't need to know the serializable during creation, but can assign it on the awaiter awaiting side
* fixed issue, that octo game got disposed twice, because we added it to type container in the past
* added a simple remove method for the type container, to remove octo game from it, so it doesn't get dispoed twice

Co-authored-by: Marcus Aurelius <[email protected]>
* because the network persistense manager shouldn't have to manage awaiter and packages
* allow null as instance for awaiter, so the type information is atleast known for the generic, when the knownType is set this doesn't make any problems
* removed nofication requirement from update hub, because we know want to sent more things over it like the real types required

Co-authored-by: Marcus Aurelius <[email protected]>
* by registering and storing the action to be called for a specific type
* added response package flag, so we can distinguish between request and result on serverside
* made a lot more methods to object, because we don't have a base type anymore for networking
* added a new serialize method for INoosonSerializable, because we will slowly migrate to this interface

Co-authored-by: Marcus Aurelius <[email protected]>
* correctly deserialize the Offical Command DTOs on Client side
* added a workaround for the dto to always send the serialization id first, will be implemented correctly in the future, it was just a quick and dirty solution for the initial test
* added possibility to overwrite the deserialize func in the awaiter
* start the server correctly, by adding the disk persistance manager to the resource manager

Co-authored-by: Marcus Aurelius <[email protected]>
* by deserializing only notifications on client
* don't send guid on who am i, because it doesn't get deserialized on server and resulted in errors
* added more logging for packages
* use only one log per day
* start server on default, because entering start got pretty annoying
* added new notificaiton package flag for telling the server that we don't want a response

Co-authored-by: Marcus Aurelius <[email protected]>
* added a disconnect of the base client so we can react on this and clean up subscriptions and more
* added the non sucking framework extension so we can use the enumeration modifiable list types

Co-authored-by: Marcus Aurelius <[email protected]>
* so that we don't have to write serialize and deserialize methods anymore
* added nw interfaces for static serialize and deserialize, so that we don't always have to create the object beforehand, but can also use ctor args and more

Co-authored-by: Marcus Aurelius <[email protected]>
* fixed deadlock at some starts, because the connected event was invoked to late and therefore sometimes no subscription was present
* reworked the official command dto processing on the serverside, so that we support different method signatures and also non return type methods
* removed non used deserialize nooson and renamed the other one to represent the functio better
* added more trace and error logs for better analysing possibilities  if something goes wrong during network communication

Co-authored-by: Marcus Aurelius <[email protected]>
* started differentiation of notifications and other packages, so that these can be processed optimaly
* removed the octo type container in favor of the non sucking framework type container, because this is maintained more and is optimized
* because it shouldn't be done via simulation and also not in the specific component itself, only in the base, as this has all the requiered information
* added helper method to register all serialization id types of an assembly

Co-authored-by: Marcus Aurelius <[email protected]>
* by relaying them on server only when the instance is managed on the server
* added workaround for nooson component list deserialize, because it matches incorrectly with generic on class

Co-authored-by: Marcus Aurelius <[email protected]>
* send components after change
* send entities after subscribing to chunk column
* only send entities to simulation when local persistance manager is active
* added new interact service, so that we don't have to have the interact logic inside the entities
* added new components to support the interact without typing
* added component container to every component, because they can always only be in one container at a time and this way some features are way easier to implement
* send planet during login, because get planet might timeout otherwise during adding entity to simulation
* added support to send anything serializable over the network
* added globally unique id to components for better identification via network  transfer
* added verison to all components, so we have an easier and unified way of detecting changes
* reworked component list to support multiple components of the same type, because now the id is the unique part, so that container components arent always required for things like furnace inventories
* added serialization ids for all components that are serializable, because this way we don't have to send the full unique type name via network
* add all types with serialization id on startup from all dlls, so we don't have to register them manually and forget some in the process
* added convenience method for deserialization and serialization of serilaizables for network usage, so that we don't have to do the same serialize process all over again at different places
* added the Simulation to the component container, so we always know in which universe it is currently active
*  turned SerializationIdTypeProvider into static, because the ids are globally unique and not just per game
*  added global component list into simulation so that we don't have to iterate over the different component container just to get one specific component

Co-authored-by: Marcus Aurelius <[email protected]>
* because is doesn't belong there and was only temporary inside their
* fixed update hub still having client id,  even though we removed the methods for it
* added new Network to a waiter, so we can use the network deserialize function instead
* because the id manager was not registered and by doing everything via a central method it will be registered in the future and further changes regarding these things will be for both starts aswell
* added remove mesage for entitites, so other players see the leaving player leave
* preemptively added open to lan button for when we have the motivation to implement it
* move some classes to network from game manager, because these will be required for the open to lan functionality in the future

Co-authored-by: Marcus Aurelius <[email protected]>
* Add control from jvbsl to ensure we can show diffrent messages that we received
* Implement a chat notification that we can send from client to server and back

Co-authored-by: susch19 <[email protected]>
Co-authored-by: jvbsl <[email protected]>
* fixed enter opens chat on second press instead of first one, because it was not opened corectly and we only use activate for the hotkey, so we don't need to have a distinction between visible and not visible, because we always turn it visible
* add name to player, so we can use it in chat messages and maybe later on at different locations as well
* Turn entity to player in PlayerComponent, because only the player should be contained in there
* centralized the logout method, so that we can close the connection to the server if required and reduce the amount of code duplication

Co-authored-by: Marcus Aurelius <[email protected]>
* because we accidentally blocked the low level read write thread pool  with the async Task instead of Task.Run
* use seperated send queue, so we don't have problems with multi threading
* added simple test for create and send package, to try to reproduce a problem
* removed old and unused tests

Co-authored-by: Marcus Aurelius <[email protected]>
* so one doesn't have to search throught the whole project to find the next free id, this may be replaced by a generator in the future, that's why the empty serialization id attribute is still present
* removed some deprecated todos
* fixed some todos and hacks

Co-authored-by: Marcus Aurelius <[email protected]>
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