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

network.h File Reference
#include "network/netsockets.h"

Go to the source code of this file.


class  CNetworkParameter

network.h - The network header file.

CUDPSocket NetworkFildes
 Network is in sync. More...
bool NetworkInSync
 Network file descriptor. More...
bool IsNetworkGame ()
 Network is in sync. More...
void InitNetwork1 ()
void ExitNetwork1 ()
 Initialise network. More...
void NetworkOnStartGame ()
 Cleanup network (port) More...
void NetworkEvent ()
 Initialise network data for ingame communication. More...
void NetworkSync ()
 Handle network events. More...
void NetworkQuitGame ()
 Hold in sync. More...
void NetworkRecover ()
 Quit game: warn other users. More...
void NetworkCommands ()
 Recover network. More...
void NetworkSendChatMessage (const std::string &msg)
 Get all network commands. More...
void NetworkSendCommand (int command, const CUnit &unit, int x, int y, const CUnit *dest, const CUnitType *type, int status)
 Send network command. More...
void NetworkSendExtendedCommand (int command, int arg1, int arg2, int arg3, int arg4, int status)
 Send extended network command. More...
void NetworkSendSelection (CUnit **units, int count)
 Send Selections to Team. More...
void NetworkCclRegister ()

Function Documentation

◆ ExitNetwork1()

void ExitNetwork1 ( )

Initialise network.

Cleanup network.

◆ InitNetwork1()

void InitNetwork1 ( )

Initialize network port.

◆ IsNetworkGame()

bool IsNetworkGame ( )

Network is in sync.

◆ NetworkCclRegister()

void NetworkCclRegister ( )

◆ NetworkCommands()

void NetworkCommands ( )

Recover network.

Handle network commands.

◆ NetworkEvent()

void NetworkEvent ( )

Initialise network data for ingame communication.

Called if message for the network is ready. (by WaitEventsOneFrame)

◆ NetworkOnStartGame()

void NetworkOnStartGame ( )

Cleanup network (port)

Game will start now. (This function runs on all clients.)

◆ NetworkQuitGame()

void NetworkQuitGame ( )

Hold in sync.

Quit the game.

◆ NetworkRecover()

void NetworkRecover ( )

Quit game: warn other users.

Recover network.

◆ NetworkSendChatMessage()

void NetworkSendChatMessage ( const std::string &  msg)

Get all network commands.

Send chat message. (Message is sent with low priority)

msgText message to send.

◆ NetworkSendCommand()

void NetworkSendCommand ( int  command,
const CUnit unit,
int  x,
int  y,
const CUnit dest,
const CUnitType type,
int  status 

Send network command.

Send chat message

Prepare send of command message.

Convert arguments into network format and place it into output queue.

commandCommand (Move,Attack,...).
unitUnit that receive the command.
xoptional X map position.
yoptional y map position.
destoptional destination unit.
typeoptional unit-type argument.
statusAppend command or flush old commands.
Destination and unit-type shares the same network slot.

◆ NetworkSendExtendedCommand()

void NetworkSendExtendedCommand ( int  command,
int  arg1,
int  arg2,
int  arg3,
int  arg4,
int  status 

Send extended network command.

Prepare send of extended command message.

Convert arguments into network format and place it into output queue.

commandCommand (Move,Attack,...).
arg1optional argument #1
arg2optional argument #2
arg3optional argument #3
arg4optional argument #4
statusAppend command or flush old commands.

◆ NetworkSendSelection()

void NetworkSendSelection ( CUnit **  units,
int  count 

Send Selections to Team.

Sends my selections to teammates

unitsUnits to send
countNumber of units to send

◆ NetworkSync()

void NetworkSync ( )

Handle network events.

Variable Documentation

◆ NetworkFildes

CUDPSocket NetworkFildes

Network is in sync.

◆ NetworkInSync

bool NetworkInSync

Network file descriptor.

(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.