I Feel Stupid
If you dont have the book Programming Role Playing Games with DirectX, then this probably wont make much sense.
In chapter 19 it has a server, client set up.
I have gone over the source code of these two applications over and over, and for some reason I just dont get the flow of things.
I know the server hosts, then waits for messages to place in a message queue, while constantly processing any messages in the queue. One message it gets is to creat a new player in the game.
Now the client, I know connects with the server, and when it gets a connected message, sets a global variable to TRUE stating it is connected.
My problem is when does the client tell the host that it is a new player joinging the game. Or does the host have to tell the client its ok to join, once the client is connected? Im soooo confused over the order of messages, and what message is sent first and to whom.
I have the source code, but I just cant seem to make much sense of the flow.
So if anyone can help I appreciate it.
It depends on the game; most systems I''ve seen will require the client to request a join
Server:
Client: Hi
Server: Hi, how can I help?
Client: I want to see what games are running
Server: Here you go
Client: Can I join game # 3?
Server: No, that game is full
Client: What about # 4?
Server: That has 3 slots available, would you like to join?
Client: Yes
Server: You are now present in game # 4
Client: WOOOOHOOOO I AM IN TEH GAEM
....
....
....
Client: I''ve had enough
Server: Want to play another game?
Client: No
Server: Anything else you''d like to do?
Client: Nah
Server: Be on your way then
Client: Thanks, see ya
Server: Bye
Server: ...
Server: ... ass
Server:
Client: Hi
Server: Hi, how can I help?
Client: I want to see what games are running
Server: Here you go
Client: Can I join game # 3?
Server: No, that game is full
Client: What about # 4?
Server: That has 3 slots available, would you like to join?
Client: Yes
Server: You are now present in game # 4
Client: WOOOOHOOOO I AM IN TEH GAEM
....
....
....
Client: I''ve had enough
Server: Want to play another game?
Client: No
Server: Anything else you''d like to do?
Client: Nah
Server: Be on your way then
Client: Thanks, see ya
Server: Bye
Server: ...
Server: ... ass
It''s a semi-humourus representation of how things work. If a client connects to the server ONLY to play a game (eg: they can''t walk around ghosting, they can''t sit inthe lounge chatting, etc) then you can get by with just starting the game.
Every protocol I''ve seen has required the client to request the service from the server before the server does anything.
Every protocol I''ve seen has required the client to request the service from the server before the server does anything.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement