#include <C4Network2.h>
Classes | |
class | InitialConnect |
Public Types | |
enum | InitResult { IR_Success , IR_Error , IR_Fatal } |
Public Attributes | |
C4Network2IO | NetIO |
C4Network2ResList | ResList |
C4Network2ClientList | Clients |
C4Network2Players | Players |
C4Network2Status | Status |
Protected Member Functions | |
bool | InitNetIO (bool fNoClientID, bool fHost) |
void | HandleConn (const class C4PacketConn &Pkt, C4Network2IOConnection *pConn, C4Network2Client *pClient) |
bool | CheckConn (const C4ClientCore &CCore, C4Network2IOConnection *pConn, C4Network2Client *pClient, StdStrBuf *szReply) |
bool | HostConnect (const C4ClientCore &CCore, C4Network2IOConnection *pConn, StdStrBuf *szReply) |
bool | Join (C4ClientCore &CCore, C4Network2IOConnection *pConn, StdStrBuf *szReply) |
void | HandleConnRe (const class C4PacketConnRe &Pkt, C4Network2IOConnection *pConn, C4Network2Client *pClient) |
void | HandleStatus (const C4Network2Status &nStatus) |
void | HandleStatusAck (const C4Network2Status &nStatus, C4Network2Client *pClient) |
void | HandleActivateReq (int32_t iTick, C4Network2Client *pClient) |
void | HandleJoinData (const class C4PacketJoinData &rPkt) |
void | OnConnect (C4Network2Client *pClient, C4Network2IOConnection *pConn, const char *szMsg, bool fFirstConnection) |
void | OnConnectFail (C4Network2IOConnection *pConn) |
void | OnDisconnect (C4Network2Client *pClient, C4Network2IOConnection *pConn) |
void | OnClientConnect (C4Network2Client *pClient, C4Network2IOConnection *pConn) |
void | OnClientDisconnect (C4Network2Client *pClient) |
void | SendJoinData (C4Network2Client *pClient) |
bool | CreateDynamic (bool fInit) |
void | RemoveDynamic () |
bool | PauseGame (bool fAutoContinue) |
bool | ChangeGameStatus (C4NetGameState enState, int32_t iTargetCtrlTick, int32_t iCtrlMode=-1) |
void | CheckStatusReached (bool fFromFinalInit=false) |
void | CheckStatusAck () |
void | OnStatusReached () |
void | OnStatusAck () |
void | UpdateChaseTarget () |
bool | InitLeague (bool *pCancel) |
void | DeinitLeague () |
bool | LeagueStart (bool *pCancel) |
bool | LeagueUpdate () |
bool | LeagueUpdateProcessReply () |
bool | LeagueEnd (const char *szRecordName=nullptr, const BYTE *pRecordSHA=nullptr) |
bool | StreamIn (bool fFinish) |
bool | StreamOut () |
void | InitPuncher () |
bool | Execute (int, pollfd *) override |
Private Member Functions | |
bool | Execute (int, pollfd *) override |
Friends | |
class | C4Network2IO |
Definition at line 101 of file C4Network2.h.
C4Network2::C4Network2 | ( | ) |
Definition at line 126 of file C4Network2.cpp.
|
override |
Definition at line 134 of file C4Network2.cpp.
References Clear().
void C4Network2::AbortLobbyCountdown | ( | ) |
Definition at line 2864 of file C4Network2.cpp.
References C4GameLobby::Countdown::Abort(), and pLobbyCountdown.
Referenced by C4GameLobby::MainDlg::OnRunBtn(), C4MessageInput::ProcessCommand(), and StartLobbyCountdown().
void C4Network2::AddVote | ( | const C4ControlVote & | Vote | ) |
Definition at line 2683 of file C4Network2.cpp.
References C4Control::Add(), CID_Vote, C4Control::firstPkt(), fPausedForVote, isHost(), isRunning(), iVoteStartTime, OpenVoteDialog(), Pause(), Vote(), and Votes.
void C4Network2::AllowJoin | ( | bool | fAllow | ) |
Definition at line 802 of file C4Network2.cpp.
References Config, fAllowJoin, C4GraphicsSystem::FlashMessage(), Game, GraphicsSystem, isHost(), C4Game::IsRunning, LoadResStr(), C4Config::Network, and C4ConfigNetwork::NoRuntimeJoin.
Referenced by C4Game::InitNetworkHost(), and ToggleAllowJoin().
|
protected |
Definition at line 1817 of file C4Network2.cpp.
References C4Network2ClientList::BroadcastMsgToClients(), CheckStatusReached(), Clients, fStatusAck, fStatusReached, C4Network2Status::getStateName(), InvalidateReference(), isHost(), LogSilentF(), MkC4NetIOPacket(), PID_Status, C4Network2ClientList::ResetReady(), C4Network2Status::Set(), C4Network2Status::SetCtrlMode(), and Status.
Referenced by DoLobby(), HandleStatusAck(), OnClientDisconnect(), Pause(), SetCtrlMode(), Start(), and Sync().
|
protected |
Definition at line 1317 of file C4Network2.cpp.
References C4ClientCoreDL_IDMatch, C4Network2Client::getCore(), C4ClientCore::getDiffLevel(), and C4Network2Client::hasConn().
Referenced by HandleConn().
|
protected |
Definition at line 1885 of file C4Network2.cpp.
References C4Network2ClientList::AllClientsReady(), C4Network2ClientList::BroadcastMsgToClients(), Clients, C4GameControlNetwork::ExecSyncControl(), fStatusAck, fStatusReached, C4Network2Status::getState(), GS_Go, GS_Pause, isHost(), MkC4NetIOPacket(), OnStatusAck(), pControl, PID_StatusAck, and Status.
Referenced by CheckStatusReached(), HandleStatusAck(), OnClientDisconnect(), and Sync().
|
protected |
Definition at line 1840 of file C4Network2.cpp.
References CheckStatusAck(), Clients, Console, Control, C4GameControl::ControlTick, C4GameControlNetwork::CtrlReady(), C4GameControl::CtrlTickReached(), fChasing, fDelayedActivateReq, fLobbyRunning, fStatusReached, Game, C4Network2Status::getState(), C4Network2Status::getTargetCtrlTick(), GS_Go, GS_Lobby, GS_Pause, C4Game::HaltCount, isHost(), C4Game::IsRunning, MkC4NetIOPacket(), OnStatusReached(), pControl, PID_StatusAck, RequestActivate(), C4Network2ClientList::SendMsgToHost(), C4GameControlNetwork::SetRunning(), C4Network2Status::SetTargetTick(), Status, and C4ConsoleGUI::UpdateHaltCtrls().
Referenced by ChangeGameStatus(), DoLobby(), Execute(), FinalInit(), and HandleStatus().
void C4Network2::Clear | ( | ) |
Definition at line 712 of file C4Network2.cpp.
References Application, C4GameControl::ChangeToLocal(), C4Control::Clear(), StdStrBuf::Clear(), C4Network2Status::Clear(), C4Network2ClientList::Clear(), C4Network2IO::Clear(), C4Network2Players::Clear(), C4Network2ResList::Clear(), Clients, Control, DeinitLeague(), fAllowJoin, fDelayedActivateReq, fDynamicNeeded, fLobbyRunning, fPausedForVote, fStatusAck, fStatusReached, iDynamicTick, iLastChaseTargetUpdate, iLastLeagueUpdate, iLastOwnVoting, iLastReferenceUpdate, C4GameControl::isNetwork(), LeagueEnd(), C4TimeMilliseconds::NegativeInfinity, NetIO, NetpuncherGameID, Players, pLeagueClient, pLobby, pLobbyCountdown, pVoteDialog, StdScheduler::Remove(), ResList, sPassword, Status, StopStreaming(), tLastActivateRequest, and Votes.
Referenced by C4Game::Clear(), DoLobby(), FinalInit(), HandleJoinData(), InitHost(), C4MainMenu::MenuCommand(), OnClientDisconnect(), OnDisconn(), and ~C4Network2().
|
protected |
Definition at line 1770 of file C4Network2.cpp.
References _MAX_PATH, _MAX_PATH_LEN, C4Network2ResList::AddByFile(), C4Config::AtNetworkPath(), C4GameSave::Close(), Config, Control, fDynamicNeeded, C4Network2ResList::FindTempResFileName(), Game, C4Network2Res::getCore(), GetFilename(), C4GameControl::getNextControlTick(), iDynamicTick, isHost(), LoadResStr(), Log(), NRT_Dynamic, RemoveDynamic(), ResDynamic, ResList, C4GameSave::Save(), C4Game::ScenarioFilename, and sprintf.
Referenced by InitHost(), and OnGameSynchronized().
void C4Network2::DeactivateInactiveClients | ( | ) |
Definition at line 1971 of file C4Network2.cpp.
References Application, C4NetDeactivationDelay, CDT_Sync, CID_ClientUpdate, Clients, Control, CUT_Activate, C4GameControl::DoInput(), C4Game::FrameCounter, Game, C4Network2ClientList::GetNextClient(), C4Application::isEditor, isHost(), and C4Network2ClientList::UpdateClientActivity().
Referenced by Execute().
|
protected |
Definition at line 2115 of file C4Network2.cpp.
References Application, StdStrBuf::Clear(), Game, C4GameParameters::League, C4GameParameters::LeagueAddress, MasterServerAddress, C4Game::Parameters, pLeagueClient, and StdScheduler::Remove().
Referenced by Clear(), InitHost(), LeagueSignupDisable(), LeagueSignupEnable(), LeagueStart(), and LeagueSurrender().
bool C4Network2::DoLobby | ( | ) |
Definition at line 433 of file C4Network2.cpp.
References C4Window::Active, Application, ChangeGameStatus(), CheckStatusReached(), Clear(), C4GUI::Dialog::Close(), C4GUI::Screen::CloseAllDialogs(), Config, Console, C4GUI::Dialog::FadeIn(), fAllowJoin, fLobbyRunning, Game, GS_Lobby, C4Game::iLobbyTimeout, C4GUI::Dialog::IsAborted(), isEnabled(), isHost(), isLobbyActive(), C4GUI::Dialog::IsShown(), LoadResStr(), Log(), C4Config::Network, C4ConfigNetwork::NoRuntimeJoin, C4AbstractApp::NotifyUserIfInactive(), pGUI, pLobby, pLobbyCountdown, StdScheduler::ScheduleProcs(), StartLobbyCountdown(), and C4Console::UpdateMenus().
Referenced by C4Game::Init(), and C4Game::InitNetworkHost().
void C4Network2::DrawStatus | ( | C4TargetFacet & | cgo | ) |
Definition at line 1084 of file C4Network2.cpp.
References StdStrBuf::Append(), StdStrBuf::AppendFormat(), C4GameControlNetwork::ClientNextControl(), C4GameControlNetwork::ClientPerfStat(), C4GameControlNetwork::ClientReady(), Clients, CNM_Central, CNM_Decentral, Config, Control, C4GameControl::ControlRate, C4GameControl::ControlTick, C4Network2IO::DataIO(), C4GraphicsResource::FontRegular, fStatusAck, fStatusReached, fStreaming, C4GameControlNetwork::getAvgControlSendTime(), C4GameControlNetwork::GetBehind(), C4GameControlNetwork::getControlPreSend(), C4Network2Status::getCtrlMode(), StdStrBuf::getData(), C4ClientCore::getID(), C4Network2Client::getID(), C4Network2ClientList::GetLocal(), C4ClientCore::getName(), C4Network2Client::getName(), C4Network2IO::getNetIOName(), C4Network2IO::getNetIOProt(), C4Network2ClientList::GetNextClient(), getPendingStreamData(), C4Network2IO::getProtBCRate(), C4Network2IO::getProtIRate(), C4Network2IO::getProtORate(), StdBuf::getSize(), C4Network2Status::getStateName(), C4Record::GetStreamingBuf(), C4Record::GetStreamingPos(), C4Network2Status::getTargetCtrlTick(), GraphicsResource, iCurrentStreamPosition, C4ClientCore::isActivated(), C4Network2Client::isActivated(), isEnabled(), C4ClientCore::isHost(), C4Network2Client::isHost(), C4ClientCore::isObserver(), C4Network2Client::isObserver(), C4Network2IO::MsgIO(), NCS_Chasing, NCS_Joining, NCS_NotReady, NCS_Remove, NetIO, C4Config::Network, P_NONE, P_TCP, P_UDP, pControl, pDraw, C4ConfigNetwork::PortTCP, C4ConfigNetwork::PortUDP, pStreamedRecord, Status, C4Facet::Surface, C4Draw::TextOut(), C4Facet::X, and C4Facet::Y.
Referenced by C4Viewport::Draw().
void C4Network2::EndVote | ( | C4ControlVoteType | eType, |
bool | fApprove, | ||
int32_t | iData | ||
) |
Definition at line 2712 of file C4Network2.cpp.
References C4ClientIDAll, C4ClientIDUnknown, C4Game::Clients, C4Control::Delete(), C4Control::firstPkt(), fPausedForVote, Game, C4ClientList::getLocalID(), C4IDPacket::getPkt(), GetVote(), C4VoteDialog::getVoteData(), C4VoteDialog::getVoteType(), iLastOwnVoting, iVoteStartTime, OpenSurrenderDialog(), OpenVoteDialog(), pVoteDialog, Start(), Votes, VT_Cancel, VT_Kick, and VT_Pause.
void C4Network2::Execute | ( | ) |
Definition at line 649 of file C4Network2.cpp.
References C4LA_Update, C4NetReferenceUpdateInterval, C4NetVotingTimeout, CDT_Sync, CheckStatusReached(), CID_VoteEnd, Clients, Control, C4GameControl::ControlTick, DeactivateInactiveClients(), C4Network2ClientList::DoConnectAttempts(), C4GameControl::DoInput(), fHost, C4Control::firstPkt(), fStreaming, C4LeagueClient::getCurrentAction(), C4ControlVote::getData(), C4IDPacket::getPkt(), C4ControlVote::getType(), iDynamicTick, iLastLeagueUpdate, iLastReferenceUpdate, iLeagueUpdateDelay, C4Network2Reference::InitLocal(), C4HTTPClient::isBusy(), isHost(), C4TimeMilliseconds::IsInfinite(), C4Network2ResCore::isNull(), C4Network2IO::IsReferenceNeeded(), iVoteStartTime, LeagueUpdate(), LeagueUpdateProcessReply(), NetIO, pLeagueClient, RemoveDynamic(), RequestActivate(), ResDynamic, C4Network2IO::SetReference(), StreamIn(), StreamOut(), tLastActivateRequest, UpdateChaseTarget(), and Votes.
Referenced by C4Game::Execute(), and OnSec1Timer().
|
inlineoverrideprotected |
Definition at line 131 of file StdScheduler.h.
bool C4Network2::FinalInit | ( | ) |
Definition at line 538 of file C4Network2.cpp.
References Application, C4GUI::MessageDialog::btnAbort, CheckStatusReached(), Clear(), C4GUI::MessageDialog::dsSmall, C4GUI::Dialog::Execute(), C4AbstractApp::FlushMessages(), fStatusAck, fStatusReached, Game, C4GUI::Ico_NetWait, C4GUI::Dialog::IsAborted(), C4Application::isEditor, isEnabled(), isHost(), LoadResStr(), Log(), pGUI, StdScheduler::ScheduleProcs(), C4GUI::Dialog::Show(), C4Game::SyncClearance(), and C4Game::Synchronize().
Referenced by C4Game::Init().
bool C4Network2::FinishStreaming | ( | ) |
Definition at line 2903 of file C4Network2.cpp.
References fStreaming, iLastStreamAttempt, pStreamedRecord, StreamIn(), and StreamOut().
|
inline |
Definition at line 216 of file C4Network2.h.
References pLobby.
Referenced by C4GameLobby::Countdown::Abort(), C4GameLobby::Countdown::Countdown(), C4Network2Players::HandlePlayerInfo(), C4Network2Players::HandlePlayerInfoUpdRequest(), C4GameLobby::LobbyError(), Log(), OnClientConnect(), C4GameLobby::Countdown::OnSec1Timer(), and C4MessageInput::ProcessCommand().
|
inline |
Definition at line 309 of file C4Network2.h.
References NetpuncherAddr.
Referenced by C4Network2Reference::InitLocal(), and InitPuncher().
|
inline |
Definition at line 308 of file C4Network2.h.
References NetpuncherGameID.
Referenced by HandlePuncherPacket(), and OnPuncherConnect().
C4NetpuncherID::value & C4Network2::getNetpuncherGameID | ( | C4NetIO::HostAddress::AddressFamily | family | ) |
Definition at line 1005 of file C4Network2.cpp.
References C4NetIO::HostAddress::IPv4, C4NetIO::HostAddress::IPv6, NetpuncherGameID, C4NetIO::HostAddress::UnknownFamily, C4NetpuncherID::v4, and C4NetpuncherID::v6.
Referenced by C4Network2Reference::InitLocal().
|
inline |
Definition at line 217 of file C4Network2.h.
References StdStrBuf::getData(), and sPassword.
Referenced by C4GameOptionButtons::OnBtnPassword(), and C4GameOptionButtons::UpdatePasswordBtn().
|
inline |
Definition at line 300 of file C4Network2.h.
References StdBuf::getSize(), StreamCompressor, and StreamingBuf.
Referenced by DrawStatus(), StreamIn(), and StreamOut().
C4IDPacket * C4Network2::GetVote | ( | int32_t | iClientID, |
C4ControlVoteType | eType, | ||
int32_t | iData | ||
) |
Definition at line 2700 of file C4Network2.cpp.
References C4ClientIDUnknown, CID_Vote, C4Control::firstPkt(), C4ControlPacket::getByClient(), C4ControlVote::getData(), C4ControlVote::getType(), C4Control::nextPkt(), and Votes.
Referenced by EndVote(), OpenVoteDialog(), and Vote().
|
protected |
Definition at line 1491 of file C4Network2.cpp.
References C4NetMaxBehind4Activation, CDT_Sync, CID_ClientUpdate, Clamp(), Control, CUT_Activate, C4GameControl::DoInput(), C4Game::FPS, C4Game::FrameCounter, Game, C4Network2Client::getID(), C4Network2Client::getMsgConn(), C4Network2IOConnection::getPingTime(), C4Network2Client::isActivated(), isHost(), C4Network2Client::isObserver(), isRunning(), and C4Network2Client::isWaitedFor().
Referenced by HandlePacket().
|
protected |
Definition at line 1220 of file C4Network2.cpp.
References C4ClientIDUnknown, CheckConn(), Clients, C4Network2IOConnection::Close(), StdStrBuf::Format(), fWrongPassword, C4PacketConn::getCCore(), C4Network2ClientList::GetClient(), StdStrBuf::getData(), C4Network2ClientList::GetHost(), C4ClientCore::getID(), C4ClientCore::getName(), C4PacketConn::getPassword(), C4Network2IOConnection::getPeerAddr(), C4Network2Status::getState(), C4PacketConn::getVer(), GS_Init, HostConnect(), C4Network2IOConnection::isClosed(), C4Network2IOConnection::isHalfAccepted(), isHost(), StdStrBuf::isNull(), Join(), LogSilentF(), MkC4NetIOPacket(), PID_ConnRe, C4Network2IOConnection::Send(), SEqual(), C4Network2IOConnection::SetCCore(), C4Network2IOConnection::SetHalfAccepted(), sPassword, Status, and C4NetIO::EndpointAddress::ToString().
Referenced by HandlePacket().
|
protected |
Definition at line 1385 of file C4Network2.cpp.
References C4Network2Client::AddAddr(), C4Network2IOConnection::Close(), C4Network2IO::DataIO(), fWrongPassword, C4Network2IOConnection::getConnectAddr(), C4Network2Client::getCore(), StdStrBuf::getData(), C4PacketConnRe::getMsg(), C4Network2Client::getName(), C4Network2IOConnection::getNetClass(), C4Network2IOConnection::getPeerAddr(), C4Network2IOConnection::getProtocol(), C4Network2Status::getState(), GS_Init, C4Network2IOConnection::isAccepted(), C4Network2IOConnection::isAutoAccepted(), C4Network2Client::isConnected(), C4NetIO::EndpointAddress::IsNull(), C4PacketConnRe::isOK(), C4Network2IOConnection::isOpen(), C4PacketConnRe::isPasswordWrong(), LogSilentF(), C4Network2IO::MsgIO(), NetIO, OnConnect(), C4Network2IOConnection::ResetAutoAccepted(), C4Network2IOConnection::SetAccepted(), C4Network2IOConnection::SetCCore(), C4Network2Client::SetDataConn(), C4Network2Client::SetMsgConn(), Status, and C4NetIO::EndpointAddress::ToString().
Referenced by HandlePacket().
|
protected |
Definition at line 1512 of file C4Network2.cpp.
References C4Network2ResList::AddByCore(), C4ClientIDUnknown, Clear(), C4GameParameters::Clients, C4Game::Clients, Clients, Control, C4GameControl::ControlRate, C4GameParameters::ControlRate, C4GameControlNetwork::CopyClientList(), Game, C4GameParameters::GameRes, C4ClientList::getClientByID(), C4PacketJoinData::getClientID(), C4Client::getCore(), C4PacketJoinData::getDynamicCore(), C4PacketJoinData::getStartCtrlTick(), C4Network2Status::getState(), C4Network2Status::getStateName(), C4PacketJoinData::getStatus(), GS_Go, GS_Init, GS_Lobby, GS_Pause, HandleStatus(), iDynamicTick, C4GameControlNetwork::Init(), C4GameResList::InitNetwork(), C4Client::isActivated(), C4PlayerInfoList::LoadResources(), LogFatal(), LogSilentF(), NetIO, C4Game::Parameters, C4PacketJoinData::Parameters, pControl, C4GameParameters::PlayerInfos, ResDynamic, ResList, C4Game::ScenarioParameterDefs, C4PacketJoinData::ScenarioParameterDefs, C4Network2ClientList::SendAddresses(), C4Network2IO::SetLocalCCore(), C4Network2ResList::SetLocalID(), C4ClientList::SetLocalID(), and Status.
Referenced by HandlePacket().
void C4Network2::HandleLobbyPacket | ( | char | cStatus, |
const C4PacketBase * | pBasePkt, | ||
C4Network2IOConnection * | pConn | ||
) |
Definition at line 963 of file C4Network2.cpp.
References Clients, C4Network2ClientList::GetClient(), C4Network2ClientList::GetClientByID(), C4Network2IOConnection::getClientID(), C4GameLobby::MainDlg::HandlePacket(), and pLobby.
Referenced by C4Network2IO::CallHandlers().
void C4Network2::HandlePacket | ( | char | cStatus, |
const C4PacketBase * | pBasePkt, | ||
C4Network2IOConnection * | pConn | ||
) |
Definition at line 879 of file C4Network2.cpp.
References Clients, C4Network2IOConnection::Close(), C4Network2ClientList::GetClient(), C4Network2ClientList::GetClientByID(), C4Network2IOConnection::getClientID(), GETPKT, C4Network2Status::getState(), GS_Init, HandleActivateReq(), HandleConn(), HandleConnRe(), HandleJoinData(), HandleStatus(), HandleStatusAck(), isHost(), C4Network2Client::isHost(), C4Network2Client::isLocal(), C4Network2IOConnection::isOpen(), PID_ClientActReq, PID_Conn, PID_ConnRe, PID_JoinData, PID_Status, PID_StatusAck, and Status.
Referenced by C4Network2IO::CallHandlers().
bool C4Network2::HandlePuncherPacket | ( | C4NetpuncherPacket::uptr | pkt, |
C4NetIO::HostAddress::AddressFamily | family | ||
) |
Definition at line 972 of file C4Network2.cpp.
References getNetpuncherGameID(), GETPKT, C4Network2Status::getState(), GS_Init, InvalidateReference(), isHost(), NetIO, PID_Puncher_AssID, PID_Puncher_CReq, C4Network2IO::Punch(), and Status.
Referenced by C4Network2IO::HandlePuncherPacket().
|
protected |
Definition at line 1438 of file C4Network2.cpp.
References CheckStatusReached(), fStatusAck, fStatusReached, C4Network2Status::getStateName(), C4Network2Status::getTargetCtrlTick(), LogSilentF(), and Status.
Referenced by HandleJoinData(), and HandlePacket().
|
protected |
Definition at line 1450 of file C4Network2.cpp.
References ChangeGameStatus(), CheckStatusAck(), fChasing, fStatusAck, fStatusReached, C4Network2Status::getState(), C4Network2Status::getTargetCtrlTick(), C4Network2Client::hasJoinData(), isHost(), C4Network2Client::isRemoved(), MkC4NetIOPacket(), NCS_Ready, OnStatusAck(), PID_StatusAck, C4Network2Client::SendMsg(), C4Network2Client::SetStatus(), and Status.
Referenced by HandlePacket().
|
protected |
Definition at line 1330 of file C4Network2.cpp.
References C4ClientList::Add(), C4Game::Clients, Game, and C4ClientCore::isHost().
Referenced by HandleConn().
InitResult C4Network2::InitClient | ( | const class C4Network2Reference & | Ref, |
bool | fObserver | ||
) |
InitResult C4Network2::InitClient | ( | const std::vector< class C4Network2Address > & | Addrs, |
const class C4ClientCore & | HostCore, | ||
const char * | szPassword = nullptr |
||
) |
bool C4Network2::InitHost | ( | bool | fLobby | ) |
Definition at line 139 of file C4Network2.cpp.
References StdScheduler::Add(), Application, C4ClientIDHost, C4ClientIDStart, Clear(), C4Game::Clients, Clients, Config, Control, C4ConfigNetwork::ControlMode, C4GameControl::ControlTick, CreateDynamic(), DeinitLeague(), fAllowJoin, fChasing, fHost, fStatusAck, fStatusReached, Game, C4ClientList::getLocalID(), C4GameControl::getNextControlTick(), GS_Go, GS_Lobby, iNextClientID, C4Network2ClientList::Init(), C4GameControlNetwork::Init(), C4Network2ResList::Init(), InitLeague(), InitNetIO(), C4GameParameters::InitNetwork(), isEnabled(), LeagueStart(), LogFatal(), NetIO, NetpuncherAddr, NetpuncherGameID, C4Config::Network, C4GameControl::Network, C4Game::Parameters, pControl, C4ConfigNetwork::PuncherAddress, ResList, C4Network2Status::Set(), C4Network2IO::SetAcceptMode(), C4Network2Status::SetCtrlMode(), and Status.
Referenced by C4Game::InitNetworkHost().
|
protected |
Definition at line 2047 of file C4Network2.cpp.
References StdScheduler::Add(), Application, C4GUI::MessageDialog::btnAbort, C4GUI::MessageDialog::btnOK, C4Game::C4S, StdStrBuf::Clear(), Config, C4GameParameters::EnforceLeagueRules(), fHost, FormatString(), Game, StdStrBuf::getData(), C4HTTPClient::GetError(), C4ConfigNetwork::GetLeagueServerAddress(), StdStrBuf::getLength(), C4GUI::Ico_Error, C4HTTPClient::Init(), C4Application::isEditor, C4GameParameters::League, C4GameParameters::LeagueAddress, C4ConfigNetwork::LeagueServerSignUp, LoadResStr(), LogFatal(), MasterServerAddress, C4ConfigNetwork::MasterServerSignUp, C4Config::Network, C4Game::Parameters, pGUI, pLeagueClient, C4HTTPClient::SetServer(), and C4GUI::Screen::ShowMessageModal().
Referenced by InitHost(), and LeagueSignupEnable().
|
protected |
Definition at line 1197 of file C4Network2.cpp.
References C4Network2Client::AddLocalAddrs(), C4ClientIDUnknown, C4ConfigNetwork::CheckPortsForCollisions(), C4Network2IO::Clear(), C4Game::Clients, Clients, Config, C4ConfigNetwork::EnableUPnP, fHost, Game, C4Network2ClientList::GetLocal(), C4ClientList::getLocalCore(), C4Network2IO::hasTCP(), C4Network2IO::hasUDP(), C4Network2IO::Init(), NetIO, C4Config::Network, C4ConfigNetwork::PortDiscovery, C4ConfigNetwork::PortRefServer, C4ConfigNetwork::PortTCP, C4ConfigNetwork::PortUDP, C4ClientCore::SetID(), and C4Network2IO::SetLocalCCore().
Referenced by InitHost().
|
protected |
Definition at line 1044 of file C4Network2.cpp.
References C4NetStdPortPuncher, getNetpuncherAddr(), C4Network2IO::InitPuncher(), C4NetIO::HostAddress::IPv4, C4NetIO::HostAddress::IPv6, C4NetIO::EndpointAddress::IsNull(), NetIO, C4NetIO::EndpointAddress::SetAddress(), and C4NetIO::EndpointAddress::SetDefaultPort().
Referenced by LeagueStart().
void C4Network2::InvalidateReference | ( | ) |
Definition at line 2040 of file C4Network2.cpp.
References C4NetMinLeagueUpdateInterval, iLastReferenceUpdate, and iLeagueUpdateDelay.
Referenced by ChangeGameStatus(), C4Network2Players::HandlePlayerInfo(), HandlePuncherPacket(), C4Network2Players::OnClientPart(), C4GameOptionButtons::OnCommentSet(), C4MessageInput::ProcessCommand(), and SetPassword().
|
inline |
Definition at line 203 of file C4Network2.h.
References C4Network2Status::isEnabled(), and Status.
Referenced by C4Game::Abort(), C4MainMenu::ActivateMain(), C4PlayerInfoList::AddInfo(), C4ChartDialog::C4ChartDialog(), C4Game::CanQuickSave(), DoLobby(), DrawStatus(), C4Game::Evaluate(), C4Viewport::Execute(), C4PlayerList::FileInUse(), FinalInit(), C4Network2Players::HandlePlayerInfo(), C4Network2Players::HandlePlayerInfoUpdRequest(), C4Console::In(), C4Game::Init(), C4Network2Players::Init(), C4Game::InitControl(), C4Game::InitGameFinal(), InitHost(), C4PlayerInfoList::InitLocal(), C4Game::InitPlayers(), C4Game::IsPaused(), C4Network2Players::JoinLocalPlayer(), C4PlayerList::JoinNew(), C4PlayerInfo::LoadFromLocalFile(), C4PlayerInfoList::LocalJoinUnjoinedPlayersInQueue(), C4MainMenu::MenuCommand(), C4Network2Players::OnClientPart(), C4GameSaveSavegame::OnSaving(), C4AbortGameDialog::OnShown(), C4Game::OpenScenario(), C4Game::Pause(), Pause(), C4MessageInput::ProcessCommand(), C4TeamList::RecheckPlayerInfoTeams(), C4PlayerInfoList::RecreatePlayers(), C4Game::ReloadDef(), C4Game::ReloadFile(), C4Game::ReloadParticle(), C4Network2Players::RequestPlayerInfoUpdate(), C4PlayerInfoList::RestoreSavegameInfos(), RetrieveRes(), C4Console::SaveGame(), C4PlayerInfoList::SetAsRestoreInfos(), C4TeamList::SetTeamColors(), C4TeamList::SetTeamDistribution(), Start(), Sync(), C4Game::Synchronize(), C4Game::Unpause(), C4Console::UpdateNetMenu(), C4Console::UpdatePlayerMenu(), C4GameSaveSavegame::WriteDesc(), C4GameSaveRecord::WriteDesc(), and C4GameSave::WriteDescDate().
bool C4Network2::isFrozen | ( | ) | const |
Definition at line 1805 of file C4Network2.cpp.
References fStatusAck, C4Network2Status::getState(), GS_Lobby, GS_Pause, and Status.
Referenced by C4GameControlNetwork::DecideControlDelivery(), C4GameControlNetwork::DoInput(), C4GameControlNetwork::HandleControlPkt(), and Sync().
|
inline |
Definition at line 209 of file C4Network2.h.
References fHost.
Referenced by C4GameLobby::Countdown::Abort(), C4MainMenu::ActivateMain(), C4PlayerInfoList::AddInfo(), AddVote(), AllowJoin(), C4GameOverDlg::C4GameOverDlg(), C4Game::CanQuickSave(), ChangeGameStatus(), CheckStatusAck(), CheckStatusReached(), C4GameLobby::Countdown::Countdown(), CreateDynamic(), DeactivateInactiveClients(), DoLobby(), C4Game::Evaluate(), Execute(), FinalInit(), HandleActivateReq(), HandleConn(), HandlePacket(), C4Network2Players::HandlePacket(), C4Network2Players::HandlePlayerInfo(), C4Network2Players::HandlePlayerInfoUpdRequest(), HandlePuncherPacket(), HandleStatusAck(), C4Network2Players::Init(), C4Game::InitControl(), C4Game::InitGameFinal(), C4Game::InitPlayers(), Join(), C4Network2Players::JoinLocalPlayer(), LeagueNotifyDisconnect(), OnClientConnect(), OnClientDisconnect(), C4Network2Players::OnClientPart(), OnDisconn(), OnPuncherConnect(), C4GameLobby::MainDlg::OnRunBtn(), C4Network2Players::OnStatusGoReached(), C4Game::OpenScenario(), C4Game::Pause(), Pause(), C4MessageInput::ProcessCommand(), C4Network2Players::RequestPlayerInfoUpdate(), RetrieveScenario(), C4Console::SaveGame(), SendJoinData(), SetAllowObserve(), SetCtrlMode(), Start(), Sync(), C4Game::Unpause(), C4Console::UpdateNetMenu(), C4Console::UpdatePlayerMenu(), C4Network2ClientDlg::UpdateText(), and Vote().
|
inline |
Definition at line 213 of file C4Network2.h.
References fAllowJoin.
Referenced by C4Network2Reference::InitLocal().
|
inline |
Definition at line 204 of file C4Network2.h.
References C4Network2Status::isLobbyActive(), and Status.
Referenced by DoLobby(), C4GraphicsSystem::Execute(), C4Network2Players::HandlePlayerInfoUpdRequest(), C4Game::Init(), C4TeamList::IsTeamVisible(), OnClientConnect(), and C4TeamList::RecheckPlayerInfoTeams().
|
inline |
Definition at line 297 of file C4Network2.h.
References pLobbyCountdown.
Referenced by C4MessageInput::ProcessCommand().
|
inline |
Definition at line 214 of file C4Network2.h.
References fAllowObserve.
Referenced by C4Network2Reference::InitLocal().
|
inline |
Definition at line 218 of file C4Network2.h.
References StdStrBuf::isNull(), and sPassword.
Referenced by C4GameOptionButtons::C4GameOptionButtons(), C4Network2Reference::InitLocal(), and SetPassword().
|
inline |
Definition at line 205 of file C4Network2.h.
References C4Network2Status::isPastLobby(), and Status.
|
inline |
Definition at line 207 of file C4Network2.h.
References C4Network2Status::isPaused(), isStatusAck(), and Status.
|
inline |
Definition at line 208 of file C4Network2.h.
References fStatusAck, C4Network2Status::isPaused(), and Status.
|
inline |
Definition at line 206 of file C4Network2.h.
References C4Network2Status::isRunning(), isStatusAck(), and Status.
Referenced by AddVote(), HandleActivateReq(), C4Network2Players::HandlePlayerInfo(), C4Game::IsPaused(), and Vote().
|
inline |
Definition at line 210 of file C4Network2.h.
References fStatusAck.
Referenced by isPaused(), and isRunning().
bool C4Network2::isStreaming | ( | ) | const |
|
protected |
Definition at line 1342 of file C4Network2.cpp.
References Application, C4ClientIDUnknown, CDT_Direct, CID_ClientJoin, Clients, Control, C4GameControl::DoInput(), fAllowJoin, fAllowObserve, C4Network2ClientList::GetClient(), C4ClientCore::getID(), C4ClientCore::getName(), C4Application::GetRevision(), C4ClientCore::getRevision(), iNextClientID, isHost(), LogF(), NCS_Joining, SAppend(), SCopy(), SEqualNoCase(), C4ClientCore::SetActivated(), C4ClientCore::SetID(), C4ClientCore::SetName(), C4ClientCore::SetObserver(), C4Network2Client::SetStatus(), and sprintf.
Referenced by HandleConn().
|
protected |
Definition at line 2340 of file C4Network2.cpp.
References Application, C4Network2ClientList::BroadcastMsgToClients(), C4GUI::MessageDialog::btnAbort, C4GUI::MessageDialog::btnRetryAbort, Clients, StdStrBuf::Copy(), C4LeagueClient::End(), C4RoundResults::EvaluateLeague(), fHost, fLeagueEndSent, FormatString(), Game, StdStrBuf::getData(), C4LeagueClient::GetEndReply(), C4HTTPClient::GetError(), StdStrBuf::getLength(), C4HTTPClient::getServerName(), C4GUI::Ico_Error, C4Network2Reference::InitLocal(), C4HTTPClient::isBusy(), C4Application::isEditor, C4GameParameters::isLeague(), C4HTTPClient::isSuccess(), LeagueWaitNotBusy(), LoadResStr(), Log(), MkC4NetIOPacket(), C4Game::Parameters, pGUI, PID_LeagueRoundResults, pLeagueClient, C4Game::RoundResults, StdScheduler::ScheduleProcs(), C4GUI::Screen::ShowMessageModal(), and StdStrBuf::Take().
Referenced by Clear(), LeagueGameEvaluate(), LeagueSignupDisable(), and LeagueStart().
void C4Network2::LeagueGameEvaluate | ( | const char * | szRecordName = nullptr , |
const BYTE * | pRecordSHA = nullptr |
||
) |
Definition at line 2009 of file C4Network2.cpp.
References fLeagueEndSent, LeagueEnd(), and pLeagueClient.
Referenced by C4Game::Evaluate().
void C4Network2::LeagueNotifyDisconnect | ( | int32_t | iClientID, |
enum C4LeagueDisconnectReason | eReason | ||
) |
Definition at line 2590 of file C4Network2.cpp.
References Clients, Game, C4Game::GameOver, StdStrBuf::getData(), C4Network2Client::getID(), C4PlayerInfoList::GetInfoByClientID(), C4Network2ClientList::GetLocal(), C4ClientPlayerInfos::GetPlayerInfo(), C4LeagueClient::GetReportDisconnectReply(), isHost(), C4PlayerInfo::IsJoined(), C4GameParameters::isLeague(), C4PlayerInfo::IsRemoved(), C4Game::IsRunning, LeagueWaitNotBusy(), LoadResStr(), LogF(), C4Game::Parameters, C4Game::PlayerInfos, pLeagueClient, and C4LeagueClient::ReportDisconnect().
Referenced by OnClientDisconnect().
bool C4Network2::LeaguePlrAuth | ( | C4PlayerInfo * | pInfo | ) |
Definition at line 2424 of file C4Network2.cpp.
References Application, C4LeagueClient::Auth(), C4GUI::MessageDialog::btnAbort, C4GUI::MessageDialog::btnOK, C4GUI::MessageDialog::btnOKAbort, C4GUI::Dialog::Close(), Config, StdStrBuf::Copy(), C4GUI::MessageDialog::dsRegular, FormatString(), C4LeagueClient::GetAuthReply(), StdStrBuf::getData(), C4ConfigNetwork::GetLeagueLoginData(), StdStrBuf::getLength(), C4PlayerInfo::GetName(), C4HTTPClient::getServerName(), C4GUI::Ico_Error, C4GUI::Ico_Ex_League, C4GUI::Ico_NetWait, C4GUI::Ico_Notify, C4GUI::Dialog::IsAborted(), C4HTTPClient::isBusy(), C4Application::isEditor, LeagueWaitNotBusy(), LoadResStr(), Log(), LogF(), C4Config::Network, pGUI, pLeagueClient, StdScheduler::ScheduleProcs(), SEqual(), C4PlayerInfo::SetAuthID(), C4ConfigNetwork::SetLeagueLoginData(), C4GUI::Dialog::Show(), C4GUI::Screen::ShowMessageModal(), C4LeagueSignupDialog::ShowModal(), and StdStrBuf::Take().
Referenced by C4Network2Players::JoinLocalPlayer().
bool C4Network2::LeaguePlrAuthCheck | ( | C4PlayerInfo * | pInfo | ) |
Definition at line 2550 of file C4Network2.cpp.
References Application, C4LeagueClient::AuthCheck(), FormatString(), Game, C4LeagueClient::GetAuthCheckReply(), StdStrBuf::getData(), C4HTTPClient::GetError(), C4PlayerInfo::GetName(), C4HTTPClient::isBusy(), C4HTTPClient::isSuccess(), C4GameParameters::League, LeagueShowError(), LeagueWaitNotBusy(), LoadResStr(), Log(), C4Game::Parameters, pLeagueClient, and StdScheduler::ScheduleProcs().
Referenced by C4Network2Players::HandlePlayerInfoUpdRequest().
void C4Network2::LeagueShowError | ( | const char * | szMsg | ) |
Definition at line 2642 of file C4Network2.cpp.
References Application, C4Application::isEditor, LoadResStr(), LogF(), pGUI, and C4GUI::Screen::ShowErrorMessage().
Referenced by LeaguePlrAuthCheck().
void C4Network2::LeagueSignupDisable | ( | ) |
Definition at line 2019 of file C4Network2.cpp.
References DeinitLeague(), Game, C4GameParameters::isLeague(), LeagueEnd(), C4Game::Parameters, and pLeagueClient.
Referenced by C4GameOptionButtons::OnBtnInternet().
bool C4Network2::LeagueSignupEnable | ( | ) |
Definition at line 2029 of file C4Network2.cpp.
References DeinitLeague(), InitLeague(), LeagueStart(), and pLeagueClient.
Referenced by C4GameOptionButtons::OnBtnInternet().
|
protected |
Definition at line 2128 of file C4Network2.cpp.
References Application, C4GUI::MessageDialog::btnAbort, C4GUI::MessageDialog::btnOK, StdStrBuf::Clear(), C4GUI::Dialog::Close(), DeinitLeague(), C4GUI::MessageDialog::dsRegular, fHost, fLeagueEndSent, FormatString(), Game, StdStrBuf::getData(), C4HTTPClient::GetError(), StdStrBuf::getLength(), C4HTTPClient::getServerName(), C4LeagueClient::GetStartReply(), C4GUI::Ico_Error, C4GUI::Ico_NetWait, C4Network2Reference::InitLocal(), InitPuncher(), C4GUI::Dialog::IsAborted(), C4HTTPClient::isBusy(), C4Application::isEditor, C4HTTPClient::isSuccess(), C4GameParameters::League, C4GameParameters::LeagueAddress, LeagueEnd(), LoadResStr(), Log(), LogFatal(), C4GameParameters::MaxPlayers, C4Game::Parameters, pGUI, pLeagueClient, C4Game::RandomSeed, StdScheduler::ScheduleProcs(), C4GUI::Dialog::Show(), C4GUI::Screen::ShowMessageModal(), C4LeagueClient::Start(), and C4GameParameters::StreamAddress.
Referenced by InitHost(), and LeagueSignupEnable().
void C4Network2::LeagueSurrender | ( | ) |
Definition at line 2635 of file C4Network2.cpp.
References DeinitLeague().
|
protected |
Definition at line 2266 of file C4Network2.cpp.
References Config, fHost, C4HTTPClient::GetError(), iLastLeagueUpdate, iLeagueUpdateDelay, C4Network2Reference::InitLocal(), C4HTTPClient::isBusy(), LoadResStr(), LogF(), C4ConfigNetwork::MasterReferencePeriod, C4Config::Network, pLeagueClient, and C4LeagueClient::Update().
Referenced by Execute().
|
protected |
Definition at line 2295 of file C4Network2.cpp.
References C4LA_Update, fHost, FormatString(), Game, C4LeagueClient::getCurrentAction(), StdStrBuf::getData(), C4HTTPClient::GetError(), C4PlayerInfo::GetID(), C4PlayerInfoList::GetIndexedInfo(), C4PlayerInfo::GetLeagueProjectedGain(), StdStrBuf::getLength(), C4ClientPlayerInfos::GetPlayerInfo(), C4ClientPlayerInfos::GetPlayerInfoByID(), C4LeagueClient::GetUpdateReply(), C4HTTPClient::isBusy(), C4HTTPClient::isSuccess(), LoadResStr(), Log(), C4GameLobby::MainDlg::OnPlayersChange(), C4Game::PlayerInfos, Players, pLeagueClient, pLobby, C4LeagueClient::ResetCurrentAction(), C4Network2Players::SendUpdatedPlayers(), C4PlayerInfo::SetLeagueProjectedGain(), and C4ClientPlayerInfos::SetUpdated().
Referenced by Execute(), and LeagueWaitNotBusy().
void C4Network2::LeagueWaitNotBusy | ( | ) |
Definition at line 2621 of file C4Network2.cpp.
References Application, C4LA_Update, C4LeagueClient::getCurrentAction(), C4HTTPClient::isBusy(), LeagueUpdateProcessReply(), LoadResStr(), Log(), pLeagueClient, and StdScheduler::ScheduleProcs().
Referenced by LeagueEnd(), LeagueNotifyDisconnect(), LeaguePlrAuth(), and LeaguePlrAuthCheck().
|
protected |
Definition at line 1589 of file C4Network2.cpp.
References C4Network2Client::getClient(), GetLobby(), C4Network2Client::hasJoinData(), isHost(), isLobbyActive(), C4GameLobby::MainDlg::OnClientConnect(), C4Network2ResList::OnClientConnect(), ResList, and SendJoinData().
Referenced by OnConnect().
|
protected |
Definition at line 1609 of file C4Network2.cpp.
References Application, C4LDR_ConnectionFailed, ChangeGameStatus(), CheckStatusAck(), Clear(), C4Game::Clients, Clients, Control, C4GameControl::ControlTick, C4Network2ClientList::Count(), C4ClientList::CtrlRemove(), C4RoundResults::EvaluateNetwork(), StdStrBuf::Format(), fStatusReached, Game, C4Network2Client::getClient(), StdStrBuf::getData(), C4Network2Client::getID(), C4Network2Client::getName(), C4Network2Status::getState(), GS_Go, GS_Pause, isHost(), C4Network2Client::isHost(), C4Game::IsRunning, LeagueNotifyDisconnect(), LoadResStr(), Log(), LogSilentF(), C4RoundResults::NR_NetError, pLeagueClient, C4Application::Quit(), C4Game::RoundResults, and Status.
Referenced by OnConnectFail(), and OnDisconnect().
void C4Network2::OnConn | ( | C4Network2IOConnection * | pConn | ) |
Definition at line 828 of file C4Network2.cpp.
Referenced by C4Network2IO::OnThreadEvent().
|
protected |
Definition at line 1555 of file C4Network2.cpp.
References StdStrBuf::getData(), C4Network2Client::getName(), C4Network2IOConnection::getNetClass(), C4Network2IO::getNetIOName(), C4Network2IOConnection::getPeerAddr(), C4Network2Client::isHost(), LogSilentF(), NetIO, OnClientConnect(), and C4NetIO::EndpointAddress::ToString().
Referenced by HandleConnRe().
|
protected |
Definition at line 1566 of file C4Network2.cpp.
References Clients, C4Network2ClientList::GetClientByID(), C4Network2IOConnection::getClientID(), StdStrBuf::getData(), C4Network2IOConnection::getNetClass(), C4Network2IO::getNetIOName(), C4Network2IOConnection::getPeerAddr(), C4Network2Client::isConnected(), LogSilentF(), NetIO, OnClientDisconnect(), and C4NetIO::EndpointAddress::ToString().
Referenced by OnDisconn().
void C4Network2::OnDisconn | ( | C4Network2IOConnection * | pConn | ) |
Definition at line 836 of file C4Network2.cpp.
References Clear(), Clients, C4Network2IOConnection::CreatePostMortem(), C4Network2ClientList::GetClient(), C4Network2ClientList::GetClientByID(), C4Network2IOConnection::getClientID(), C4Network2IO::getConnectionCount(), C4Network2ClientList::GetHost(), C4Network2IOConnection::getOutPacketCounter(), C4PacketPostMortem::getPacketCount(), C4Network2Status::getState(), GS_Init, C4Network2Client::isConnected(), C4Network2IOConnection::isFailed(), isHost(), LogSilentF(), MkC4NetIOPacket(), NetIO, OnConnectFail(), OnDisconnect(), PID_PostMortem, C4Network2Client::RemoveConn(), C4Network2ClientList::SendMsgToClient(), and Status.
Referenced by C4Network2IO::OnThreadEvent().
|
protected |
Definition at line 1579 of file C4Network2.cpp.
References StdStrBuf::getData(), C4Network2Client::getName(), C4Network2IOConnection::getNetClass(), C4Network2IO::getNetIOName(), C4Network2IOConnection::getPeerAddr(), C4Network2Client::isConnected(), LogSilentF(), NetIO, OnClientDisconnect(), and C4NetIO::EndpointAddress::ToString().
Referenced by OnDisconn().
void C4Network2::OnGameSynchronized | ( | ) |
Definition at line 1062 of file C4Network2.cpp.
References C4Game::Clients, Clients, CreateDynamic(), C4ClientList::CtrlRemove(), fDynamicNeeded, Game, C4Network2Client::getClient(), C4Network2ClientList::GetNextClient(), C4Network2Client::hasJoinData(), LoadResStr(), and SendJoinData().
Referenced by C4Game::Synchronize().
void C4Network2::OnPuncherConnect | ( | C4NetIO::addr_t | addr | ) |
Definition at line 1017 of file C4Network2.cpp.
References C4Network2Client::AddAddrFromPuncher(), Application, C4NetIO::EndpointAddress::AsIPv4(), Clients, C4Network2ClientList::GetLocal(), getNetpuncherGameID(), C4Network2Status::getState(), GS_Init, C4Application::InteractiveThread, isHost(), NetIO, C4Network2IO::SendPuncherPacket(), Status, and C4InteractiveThread::ThreadLogS().
Referenced by C4Network2IO::OnConn().
|
overridevirtual |
Implements C4ApplicationSec1Timer.
Definition at line 644 of file C4Network2.cpp.
References Execute().
|
protected |
Definition at line 1914 of file C4Network2.cpp.
References Console, Game, C4Network2Status::getCtrlMode(), C4Network2Status::getState(), C4Network2Status::getStateName(), C4Network2Status::getTargetCtrlTick(), GS_Go, GS_Pause, C4Game::HaltCount, LogSilentF(), C4Network2Players::OnStatusGoReached(), pControl, Players, C4GameControlNetwork::SetCtrlMode(), C4GameControlNetwork::SetRunning(), Status, and C4ConsoleGUI::UpdateHaltCtrls().
Referenced by CheckStatusAck(), and HandleStatusAck().
|
protected |
Definition at line 1904 of file C4Network2.cpp.
References Console, Game, C4Game::HaltCount, C4GameControlNetwork::IsEnabled(), pControl, C4GameControlNetwork::SetRunning(), and C4ConsoleGUI::UpdateHaltCtrls().
Referenced by CheckStatusReached().
void C4Network2::OnVoteDialogClosed | ( | ) |
Definition at line 2798 of file C4Network2.cpp.
References pVoteDialog.
void C4Network2::OpenSurrenderDialog | ( | C4ControlVoteType | eType, |
int32_t | iData | ||
) |
Definition at line 2786 of file C4Network2.cpp.
References LoadResStr(), pGUI, pVoteDialog, C4GUI::Dialog::SetDelOnClose(), and C4GUI::Dialog::Show().
Referenced by EndVote(), and Vote().
void C4Network2::OpenVoteDialog | ( | ) |
Definition at line 2753 of file C4Network2.cpp.
References StdStrBuf::Append(), StdStrBuf::AppendChar(), C4GameControl::ClientID(), C4Game::Clients, Control, C4Control::firstPkt(), StdStrBuf::Format(), Game, C4ControlPacket::getByClient(), C4ClientList::getClientByID(), C4ControlVote::getData(), StdStrBuf::getData(), C4ControlVote::getDesc(), C4ControlVote::getDescWarning(), C4PlayerInfoList::GetInfoByClientID(), C4ClientPlayerInfos::GetJoinedPlayerCount(), C4ClientList::getLocalID(), C4Client::getName(), C4ClientPlayerInfos::GetPlayerCount(), C4ControlVote::getType(), GetVote(), LoadResStr(), C4Control::nextPkt(), pGUI, C4Game::PlayerInfos, pVoteDialog, C4GUI::Dialog::SetDelOnClose(), C4GUI::Dialog::Show(), and Votes.
Referenced by AddVote(), and EndVote().
bool C4Network2::Pause | ( | ) |
Definition at line 514 of file C4Network2.cpp.
References ChangeGameStatus(), Control, C4GameControl::getNextControlTick(), GS_Pause, isEnabled(), and isHost().
Referenced by AddVote(), C4Game::Pause(), and Vote().
|
protected |
StdStrBuf C4Network2::QueryClientPassword | ( | ) |
Definition at line 785 of file C4Network2.cpp.
References StdStrBuf::Copy(), StdStrBuf::getData(), C4GUI::InputDialog::GetInputText(), C4GUI::Ico_Ex_Locked, LoadResStr(), pGUI, C4GUI::Dialog::SetDelOnClose(), and C4GUI::Screen::ShowModalDlg().
|
protected |
Definition at line 1797 of file C4Network2.cpp.
References C4Network2ResCore::Clear(), C4Network2ResCore::getID(), C4Network2ResList::getRefRes(), iDynamicTick, C4Network2Res::Remove(), ResDynamic, and ResList.
Referenced by CreateDynamic(), and Execute().
void C4Network2::RequestActivate | ( | ) |
Definition at line 1939 of file C4Network2.cpp.
References C4ClientIDHost, C4NetActivationReqInterval, CDT_Sync, CID_ClientUpdate, C4Game::Clients, Clients, Control, CUT_Activate, C4GameControl::DoInput(), fDelayedActivateReq, fHost, C4Game::FrameCounter, fStatusReached, Game, C4ClientList::getLocal(), C4Client::isActivated(), C4Client::isObserver(), MkC4NetIOPacket(), C4TimeMilliseconds::NegativeInfinity, C4TimeMilliseconds::Now(), PID_ClientActReq, C4Network2ClientList::SendMsgToHost(), and tLastActivateRequest.
Referenced by CheckStatusReached(), Execute(), and C4Network2Players::JoinLocalPlayer().
C4Network2Res::Ref C4Network2::RetrieveRes | ( | const C4Network2ResCore & | Core, |
int32_t | iTimeout, | ||
const char * | szResName, | ||
bool | fWaitForCore = false |
||
) |
Definition at line 1678 of file C4Network2.cpp.
References C4Window::Active, C4Network2ResList::AddByCore(), Application, Console, C4GUI::Dialog::Execute(), FormatString(), C4Network2Res::getCore(), C4Network2ResCore::getFileName(), C4Network2ResCore::getID(), C4Network2Res::getPresentPercent(), C4Network2ResList::getRefRes(), C4GUI::Ico_NetWait, C4GUI::Dialog::IsAborted(), isEnabled(), C4Network2Res::isLoading(), C4Network2ResCore::isNull(), LoadResStr(), LogF(), LogFatal(), C4TimeMilliseconds::Now(), pGUI, ResList, StdScheduler::ScheduleProcs(), C4GUI::ProgressDialog::SetProgress(), and C4GUI::Dialog::Show().
Referenced by C4PlayerInfoList::RecreatePlayers(), C4GameResList::RetrieveFiles(), and RetrieveScenario().
bool C4Network2::RetrieveScenario | ( | char * | szScenario | ) |
Definition at line 590 of file C4Network2.cpp.
References _MAX_PATH_LEN, C4CFN_Material, C4Group_CopyItem(), C4Group_UnpackDirectory(), C4NetResRetrieveTimeout, C4Game::Clients, C4Group::Close(), DirSep, EraseDirectory(), FileExists(), C4Network2ResList::FindTempResFileName(), StdStrBuf::Format(), FormatString(), Game, StdStrBuf::getData(), C4Network2Res::getFile(), C4ClientList::getLocalID(), C4GameRes::getResCore(), isHost(), LoadResStr(), C4Group::Merge(), C4Group::Open(), C4Game::Parameters, C4Network2Res::Remove(), ResDynamic, ResList, RetrieveRes(), and C4GameParameters::Scenario.
Referenced by C4Game::Init().
|
protected |
Definition at line 1644 of file C4Network2.cpp.
References CDT_Sync, CID_Synchronize, Clients, Control, C4GameControl::ControlTick, C4GameControl::DoInput(), fDynamicNeeded, Game, C4Network2Client::getID(), C4Network2Client::getMsgConn(), C4Network2Client::hasJoinData(), iDynamicTick, iLastChaseTargetUpdate, isHost(), C4Network2ResCore::isNull(), MkC4NetIOPacket(), NCS_Chasing, C4Game::Parameters, C4PacketJoinData::Parameters, PID_JoinData, ResDynamic, C4Game::ScenarioParameterDefs, C4PacketJoinData::ScenarioParameterDefs, C4Network2ClientList::SendAddresses(), C4Network2Client::SendMsg(), C4PacketJoinData::SetClientID(), C4PacketJoinData::SetDynamicCore(), C4PacketJoinData::SetGameStatus(), C4PacketJoinData::SetStartCtrlTick(), C4Network2Client::SetStatus(), and Status.
Referenced by OnClientConnect(), and OnGameSynchronized().
void C4Network2::SetAllowObserve | ( | bool | fAllow | ) |
Definition at line 813 of file C4Network2.cpp.
References fAllowObserve, and isHost().
void C4Network2::SetCtrlMode | ( | int32_t | iCtrlMode | ) |
Definition at line 819 of file C4Network2.cpp.
References ChangeGameStatus(), Control, C4GameControl::ControlTick, C4Network2Status::getCtrlMode(), C4Network2Status::getState(), isHost(), and Status.
Referenced by C4MessageInput::ProcessCommand().
void C4Network2::SetPassword | ( | const char * | szToPassword | ) |
Definition at line 772 of file C4Network2.cpp.
References StdStrBuf::Clear(), StdStrBuf::Copy(), InvalidateReference(), isPassworded(), and sPassword.
Referenced by C4StartupScenSelDlg::OnClosed(), C4GameOptionButtons::OnPasswordSet(), C4Application::ParseCommandLine(), and C4MessageInput::ProcessCommand().
bool C4Network2::Start | ( | ) |
Definition at line 506 of file C4Network2.cpp.
References ChangeGameStatus(), Control, C4GameControl::ControlTick, GS_Go, isEnabled(), and isHost().
Referenced by EndVote(), C4Game::InitNetworkHost(), C4GameLobby::Countdown::OnSec1Timer(), C4MessageInput::ProcessCommand(), C4GameLobby::MainDlg::Start(), and C4Game::Unpause().
void C4Network2::StartLobbyCountdown | ( | int32_t | iCountdownTime | ) |
Definition at line 2856 of file C4Network2.cpp.
References AbortLobbyCountdown(), and pLobbyCountdown.
Referenced by DoLobby(), C4MessageInput::ProcessCommand(), and C4GameLobby::MainDlg::Start().
bool C4Network2::StartStreaming | ( | C4Record * | pRecord | ) |
Definition at line 2877 of file C4Network2.cpp.
References StdScheduler::Add(), Application, C4NetStreamingMaxBlockSize, fStreaming, StdBuf::getMData(), iLastStreamAttempt, C4HTTPClient::Init(), StdBuf::New(), pStreamedRecord, pStreamer, StreamCompressor, StreamingBuf, and ZeroMem().
bool C4Network2::StopStreaming | ( | ) |
Definition at line 2920 of file C4Network2.cpp.
References Application, StdBuf::Clear(), fStreaming, pStreamedRecord, pStreamer, StdScheduler::Remove(), StreamCompressor, and StreamingBuf.
Referenced by Clear(), and StreamOut().
|
protected |
Definition at line 2937 of file C4Network2.cpp.
References C4Record::ClearStreamingBuf(), getPendingStreamData(), StdBuf::getSize(), C4Record::GetStreamingBuf(), StdBuf::Grow(), pStreamedRecord, StreamCompressor, and StreamingBuf.
Referenced by Execute(), FinishStreaming(), and StreamOut().
|
protected |
Definition at line 2981 of file C4Network2.cpp.
References StdStrBuf::AppendFormat(), C4NetStreamingInterval, C4NetStreamingMinBlockSize, C4HTTPClient::Clear(), StdStrBuf::Copy(), Game, StdBuf::getData(), StdStrBuf::getData(), getPendingStreamData(), iCurrentStreamAmount, iCurrentStreamPosition, iLastStreamAttempt, C4HTTPClient::isBusy(), C4HTTPClient::isSuccess(), StdBuf::Move(), C4Game::Parameters, pStreamedRecord, pStreamer, C4HTTPClient::Query(), C4HTTPClient::SetServer(), StopStreaming(), C4GameParameters::StreamAddress, StreamCompressor, StreamIn(), and StreamingBuf.
Referenced by Execute(), and FinishStreaming().
bool C4Network2::Sync | ( | ) |
Definition at line 521 of file C4Network2.cpp.
References ChangeGameStatus(), CheckStatusAck(), Control, fStatusAck, fStatusReached, C4GameControl::getNextControlTick(), C4Network2Status::getState(), isEnabled(), isFrozen(), isHost(), and Status.
Referenced by C4GameControlNetwork::DoInput().
bool C4Network2::ToggleAllowJoin | ( | ) |
Definition at line 759 of file C4Network2.cpp.
References AllowJoin(), and fAllowJoin.
Referenced by C4Game::InitKeyboard().
bool C4Network2::ToggleClientListDlg | ( | ) |
Definition at line 766 of file C4Network2.cpp.
References C4Network2ClientListDlg::Toggle().
Referenced by C4Game::InitKeyboard().
|
protected |
Definition at line 1984 of file C4Network2.cpp.
References C4NetChaseTargetUpdateInterval, Clients, Control, C4GameControl::ControlTick, C4Network2ClientList::GetNextClient(), iLastChaseTargetUpdate, C4Network2Client::isChasing(), MkC4NetIOPacket(), PID_Status, C4Network2Client::SendMsg(), C4Network2Status::SetTargetTick(), and Status.
Referenced by Execute().
void C4Network2::Vote | ( | C4ControlVoteType | eType, |
bool | fApprove = true , |
||
int32_t | iData = 0 |
||
) |
Definition at line 2654 of file C4Network2.cpp.
References C4ClientIDUnknown, C4NetMinVotingInterval, CDT_Direct, CID_Vote, C4GameControl::ClientID(), C4Game::Clients, Control, C4GameControl::DoInput(), fPausedForVote, Game, C4ClientList::getLocalID(), GetVote(), iLastOwnVoting, isHost(), isRunning(), LoadResStr(), Log(), OpenSurrenderDialog(), Pause(), VT_Cancel, and VT_Kick.
Referenced by C4Game::Abort(), AddVote(), C4MainMenu::MenuCommand(), C4Game::Pause(), C4MessageInput::ProcessCommand(), and C4Game::Unpause().
|
friend |
Definition at line 103 of file C4Network2.h.
C4Network2ClientList C4Network2::Clients |
Definition at line 116 of file C4Network2.h.
Referenced by C4GameLobby::Countdown::Abort(), C4MainMenu::ActivateHost(), C4Network2Stats::C4Network2Stats(), C4GameControlNetwork::CalcPerformance(), C4Network2IO::CallHandlers(), ChangeGameStatus(), C4GameControlNetwork::CheckCompleteCtrl(), CheckStatusAck(), CheckStatusReached(), Clear(), C4GameLobby::Countdown::Countdown(), DeactivateInactiveClients(), C4Network2Client::DoConnectAttempt(), C4GameControlNetwork::DoInput(), DrawStatus(), C4GameControlNetwork::ExecSyncControl(), C4Viewport::Execute(), Execute(), C4Network2Stats::ExecuteSecond(), HandleConn(), HandleJoinData(), HandleLobbyPacket(), HandlePacket(), C4Network2Players::HandlePacket(), C4GameControlNetwork::Init(), InitHost(), InitNetIO(), Join(), C4Network2Players::JoinLocalPlayer(), LeagueEnd(), LeagueNotifyDisconnect(), OnClientDisconnect(), OnConnectFail(), OnDisconn(), OnGameSynchronized(), OnPuncherConnect(), C4GameLobby::Countdown::OnSec1Timer(), C4GameControlNetwork::PackCompleteCtrl(), C4MessageInput::ProcessCommand(), RequestActivate(), C4Network2Players::RequestPlayerInfoUpdate(), SendJoinData(), C4GameControlNetwork::SetCtrlMode(), UpdateChaseTarget(), C4Console::UpdateNetMenu(), C4GameSave::WriteDescNetworkClients(), and C4Network2Stats::~C4Network2Stats().
|
protected |
Definition at line 130 of file C4Network2.h.
Referenced by AllowJoin(), Clear(), DoLobby(), InitHost(), isJoinAllowed(), Join(), and ToggleAllowJoin().
|
protected |
Definition at line 130 of file C4Network2.h.
Referenced by isObservingAllowed(), Join(), and SetAllowObserve().
|
protected |
Definition at line 141 of file C4Network2.h.
Referenced by CheckStatusReached(), HandleStatusAck(), and InitHost().
|
protected |
Definition at line 178 of file C4Network2.h.
Referenced by CheckStatusReached(), Clear(), and RequestActivate().
|
protected |
Definition at line 137 of file C4Network2.h.
Referenced by Clear(), CreateDynamic(), OnGameSynchronized(), and SendJoinData().
|
protected |
Definition at line 127 of file C4Network2.h.
Referenced by Execute(), InitHost(), InitLeague(), InitNetIO(), isHost(), LeagueEnd(), LeagueStart(), LeagueUpdate(), LeagueUpdateProcessReply(), and RequestActivate().
|
protected |
Definition at line 166 of file C4Network2.h.
Referenced by LeagueEnd(), LeagueGameEvaluate(), and LeagueStart().
|
protected |
Definition at line 148 of file C4Network2.h.
Referenced by CheckStatusReached(), Clear(), and DoLobby().
|
protected |
|
protected |
Definition at line 140 of file C4Network2.h.
Referenced by ChangeGameStatus(), CheckStatusAck(), Clear(), DrawStatus(), FinalInit(), HandleStatus(), HandleStatusAck(), InitHost(), isFrozen(), isPausing(), isStatusAck(), and Sync().
|
protected |
Definition at line 140 of file C4Network2.h.
Referenced by ChangeGameStatus(), CheckStatusAck(), CheckStatusReached(), Clear(), DrawStatus(), FinalInit(), HandleStatus(), HandleStatusAck(), InitHost(), OnClientDisconnect(), RequestActivate(), and Sync().
|
protected |
Definition at line 187 of file C4Network2.h.
Referenced by DrawStatus(), Execute(), FinishStreaming(), isStreaming(), StartStreaming(), and StopStreaming().
|
protected |
Definition at line 175 of file C4Network2.h.
Referenced by HandleConn(), and HandleConnRe().
|
protected |
Definition at line 194 of file C4Network2.h.
Referenced by StreamOut().
|
protected |
Definition at line 194 of file C4Network2.h.
Referenced by DrawStatus(), and StreamOut().
|
protected |
Definition at line 136 of file C4Network2.h.
Referenced by Clear(), CreateDynamic(), Execute(), HandleJoinData(), RemoveDynamic(), and SendJoinData().
|
protected |
Definition at line 158 of file C4Network2.h.
Referenced by Clear(), SendJoinData(), and UpdateChaseTarget().
|
protected |
Definition at line 165 of file C4Network2.h.
Referenced by Clear(), Execute(), and LeagueUpdate().
|
protected |
Definition at line 184 of file C4Network2.h.
|
protected |
Definition at line 164 of file C4Network2.h.
Referenced by Clear(), Execute(), and InvalidateReference().
|
protected |
Definition at line 188 of file C4Network2.h.
Referenced by FinishStreaming(), StartStreaming(), and StreamOut().
|
protected |
Definition at line 165 of file C4Network2.h.
Referenced by Execute(), InvalidateReference(), and LeagueUpdate().
|
protected |
Definition at line 155 of file C4Network2.h.
Referenced by InitHost(), and Join().
|
protected |
Definition at line 184 of file C4Network2.h.
|
protected |
Definition at line 152 of file C4Network2.h.
Referenced by DeinitLeague(), and InitLeague().
C4Network2IO C4Network2::NetIO |
Definition at line 110 of file C4Network2.h.
Referenced by Clear(), DrawStatus(), Execute(), C4Network2Stats::ExecuteSecond(), HandleConnRe(), HandleJoinData(), HandlePuncherPacket(), InitHost(), InitNetIO(), InitPuncher(), OnConnect(), OnConnectFail(), OnDisconn(), OnDisconnect(), OnPuncherConnect(), and C4Network2ClientDlg::UpdateText().
|
protected |
Definition at line 198 of file C4Network2.h.
Referenced by getNetpuncherAddr(), and InitHost().
|
protected |
Definition at line 197 of file C4Network2.h.
Referenced by Clear(), getNetpuncherGameID(), and InitHost().
|
protected |
Definition at line 144 of file C4Network2.h.
Referenced by CheckStatusAck(), CheckStatusReached(), DrawStatus(), HandleJoinData(), InitHost(), OnStatusAck(), and OnStatusReached().
C4Network2Players C4Network2::Players |
Definition at line 119 of file C4Network2.h.
Referenced by C4Network2IO::CallHandlers(), Clear(), C4PlayerInfoList::DoPlayerInfoUpdate(), C4Game::InitNetworkFromReference(), C4Game::InitNetworkHost(), C4PlayerList::JoinNew(), LeagueUpdateProcessReply(), C4GameLobby::MainDlg::OnClientAddPlayer(), C4GameLobby::MainDlg::OnMessage(), OnStatusAck(), C4MessageInput::ProcessCommand(), C4TeamList::SetTeamColors(), and C4TeamList::SetTeamDistribution().
|
protected |
Definition at line 169 of file C4Network2.h.
Referenced by Clear(), DeinitLeague(), Execute(), InitLeague(), LeagueEnd(), LeagueGameEvaluate(), LeagueNotifyDisconnect(), LeaguePlrAuth(), LeaguePlrAuthCheck(), LeagueSignupDisable(), LeagueSignupEnable(), LeagueStart(), LeagueUpdate(), LeagueUpdateProcessReply(), LeagueWaitNotBusy(), and OnClientDisconnect().
|
protected |
Definition at line 147 of file C4Network2.h.
Referenced by Clear(), DoLobby(), GetLobby(), HandleLobbyPacket(), and LeagueUpdateProcessReply().
|
protected |
Definition at line 149 of file C4Network2.h.
Referenced by AbortLobbyCountdown(), Clear(), DoLobby(), isLobbyCountDown(), and StartLobbyCountdown().
|
protected |
Definition at line 189 of file C4Network2.h.
Referenced by DrawStatus(), FinishStreaming(), StartStreaming(), StopStreaming(), StreamIn(), and StreamOut().
|
protected |
Definition at line 193 of file C4Network2.h.
Referenced by StartStreaming(), StopStreaming(), and StreamOut().
|
protected |
Definition at line 182 of file C4Network2.h.
Referenced by Clear(), EndVote(), OnVoteDialogClosed(), OpenSurrenderDialog(), and OpenVoteDialog().
|
protected |
Definition at line 133 of file C4Network2.h.
Referenced by CreateDynamic(), Execute(), HandleJoinData(), RemoveDynamic(), RetrieveScenario(), and SendJoinData().
C4Network2ResList C4Network2::ResList |
Definition at line 113 of file C4Network2.h.
Referenced by C4Network2IO::CallHandlers(), Clear(), CreateDynamic(), C4Network2IO::Execute(), HandleJoinData(), InitHost(), C4PlayerInfo::LoadFromLocalFile(), C4PlayerInfo::LoadResource(), OnClientConnect(), C4ControlJoinPlayer::PreExecute(), C4ControlJoinPlayer::PreRec(), C4MessageInput::ProcessCommand(), RemoveDynamic(), RetrieveRes(), RetrieveScenario(), C4Player::Save(), and C4Network2ResDlg::Update().
|
protected |
Definition at line 172 of file C4Network2.h.
Referenced by Clear(), GetPassword(), HandleConn(), isPassworded(), and SetPassword().
C4Network2Status C4Network2::Status |
Definition at line 122 of file C4Network2.h.
Referenced by ChangeGameStatus(), CheckStatusAck(), CheckStatusReached(), Clear(), DrawStatus(), HandleConn(), HandleConnRe(), HandleJoinData(), HandlePacket(), HandlePuncherPacket(), HandleStatus(), HandleStatusAck(), C4Console::In(), InitHost(), C4Network2Reference::InitLocal(), isEnabled(), isFrozen(), isLobbyActive(), isPastLobby(), isPaused(), isPausing(), isRunning(), OnClientDisconnect(), OnDisconn(), OnPuncherConnect(), OnStatusAck(), C4TeamList::RecheckPlayerInfoTeams(), SendJoinData(), SetCtrlMode(), Sync(), and UpdateChaseTarget().
|
protected |
Definition at line 191 of file C4Network2.h.
Referenced by getPendingStreamData(), StartStreaming(), StopStreaming(), StreamIn(), and StreamOut().
|
protected |
Definition at line 190 of file C4Network2.h.
Referenced by getPendingStreamData(), StartStreaming(), StopStreaming(), StreamIn(), and StreamOut().
|
protected |
Definition at line 161 of file C4Network2.h.
Referenced by Clear(), Execute(), and RequestActivate().
|
protected |
Definition at line 181 of file C4Network2.h.
Referenced by AddVote(), Clear(), EndVote(), Execute(), GetVote(), and OpenVoteDialog().