|
-
Dec 16th, 2010, 12:51 PM
#1
Thread Starter
Addicted Member
Re: MySQL Error
 Originally Posted by Jenner
If it's an online, multiplayer game, then ONE of the clients is acting as the game-controller or server. You can't have all computers doing their own things because they're going to disagree. The server is typically the computer of the person hosting the game since you always need at least one person to initiate the game. Even games with general grouping, there's always a "party leader" and it's his machine that's hosting the game. It's his machine that takes input from the other clients and ultimately makes the call of "that bullet hit you, you are dead" regardless of what the client currently thinks.
Your chat needs to work on the same principle. The hosting computer acts as the chat-server. All clients relay through it. It's perfectly normal for a program to act as both a server and a client, in fact, most programs like this do.
By this you mean, one of the players clients schould act like a server?
Because else I would need to have a pc that is on all day long hosting the server. Then every client needs to be enable to be a server.
Lets say like this: 3 persons A,B and C
A comes online, nobody else is online
Then he needs to be the server and client.
B comes online, then he will need to connect to A.
C comes online, connects to A.
A logs off, then B or C needs to be the client.
Kinda messy, an how do B connect to A? B can't know A's IP?
This is why I used a database in the first place.
PHP Code:
$im_addicted_to_programming = true;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|