Skip to main content
gamedev.net
🔒 Locked

Mutiple Clients?

Started by Eponick 5 replies 550+ views
Original Post
Eponick
Eponick
I was wondering how you make/manage sockets and data for multiple clients. I have things working ok for just 1 client. But single player online muds arnt fun at all Eek, i just noticed the Networking forum. Sorry. [edited by - Eponick on July 22, 2003 5:12:36 PM]
Lead ProgrammerDawn of Daria
Waverider
Waverider
You really have to design for multiplayer from the beginning. Converting from single player to multiplayer requires too much re-organization of the code if you haven't planned for it.

For methods of how to handle multiplayer programming, I recommend picking up a decent book or locating some decent articles. Sorry, I have no links or recommendations.

[edited by - Waverider on July 22, 2003 4:44:30 PM]
It's not what you're taught, it's what you learn.
Eponick
Eponick
I havnt really made a whole game and trying to turn it multiplayer.
I just have it so the server:

ESend(clientSocket, "Whats is your name:");
ESend(clientSocket, "in"); //Command to get input
ERecv(clientSocket, buffer);
PlayerName=buffer;
printf("Recieved name: %s", PlayerName);
ESend(clientSocket, "boot"); //Command to boot a player off the server


[edited by - Eponick on July 22, 2003 4:57:56 PM]
Lead ProgrammerDawn of Daria
Joe-Bob
Joe-Bob
Don''t forget that the client can and will ignore the boot command. The client always lies and cheats. Don''t trust it.
darkoneqwe
darkoneqwe
Yeah, that''s rigth. If you think that client will do everything the server tells it to do - you''re wrong. Imagine that someone cracks game''s protocol and write a client that wouldn''t respond as server expects it to do. What now?
The client shouldn''t be responsible for anything except processing input/displaying output. The server has to control the whole game and stuff...


darkone
Registered Linux User #317188
darkoneRegistered Linux User #317188
Eponick
Eponick
yea, i know...
Thats why input and quit are the only 2 server commands. the rest is just the server sending text to output
Lead ProgrammerDawn of Daria

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.