Well here it is, the first rough model sketch for the MP object, this
lists all the commands for the MP object....
--Multiplayer object's public functions--
-int joinhost(string[])
This command joins the 'string[]' game lobby
error messages = 1=succesful -1=cannot connect
example: mes=joinhost("217.29.174.95"); or mes=joinhost("www.url.com");
-int makehost()
This command simply makes your computer host
1=succesful -1=error making server
-int connected()
This simply returns -1 if the computer is not connected, 1 if it is in
a lobby, or 2 if it is in game play
-int setnick(string[])
This sets the nickname of your computer, this is basically for chat but
other things too.
-int talk(string[]) talk(string[],string[])
The first broadcasts string[] to all players, the second sends a
individual
a message and no one else
-string[] gettalk()
the return value of string is "time nick private/broadcast|message"
example: "5000 Osiris broadcast|hello everyone"
I use a | character instead of a space so
if you type something like the following it will work..." spaces
behind the text"
-int launchgame()
IF you are the host of the game then you can run this function to
launch the connection over to gameplay mode.
-int sendcommand(string[],string[],string[])
This is a function for any command this player has made OR the AI's on
that computer, string[] = player string[] = category string[] = command
-string getcommand(string[])
this gets the command in a big messy string the string[] = category
so if you want to get a command from government then you do this....
string command;
string=getcommand("government");
The string also has a time stamp on it, so the string would look something
like this...
"5000 military unit100 move south"
all the commands the computer gets is safed in a big buffer, so after
all the players finish's there turns then you can get all the commands.
-int infoendturn(string[])
this returns -1 if string[] player has not ended there turn, returning
1 means the player has ended there turn and is waiting.
-int endturn(string[])
This is to end your turn OR any AI players turn, string[] = player
as usual -1 means error 1 means succesful
critism invited, tinkering invited.

===Inside workings of multiplayer(without source code : )===
????????????????????????????
| |
| |
Clashnet-------Public functions
| |
| |
| |
Connection |
| | |
| | |
| | |
Read* PlayerRead* |
| | |
[7555] [0,1,2,3,4,5,6,7]
* These class's are used for running threads,
the Read listens on Port 7555, and the PlayerRead access's players sockets
0-7(1-8 for non-progs). Clashnet is the main class, and all the public
functions are there, and they also access the 0-7 sockets for writing.
|