Some questions about multiplayer

Hi guys, i’m working to make a mmorpg, I made my own server and client using async callback socket tested on my external ip and all worked fine also trying to move more object in the scene at the same time using server commands but i’ve some questions:

  1. How many connection can my socket handle? Considering the client just send what he want to do and the server process it and resend what to do to prevent cheats.
  2. all those data should be archivied in my local database when updated and whenever I need a data and resend I need to take that with a queue from the socket server and resend, does it make a long delay or could it performe well?
  3. i’ve many doubts about movements, how should I manage it? At this moment I send a packet everytime i, want to move in a direction and that works fine but I need to save it on db so should I calculate the next position from server and store it or at end update of client I update the position? (This could be cheatable)
  4. Tell me any problem about this system, basically I have this system client->server->update on db->resend back to client and move the scene

Hope you will answer me q.q

Uppp

it seems a little unusual to continually store player positions in a database while they’re online - perhaps you should only do this when they logout? depends on the type of game you’re making i suppose.

no idea how many connections a socket can handle. i’d say a ton, but it also is highly dependent on how much data you’re transmitting per connection. you’re probably more likely to run into cpu bottlenecks first

If you need a ton of connections you probably don’t want to run a unity instance. But if you use some lightweight socket system. You can run thousands

Mh for the movements so I should resend to all the movement someone is doing and only when disconnected store in on db?

Well, if you actually want to store all the moves in a DB. Then when they disconnect you can just save all the movement. But a better idea is to save it at logout AND every x seconds or so. Maybe once a minute. Otherwise you’re going to run into memory issues during long sessions.

Ok thanks Im going to store it at logout, its fine to send my position to all everytime my position change checking from my script? How to prevent cheats?

Now that I think how can I send a message only if is near to the player who sent the position? With db stored info I could but now idk lol

HLAPI or LLAPI?

And to prevent cheats. You don’t want to send Position but rather input, then let the server simulate results.

Im using my own server client socket!
And if you send the input and the player moves in that position and fall down (so he moves without any input) how can server let know this to all if isnt sending input?

You will have to elaborate on what you mean. And to only send to the close players. You probably want to use a trigger or something and keep a list of close by clients.