$treeview $search $mathjax
Stratagus  2.2.7
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

src/network/master.cpp File Reference

#include <errno.h>
#include <stdarg.h>
#include <ctype.h>
#include <limits.h>
#include <fcntl.h>
#include "stratagus.h"
#include "SDL.h"
#include "master.h"
#include "game.h"
#include "iocompat.h"
#include "netconnect.h"
#include "network.h"
#include "net_lowlevel.h"
#include "script.h"
#include "version.h"

master.cpp - The master server.

static Socket MetaServerFildes
int MetaServerInUse
std::string MasterHost
int MasterPort
 Metaserver Address.
int CclSetMetaServer (lua_State *l)
 Metaserver Port.
int MetaInit ()
int MetaClose ()
int MetaServerOK (char *reply)
int GetMetaParameter (char *reply, int pos, char **value)
int SendMetaCommand (const char *command, const char *format,...)
int RecvMetaReply (char **reply)

Function Documentation

int CclSetMetaServer ( lua_State *  l  ) 

Metaserver Port.

Set the metaserver to use for internet play.

Parameters:
l Lua state.

int GetMetaParameter ( char *  reply,
int  pos,
char **  value 
)

Retrieves the value of the parameter at position paramNumber

Parameters:
reply The reply from the metaserver
pos The parameter number
value The returned value
Returns:
-1 if error.

int MetaClose (  ) 

Close Connection to Master Server

Returns:
nothing

int MetaInit (  ) 

Initialize the TCP connection to the Meta Server.

Returns:
-1 fail, 0 success.
Todo:
Make a dynamic port allocation.

int MetaServerOK ( char *  reply  ) 

Checks if a Message was OK or ERR

Returns:
1 OK, 0 Error.

int RecvMetaReply ( char **  reply  ) 

Receive reply from Meta Server

Parameters:
reply Text of the reply
Returns:
error or number of bytes

int SendMetaCommand ( const char *  command,
const char *  format,
  ... 
)

Send a command to the meta server

Parameters:
command command to send
format format of parameters
... parameters
Returns:
-1 fail, length of command


Variable Documentation

std::string MasterHost

Metaserver Address.

(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.