CL_NetGame3
Cl_netgame is the interface to communcation with a network game.
Class members
- virtual
~CL_NetGame()
- virtual const CL_NetComputer *
get_server()
- virtual const CL_NetGroup *
get_all()
- virtual bool
peek( -
int channel)
- virtual CL_NetMessage
receive( -
int channel, int timeout=-1)
- virtual void
send( -
const int dest_channel, const CL_NetGroup *dest, const CL_NetMessage &message, bool reliable = true)
- virtual void
send( -
const int dest_channel, const CL_NetGroup *dest, const CL_NetMessage &message, bool reliable = true)
- virtual CL_NetComputer *
receive_computer_leave()
- virtual const CL_NetComputer *
receive_computer_join()
- virtual const CL_NetComputer *
receive_computer_rejoin()
- virtual bool
receive_game_closed()
- virtual int
access_status( -
int channel)
- virtual bool
is_writable( -
int channel)
- virtual bool
is_readable( -
int channel)
- virtual int
receive_access_changed()
- virtual void
set_access( -
int channel, const CL_NetGroup *group, int access_rights=ACCESS_CHANNEL_READ|ACCESS_CHANNEL_WRITE)
- virtual void
set_access( -
int channel, const CL_NetGroup *group, int access_rights=ACCESS_CHANNEL_READ|ACCESS_CHANNEL_WRITE)
Members with descriptions
- virtual
~CL_NetGame() -
Description:
- virtual const CL_NetComputer *
get_server() -
Description:
The server of the network game.
- virtual const CL_NetGroup *
get_all() -
Description:
A group of all the computers in the netgame.
- virtual bool
peek( -
int channel)
Parameters: channel - Channel to look for a message.
Description:
Returns true if a message is available on the specified channel.
Return value:
True if a message is available on the specified channel.
- virtual CL_NetMessage
receive( -
int channel, int timeout=-1)
Parameters: channel - Channel to look for a message. timeout - Timeout, -1 means block forever.
Description:
Receives a message from the specified channel. The call is blocking, sodont call it if you arent completly sure it will arrive (unless you seta timeout).
Return value:
The message received from the specified channel.
- virtual void
send( -
const int dest_channel, const CL_NetGroup *dest, const CL_NetMessage &message, bool reliable = true)
Parameters: dest - Computer in the netgame to receive the message. dest_channel - Netchannel the message is sent to. message - Data in the message sent. All the data from 'message' is duplicated before this function returns. reliable - Arrival reliability. True guarantees arrival (use TCP/Pony express), false doesn't (use UDP/US Mail). dest - The group of computers to receive the message. dest_channel - Netchannel the message is sent to. message - Data in the message sent. All the data from 'message' is duplicated before this function returns. reliable - Arrival reliability. True guarantees arrival (use TCP/Pony express), false doesn't (use UDP/US Mail).
Description:
Sends a message to the computer dest at netchannel dest_port.Sends a message to a group of computers at netchannel dest_channel.
- virtual void
send( -
const int dest_channel, const CL_NetGroup *dest, const CL_NetMessage &message, bool reliable = true)
Parameters: dest - Computer in the netgame to receive the message. dest_channel - Netchannel the message is sent to. message - Data in the message sent. All the data from 'message' is duplicated before this function returns. reliable - Arrival reliability. True guarantees arrival (use TCP/Pony express), false doesn't (use UDP/US Mail). dest - The group of computers to receive the message. dest_channel - Netchannel the message is sent to. message - Data in the message sent. All the data from 'message' is duplicated before this function returns. reliable - Arrival reliability. True guarantees arrival (use TCP/Pony express), false doesn't (use UDP/US Mail).
Description:
Sends a message to the computer dest at netchannel dest_port.Sends a message to a group of computers at netchannel dest_channel.
- virtual CL_NetComputer *
receive_computer_leave() -
Description:
Returns the first (if more) computer that has left the game, or NULL ifnone. The next time the function is called, it returns the next computer,etc.It is up the game to delete the netcomputer, if it do want its object to beremoved from the all group. Note that a computer not deleted will rejoinwith the same computer object, if it isn't deleted.
Return value:
The netcomputer that left the game - delete it to remove it from the all group.
- virtual const CL_NetComputer *
receive_computer_join() -
Description:
Returns the first (if more) computer that is joining the game, or NULL ifnone. The next time the function is called, it returns the next computer,etc.
Return value:
The computer joining the game.
- virtual const CL_NetComputer *
receive_computer_rejoin() -
Description:
Returns the first (if more) computer that is re-joining the game, or NULLif none. The next time the function is called, it returns the next computer,etc. A re-joining computer is simply a computer joining the game, that stillhavn't had its CL_NetComputer object deleted. This provides a way torecognize a computer that was in the game.
Return value:
The computer re-joining the game.
- virtual bool
receive_game_closed() -
Description:
Returns true if the game was closed.
Return value:
True if game is closed, false otherwise.
- virtual int
access_status( -
int channel)
Description:
- virtual bool
is_writable( -
int channel)
Description:
- virtual bool
is_readable( -
int channel)
Description:
- virtual int
receive_access_changed() -
Description:
Client side only
- virtual void
set_access( -
int channel, const CL_NetGroup *group, int access_rights=ACCESS_CHANNEL_READ|ACCESS_CHANNEL_WRITE)
Description:
Server side onlyServer side only
- virtual void
set_access( -
int channel, const CL_NetGroup *group, int access_rights=ACCESS_CHANNEL_READ|ACCESS_CHANNEL_WRITE)
Description:
Server side onlyServer side only