hey every1, i have an engine class in c++ that when run either creates a server or client. i have some engine functions that iw oudl like to call in the server/client, but dont want to store a pointer back up to the engine. would it make sense for the server and client to inherit from the engine?
but then that means the engine and client for exmple will be strongly coupled, because the engin creates a client and the client has to store a pointer to the engine that created it.... thats bad right?
the biggest issuei have right now is that from the client, you can create a new server in its own process.. like if you decided to host a game for example
but im not sure how to do that from the client... i would have to go back up to the engine and request it to be done right?
my design was to start a client only, because if you want to join a dedicated server, i dont want to have a local server running all the time because it would waste resources... or can i make the server process sleep somehow and not take away any performance when im connecting the client to a remote server?
I presume the server process has some Start() method that you call to initialize "hosting a game" and some Stop() method to you call to dispose of everything.
i wnat the server to pretty much identical to a dedicated server though... the dedicated server would just loop continuously looking for connections.. if my server isnt running then i have to figure out someway to start it before i can send connection packets to it right? this is assuming i put it in a seperat eprocess
but it is not limited by any kind of sleep or anything... so it will run as fast as possible right? eatup allmy cpu?
but i mean in a real game scenario the server will be doing all of its serving duties so it isn't sitting waiting for connections... it just polls for any connection requests when it has time to