Hey, I am just playing around a little bit, so no Code here. But I am interested in how to do this.
I knew there are libs like Kryonet, but I would like to knew how to do it.
When I am checking some Online Game Sources I nearly always see that the Server is listening for CLients and for each(sic!) one it makes an own Thread… Why?
Afaik, if I have a lot of Threads ~double the amount of my Cores the PC´s Power goes down extremely. So why do some people do that? Wouldn´t it be better to make some Systems eg.: Movement, Battle, Chat System a own Thread? Although, I could think that with that the sync between Movement and Battle could be a little bit annoying
Or instead for every Client an Thread I could “batch” some Client´s together and do the work on those. But for a lot of CLient´s I will get again the same Problem.
Why not just accept the incoming login and add this Client into a list and iterate over it? I doubt that it would be an recognizable time difference, especially at RPG´s with <100 current Players. On the other Hand for Strategy Games that could be too slow.
Anyone can clarify/sort my thoughts?