Inherits NetworkInterface.
Public Member Functions | |
| Network () | |
| ~Network () | |
| void | init (void) |
| Initialize or re-initialize the instance. | |
| void | reset (void) |
| Reinitialize the network. | |
| void | update (void) |
| Process command list. | |
| void | liteupdate (void) |
| Do a lightweight update to send packets and pass messages. | |
| Bool | deinit (void) |
| Shutdown connections, release memory. | |
| void | setLocalAddress (UnsignedInt ip, UnsignedInt port) |
| UnsignedInt | getRunAhead (void) |
| Get the current RunAhead value. | |
| UnsignedInt | getFrameRate (void) |
| Get the current allowed frame rate. | |
| UnsignedInt | getPacketArrivalCushion (void) |
| Returns the smallest packet arrival cushion since this was last called. | |
| Bool | isFrameDataReady (void) |
| void | parseUserList (const GameInfo *game) |
| void | startGame (void) |
| Sets the network game frame counter to -1. | |
| void | sendChat (UnicodeString text, Int playerMask) |
| void | sendDisconnectChat (UnicodeString text) |
| void | sendFile (AsciiString path, UnsignedByte playerMask, UnsignedShort commandID) |
| UnsignedShort | sendFileAnnounce (AsciiString path, UnsignedByte playerMask) |
| Int | getFileTransferProgress (Int playerID, AsciiString path) |
| Bool | areAllQueuesEmpty (void) |
| void | quitGame () |
| virtual void | selfDestructPlayer (Int index) |
| void | voteForPlayerDisconnect (Int slot) |
| virtual Bool | isPacketRouter (void) |
| Real | getIncomingBytesPerSecond (void) |
| Real | getIncomingPacketsPerSecond (void) |
| Real | getOutgoingBytesPerSecond (void) |
| Real | getOutgoingPacketsPerSecond (void) |
| Real | getUnknownBytesPerSecond (void) |
| Real | getUnknownPacketsPerSecond (void) |
| void | updateLoadProgress (Int percent) |
| void | loadProgressComplete (void) |
| void | sendTimeOutGameStart (void) |
| UnsignedInt | getLocalPlayerID (void) |
| UnicodeString | getPlayerName (Int playerNum) |
| Int | getNumPlayers (void) |
| Int | getAverageFPS () |
| Int | getSlotAverageFPS (Int slot) |
| void | attachTransport (Transport *transport) |
| void | initTransport () |
| void | setSawCRCMismatch (void) |
| Bool | sawCRCMismatch (void) |
| Bool | isPlayerConnected (Int playerID) |
| void | notifyOthersOfCurrentFrame () |
| Tells all the other players what frame we are on. | |
| void | notifyOthersOfNewFrame (UnsignedInt frame) |
| Tells all the other players that we are on a new frame. | |
| Int | getExecutionFrame () |
| Returns the next valid frame for simultaneous command execution. | |
| UnsignedInt | getPingFrame () |
| Int | getPingsSent () |
| Int | getPingsRecieved () |
Public Member Functions inherited from NetworkInterface | |
| virtual | ~NetworkInterface () |
Public Member Functions inherited from SubsystemInterface | |
| SubsystemInterface () | |
| virtual | ~SubsystemInterface () |
| virtual void | postProcessLoad () |
| virtual void | draw (void) |
| void | UPDATE (void) |
| void | DRAW (void) |
| AsciiString | getName (void) |
| void | setName (AsciiString name) |
Protected Member Functions | |
| void | GetCommandsFromCommandList () |
| Remove commands from TheCommandList and put them on the Network command list. | |
| void | SendCommandsToConnectionManager () |
| Send the new commands to the ConnectionManager. | |
| Bool | AllCommandsReady (UnsignedInt frame) |
| Do we have all the commands for the given frame? | |
| void | RelayCommandsToCommandList (UnsignedInt frame) |
| Put the commands for the given frame onto TheCommandList. | |
| Bool | isTransferCommand (GameMessage *msg) |
| Is this a command that needs to be transfered to the other clients? | |
| Bool | processCommand (GameMessage *msg) |
| Whatever needs to be done as a result of this command, do it now. | |
| void | processFrameSynchronizedNetCommand (NetCommandRef *msg) |
| If there is a network command that needs to be executed at the same frame number on all clients, it happens here. | |
| void | processRunAheadCommand (NetRunAheadCommandMsg *msg) |
| Do what needs to be done when we get a new run ahead command. | |
| void | processDestroyPlayerCommand (NetDestroyPlayerCommandMsg *msg) |
| Do what needs to be done when we need to destroy a player. | |
| void | endOfGameCheck () |
| Checks to see if its ok to leave this game. If it is, send the apropriate command to the game logic. | |
| Bool | timeForNewFrame () |
Protected Attributes | |
| ConnectionManager * | m_conMgr |
| The connection manager object. | |
| UnsignedInt | m_lastFrame |
| The last game logic frame that was processed. | |
| NetLocalStatus | m_localStatus |
| My local status as a player in this game. | |
| Int | m_runAhead |
| The current run ahead of the game. | |
| Int | m_frameRate |
| Int | m_lastExecutionFrame |
| The highest frame number that a command could have been executed on. | |
| Int | m_lastFrameCompleted |
| Bool | m_didSelfSlug |
| __int64 | m_perfCountFreq |
| The frequency of the performance counter. | |
| __int64 | m_nextFrameTime |
| When did we execute the last frame? For slugging the GameLogic... | |
| Bool | m_frameDataReady |
| Is the frame data for the next frame ready to be executed by TheGameLogic? | |
| Bool | m_checkCRCsThisFrame |
| Bool | m_sawCRCMismatch |
| std::vector< UnsignedInt > | m_CRC [MAX_SLOTS] |
| std::list< Int > | m_playersToDisconnect |
| GameWindow * | m_messageWindow |
Protected Attributes inherited from SubsystemInterface | |
| AsciiString | m_name |
Additional Inherited Members | |
Static Public Member Functions inherited from NetworkInterface | |
| static NetworkInterface * | createNetwork (void) |
The Network class is used to instantiate a singleton which implements the interface to all Network operations such as message stream processing and network communications.
Definition at line 106 of file Network.cpp.
| Network::Network | ( | ) |
The constructor.
Definition at line 269 of file Network.cpp.
| Network::~Network | ( | ) |
The destructor.
Definition at line 290 of file Network.cpp.
|
protected |
Do we have all the commands for the given frame?
returns true if all the commands are ready for the given frame.
Definition at line 565 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 920 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 448 of file Network.cpp.
| Bool Network::deinit | ( | void | ) |
Shutdown connections, release memory.
This basically releases all the memory.
Definition at line 298 of file Network.cpp.
|
protected |
Checks to see if its ok to leave this game. If it is, send the apropriate command to the game logic.
Definition at line 743 of file Network.cpp.
|
inlinevirtual |
Implements NetworkInterface.
Definition at line 165 of file Network.cpp.
|
protected |
Remove commands from TheCommandList and put them on the Network command list.
Take commands from TheCommandList and give them to the connection manager for transport.
Definition at line 468 of file Network.cpp.
|
virtual |
Returns the next valid frame for simultaneous command execution.
Implements NetworkInterface.
Definition at line 489 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 915 of file Network.cpp.
|
inlinevirtual |
Get the current allowed frame rate.
Implements NetworkInterface.
Definition at line 121 of file Network.cpp.
|
virtual |
returns the number of incoming bytes per second averaged over the last 30 sec.
Implements NetworkInterface.
Definition at line 814 of file Network.cpp.
|
virtual |
returns the number of incoming packets per second averaged over the last 30 sec.
Implements NetworkInterface.
Definition at line 825 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 984 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 1003 of file Network.cpp.
|
virtual |
returns the number of outgoing bytes per second averaged over the last 30 sec.
Implements NetworkInterface.
Definition at line 836 of file Network.cpp.
|
virtual |
returns the number of outgoing packets per second averaged over the last 30 sec.
Implements NetworkInterface.
Definition at line 847 of file Network.cpp.
|
virtual |
Returns the smallest packet arrival cushion since this was last called.
returns the smallest packet arrival cushion since this was last called.
Implements NetworkInterface.
Definition at line 880 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 227 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 237 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 232 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 991 of file Network.cpp.
|
inlinevirtual |
Get the current RunAhead value.
Implements NetworkInterface.
Definition at line 120 of file Network.cpp.
Implements NetworkInterface.
Definition at line 1011 of file Network.cpp.
|
virtual |
returns the number of bytes received per second that are not from a generals client averaged over 30 sec.
Implements NetworkInterface.
Definition at line 858 of file Network.cpp.
|
virtual |
returns the number of packets received per second that are not from a generals client averaged over 30 sec.
Implements NetworkInterface.
Definition at line 869 of file Network.cpp.
|
virtual |
Initialize or re-initialize the instance.
Initializes all the network subsystems.
<
Implements NetworkInterface.
Definition at line 324 of file Network.cpp.
|
virtual |
Tell the network to initialize the transport object
Implements NetworkInterface.
Definition at line 441 of file Network.cpp.
|
virtual |
Returns true if the game commands for the next frame have been put on the command list.
Implements NetworkInterface.
Definition at line 807 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 948 of file Network.cpp.
Implements NetworkInterface.
Definition at line 242 of file Network.cpp.
|
protected |
Is this a command that needs to be transfered to the other clients?
Does this command need to be transfered to the other game clients?
Definition at line 458 of file Network.cpp.
|
virtual |
Do a lightweight update to send packets and pass messages.
Implements NetworkInterface.
Definition at line 726 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 969 of file Network.cpp.
|
virtual |
Tells all the other players what frame we are on.
Implements NetworkInterface.
Definition at line 1028 of file Network.cpp.
|
virtual |
Tells all the other players that we are on a new frame.
Implements NetworkInterface.
Definition at line 1034 of file Network.cpp.
|
virtual |
Take a user list and build the connection queues and player lists and stuff like that.
< we zero out m_runAhead frames +1 because the game actually starts at frame 1.
Implements NetworkInterface.
Definition at line 406 of file Network.cpp.
|
protected |
Whatever needs to be done as a result of this command, do it now.
This is where any processing that needs to be done for specific game messages. Also check here to see if the logic frame number has changed to see if we need to send our info for the last frame to the other players. Return true if the message should be "eaten" by the network.
Definition at line 504 of file Network.cpp.
|
protected |
Do what needs to be done when we need to destroy a player.
Definition at line 659 of file Network.cpp.
|
protected |
If there is a network command that needs to be executed at the same frame number on all clients, it happens here.
This is where network commands that need to be executed on the same frame should be executed.
Definition at line 619 of file Network.cpp.
|
protected |
Do what needs to be done when we get a new run ahead command.
Definition at line 644 of file Network.cpp.
|
virtual |
Quit the game now. This should only be called from the disconnect screen.
Implements NetworkInterface.
Definition at line 928 of file Network.cpp.
|
protected |
Put the commands for the given frame onto TheCommandList.
Take commands from the connection manager and put them on TheCommandList. The commands need to be put on in the same order across all clients.
Definition at line 585 of file Network.cpp.
|
virtual |
Reinitialize the network.
Takes the network back to the initial state.
Implements NetworkInterface.
Definition at line 317 of file Network.cpp.
|
inlinevirtual |
Implements NetworkInterface.
Definition at line 172 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 942 of file Network.cpp.
|
virtual |
Sends a line of chat to the other players
Implements NetworkInterface.
Definition at line 891 of file Network.cpp.
|
protected |
Send the new commands to the ConnectionManager.
|
virtual |
Sends a line of chat to the other players using the disconnect manager.
Implements NetworkInterface.
Definition at line 899 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 904 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 910 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 976 of file Network.cpp.
|
virtual |
Tell the network which ip address the user has chosen to use. Well ok, they probably didn't choose it explicitly, but regardless, this is the one we're going to use.
Implements NetworkInterface.
Definition at line 431 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 372 of file Network.cpp.
|
virtual |
Sets the network game frame counter to -1.
Guess what, we're starting a game!
Implements NetworkInterface.
Definition at line 424 of file Network.cpp.
|
protected |
Definition at line 760 of file Network.cpp.
|
virtual |
Process command list.
Service queues, process message stream, etc
Implements NetworkInterface.
Definition at line 684 of file Network.cpp.
|
virtual |
Implements NetworkInterface.
Definition at line 962 of file Network.cpp.
|
virtual |
Register a vote towards a player being disconnected.
Implements NetworkInterface.
Definition at line 956 of file Network.cpp.
|
protected |
Definition at line 216 of file Network.cpp.
|
protected |
The connection manager object.
Definition at line 198 of file Network.cpp.
|
protected |
Definition at line 218 of file Network.cpp.
|
protected |
Definition at line 208 of file Network.cpp.
|
protected |
Is the frame data for the next frame ready to be executed by TheGameLogic?
Definition at line 213 of file Network.cpp.
|
protected |
Definition at line 205 of file Network.cpp.
|
protected |
The highest frame number that a command could have been executed on.
Definition at line 206 of file Network.cpp.
|
protected |
The last game logic frame that was processed.
Definition at line 200 of file Network.cpp.
|
protected |
Definition at line 207 of file Network.cpp.
|
protected |
My local status as a player in this game.
Definition at line 202 of file Network.cpp.
|
protected |
Definition at line 220 of file Network.cpp.
|
protected |
When did we execute the last frame? For slugging the GameLogic...
Definition at line 211 of file Network.cpp.
|
protected |
The frequency of the performance counter.
Definition at line 209 of file Network.cpp.
|
protected |
Definition at line 219 of file Network.cpp.
|
protected |
The current run ahead of the game.
Definition at line 204 of file Network.cpp.
|
protected |
Definition at line 217 of file Network.cpp.