#include <C4Network2Client.h>
Protected Attributes | |
C4Client * | pClient |
C4Network2Address | Addr [C4ClientMaxAddr] |
int32_t | AddrAttempts [C4ClientMaxAddr] |
int32_t | iAddrCnt |
C4NetIO::addr_t | IPv6AddrFromPuncher |
std::set< int > | InterfaceIDs |
C4Network2ClientStatus | eStatus |
int32_t | iLastActivity |
C4Network2IOConnection * | pMsgConn |
C4Network2IOConnection * | pDataConn |
time_t | iNextConnAttempt |
std::unique_ptr< C4NetIOTCP::Socket > | TcpSimOpenSocket |
C4Network2Client * | pNext |
class C4Network2ClientList * | pParent |
class C4TableGraph * | pstatPing |
Friends | |
class | C4Network2ClientList |
Definition at line 44 of file C4Network2Client.h.
C4Network2Client::C4Network2Client | ( | C4Client * | pClient | ) |
Definition at line 30 of file C4Network2Client.cpp.
C4Network2Client::~C4Network2Client | ( | ) |
Definition at line 41 of file C4Network2Client.cpp.
References ClearGraphs(), C4Network2IOConnection::Close(), C4Network2IOConnection::DelRef(), pClient, pDataConn, pMsgConn, and C4Client::UnlinkNetClient().
bool C4Network2Client::AddAddr | ( | const C4Network2Address & | addr, |
bool | fAnnounce | ||
) |
Definition at line 238 of file C4Network2Client.cpp.
References Addr, AddrAttempts, C4Network2ClientList::BroadcastMsgToConnClients(), C4ClientMaxAddr, getID(), hasAddr(), iAddrCnt, iNextConnAttempt, MkC4NetIOPacket(), PID_Addr, and pParent.
Referenced by AddAddrFromPuncher(), AddLocalAddrs(), getDataConn(), C4Network2::HandleConnRe(), and C4Network2ClientList::HandlePacket().
void C4Network2Client::AddAddrFromPuncher | ( | const C4NetIO::addr_t & | addr | ) |
Definition at line 222 of file C4Network2Client.cpp.
References AddAddr(), Config, C4NetIO::HostAddress::GetFamily(), C4NetIO::EndpointAddress::GetPort(), C4NetIO::HostAddress::IPv6, IPv6AddrFromPuncher, C4Config::Network, P_TCP, P_UDP, C4ConfigNetwork::PortTCP, C4ConfigNetwork::PortUDP, and C4NetIO::EndpointAddress::SetPort().
Referenced by getDataConn(), and C4Network2::OnPuncherConnect().
void C4Network2Client::AddLocalAddrs | ( | int16_t | iPortTCP, |
int16_t | iPortUDP | ||
) |
Definition at line 256 of file C4Network2Client.cpp.
References AddAddr(), C4NetIO::GetLocalAddresses(), C4NetIO::HostAddress::GetScopeId(), InterfaceIDs, P_TCP, P_UDP, C4NetIO::EndpointAddress::SetAddress(), and C4NetIO::EndpointAddress::SetPort().
Referenced by getDataConn(), and C4Network2::InitNetIO().
void C4Network2Client::ClearAddr | ( | ) |
Definition at line 217 of file C4Network2Client.cpp.
References iAddrCnt.
Referenced by getDataConn().
void C4Network2Client::ClearGraphs | ( | ) |
Definition at line 312 of file C4Network2Client.cpp.
References Game, C4Game::pNetworkStatistics, and pstatPing.
Referenced by CreateGraphs(), getDataConn(), ~C4Network2Client(), and C4Network2Stats::~C4Network2Stats().
void C4Network2Client::CloseConns | ( | const char * | szMsg | ) |
Definition at line 89 of file C4Network2Client.cpp.
References C4Network2IOConnection::Close(), C4Network2IOConnection::isOpen(), MkC4NetIOPacket(), PID_ConnRe, pMsgConn, RemoveConn(), and C4Network2IOConnection::Send().
Referenced by C4Network2ClientList::DeleteClient(), and getDataConn().
void C4Network2Client::CreateGraphs | ( | ) |
Definition at line 296 of file C4Network2Client.cpp.
References ClearGraphs(), C4TableGraph::DefaultBlockLength, Game, getID(), getName(), C4Game::pNetworkStatistics, and pstatPing.
Referenced by C4Network2Stats::C4Network2Stats(), and getDataConn().
bool C4Network2Client::DoConnectAttempt | ( | class C4Network2IO * | pIO | ) |
Definition at line 116 of file C4Network2Client.cpp.
References Addr, AddrAttempts, C4NetClientConnectAttempts, C4NetClientConnectInterval, C4Network2::Clients, C4Network2IO::Connect(), DoTCPSimultaneousOpen(), C4Network2Address::getAddr(), C4Client::getCore(), getDataConn(), getID(), getInterfaceIDs(), C4Network2ClientList::GetLocal(), getMsgConn(), getName(), C4Network2IO::getNetIO(), C4Network2Address::getProtocol(), C4Network2IOConnection::getProtocol(), iAddrCnt, iNextConnAttempt, C4NetIO::HostAddress::IPv6, isLocal(), LogSilentF(), Network, P_TCP, pClient, pDataConn, pMsgConn, pParent, and TcpSimOpenSocket.
Referenced by getDataConn(), and C4Network2ClientList::HandlePacket().
bool C4Network2Client::DoTCPSimultaneousOpen | ( | class C4Network2IO * | pIO, |
const C4Network2Address & | addr | ||
) |
Definition at line 169 of file C4Network2Client.cpp.
References C4Network2IO::ConnectWithSocket(), C4Network2Address::getAddr(), C4Client::getCore(), StdStrBuf::getData(), getID(), C4Network2IOConnection::getLag(), C4Network2ClientList::GetLocal(), getMsgConn(), getName(), C4Network2IO::getNetIO(), C4Network2Address::getProtocol(), IPv6AddrFromPuncher, C4Network2Address::isIPNull(), LogSilentF(), MkC4NetIOPacket(), P_TCP, pClient, PID_TCPSimOpen, pParent, SendMsg(), C4NetIO::EndpointAddress::SetPort(), TcpSimOpenSocket, and C4NetIO::EndpointAddress::ToString().
Referenced by DoConnectAttempt(), getDataConn(), and C4Network2ClientList::HandlePacket().
|
inline |
Definition at line 94 of file C4Network2Client.h.
Referenced by C4Network2Reference::InitLocal(), SendAddresses(), and C4Network2ClientDlg::UpdateText().
|
inline |
Definition at line 93 of file C4Network2Client.h.
References iAddrCnt.
Referenced by C4Network2Reference::InitLocal(), and C4Network2ClientDlg::UpdateText().
|
inline |
Definition at line 84 of file C4Network2Client.h.
References pClient.
Referenced by getCore(), C4Network2::OnClientConnect(), C4Network2::OnClientDisconnect(), and C4Network2::OnGameSynchronized().
|
inline |
Definition at line 85 of file C4Network2Client.h.
References getClient(), and C4Client::getCore().
Referenced by C4Network2::CheckConn(), C4Network2ClientList::DeleteClient(), getID(), getName(), C4Network2::HandleConnRe(), isActivated(), and isObserver().
|
inline |
Definition at line 116 of file C4Network2Client.h.
References AddAddr(), AddAddrFromPuncher(), AddLocalAddrs(), ClearAddr(), ClearGraphs(), CloseConns(), CreateGraphs(), DoConnectAttempt(), DoTCPSimultaneousOpen(), hasAddr(), hasConn(), pDataConn, RemoveConn(), SendAddresses(), SendData(), SendMsg(), SetDataConn(), and SetMsgConn().
Referenced by DoConnectAttempt(), SendData(), C4Network2ClientListBox::Update(), and C4Network2ClientDlg::UpdateText().
|
inline |
Definition at line 86 of file C4Network2Client.h.
References getCore(), and C4ClientCore::getID().
Referenced by AddAddr(), CreateGraphs(), DoConnectAttempt(), DoTCPSimultaneousOpen(), C4Network2::DrawStatus(), C4ClientList::getLocalID(), C4Network2ClientList::GetNextClientAfterID(), C4Network2::HandleActivateReq(), isHost(), C4Network2::LeagueNotifyDisconnect(), C4Network2::OnClientDisconnect(), C4MessageInput::ProcessCommand(), SendAddresses(), and C4Network2::SendJoinData().
|
inline |
Definition at line 96 of file C4Network2Client.h.
References InterfaceIDs.
Referenced by DoConnectAttempt(), and C4Network2::InitialConnect::Execute().
|
inline |
|
inline |
Definition at line 115 of file C4Network2Client.h.
References pMsgConn.
Referenced by C4GameControlNetwork::CalcPerformance(), DoConnectAttempt(), DoTCPSimultaneousOpen(), C4Network2Stats::ExecuteSecond(), C4Network2::HandleActivateReq(), C4Network2::SendJoinData(), SendMsg(), C4Network2ClientList::SendMsgToHost(), C4Network2ClientListBox::Update(), and C4Network2ClientDlg::UpdateText().
|
inline |
Definition at line 89 of file C4Network2Client.h.
References getCore(), and C4ClientCore::getName().
Referenced by C4Control::CompileFunc(), CreateGraphs(), DoConnectAttempt(), DoTCPSimultaneousOpen(), C4Network2::DrawStatus(), C4ClientList::getLocalName(), C4Network2::HandleConnRe(), C4Network2::OnClientDisconnect(), C4Network2::OnConnect(), and C4Network2::OnDisconnect().
|
inline |
Definition at line 110 of file C4Network2Client.h.
References pNext.
Referenced by C4Network2ClientList::AllClientsReady(), C4Network2ClientList::BroadcastMsgToClients(), C4Network2ClientList::BroadcastMsgToConnClients(), C4Network2ClientList::DeleteClient(), C4Network2ClientList::DoConnectAttempts(), C4Network2ClientList::RegClient(), C4Network2ClientList::ResetReady(), C4Network2ClientList::SendAddresses(), and C4Network2ClientList::UpdateClientActivity().
|
inline |
|
inline |
Definition at line 108 of file C4Network2Client.h.
References pstatPing.
Referenced by C4Network2Stats::ExecuteSecond().
|
inline |
Definition at line 98 of file C4Network2Client.h.
References eStatus.
Referenced by hasJoinData(), isChasing(), isReady(), isRemoved(), isWaitedFor(), and C4Network2ClientDlg::UpdateText().
bool C4Network2Client::hasAddr | ( | const C4Network2Address & | addr | ) | const |
Definition at line 208 of file C4Network2Client.cpp.
References Addr, and iAddrCnt.
Referenced by AddAddr(), and getDataConn().
bool C4Network2Client::hasConn | ( | C4Network2IOConnection * | pConn | ) |
Definition at line 49 of file C4Network2Client.cpp.
References pDataConn, and pMsgConn.
Referenced by C4Network2::CheckConn(), and getDataConn().
|
inline |
Definition at line 99 of file C4Network2Client.h.
References getStatus(), and NCS_Joining.
Referenced by C4Network2::HandleStatusAck(), C4Network2::OnClientConnect(), C4Network2::OnGameSynchronized(), and C4Network2::SendJoinData().
|
inline |
Definition at line 90 of file C4Network2Client.h.
References getCore(), and C4ClientCore::isActivated().
Referenced by C4Network2::DrawStatus(), and C4Network2::HandleActivateReq().
|
inline |
Definition at line 100 of file C4Network2Client.h.
References getStatus(), and NCS_Chasing.
Referenced by C4Network2::UpdateChaseTarget().
|
inline |
Definition at line 105 of file C4Network2Client.h.
References pMsgConn.
Referenced by C4Network2::HandleConnRe(), C4Network2::OnDisconn(), C4Network2::OnDisconnect(), C4Network2ClientList::SendMsgToClient(), and C4Network2ClientDlg::UpdateText().
|
inline |
Definition at line 88 of file C4Network2Client.h.
References C4ClientIDHost, and getID().
Referenced by C4Network2::DrawStatus(), C4Network2Players::HandlePacket(), C4Network2::HandlePacket(), C4Network2::OnClientDisconnect(), and C4Network2::OnConnect().
|
inline |
Definition at line 87 of file C4Network2Client.h.
References C4Client::isLocal().
Referenced by C4GameControlNetwork::CalcPerformance(), DoConnectAttempt(), and C4Network2::HandlePacket().
|
inline |
Definition at line 91 of file C4Network2Client.h.
References getCore(), and C4ClientCore::isObserver().
Referenced by C4Network2::DrawStatus(), C4Viewport::Execute(), and C4Network2::HandleActivateReq().
|
inline |
Definition at line 101 of file C4Network2Client.h.
References getStatus(), and NCS_Ready.
Referenced by C4Network2ClientDlg::UpdateText().
|
inline |
Definition at line 103 of file C4Network2Client.h.
References getStatus(), and NCS_Remove.
Referenced by C4Network2::HandleStatusAck().
|
inline |
Definition at line 102 of file C4Network2Client.h.
References getStatus(), NCS_NotReady, and NCS_Ready.
Referenced by C4Network2::HandleActivateReq().
void C4Network2Client::RemoveConn | ( | C4Network2IOConnection * | pConn | ) |
Definition at line 78 of file C4Network2Client.cpp.
References C4Network2IOConnection::DelRef(), pDataConn, pMsgConn, SetDataConn(), and SetMsgConn().
Referenced by CloseConns(), getDataConn(), and C4Network2::OnDisconn().
void C4Network2Client::SendAddresses | ( | C4Network2IOConnection * | pConn | ) |
Definition at line 278 of file C4Network2Client.cpp.
References Addr, C4Network2ClientList::BroadcastMsgToConnClients(), C4Network2Address::getAddr(), getAddr(), getID(), C4Network2IOConnection::getPeerAddr(), C4NetIO::HostAddress::GetScopeId(), iAddrCnt, MkC4NetIOPacket(), PID_Addr, pParent, C4Network2IOConnection::Send(), and C4NetIO::HostAddress::SetScopeId().
Referenced by getDataConn(), and C4Network2ClientList::GetLocal().
bool C4Network2Client::SendData | ( | C4NetIOPacket | rPkt | ) | const |
Definition at line 111 of file C4Network2Client.cpp.
References getDataConn(), and C4Network2IOConnection::Send().
Referenced by getDataConn().
bool C4Network2Client::SendMsg | ( | C4NetIOPacket | rPkt | ) | const |
Definition at line 106 of file C4Network2Client.cpp.
References getMsgConn(), and C4Network2IOConnection::Send().
Referenced by DoTCPSimultaneousOpen(), getDataConn(), C4Network2::HandleStatusAck(), C4Network2::SendJoinData(), C4Network2ClientList::SendMsgToClient(), C4Network2ClientList::SendMsgToHost(), and C4Network2::UpdateChaseTarget().
void C4Network2Client::SetDataConn | ( | C4Network2IOConnection * | pConn | ) |
Definition at line 66 of file C4Network2Client.cpp.
References C4Network2IOConnection::AddRef(), C4Network2IOConnection::DelRef(), pDataConn, pMsgConn, and SetMsgConn().
Referenced by getDataConn(), C4Network2::HandleConnRe(), RemoveConn(), and SetMsgConn().
|
inline |
Definition at line 113 of file C4Network2Client.h.
Referenced by C4Client::SetActivated().
void C4Network2Client::SetMsgConn | ( | C4Network2IOConnection * | pConn | ) |
Definition at line 54 of file C4Network2Client.cpp.
References C4Network2IOConnection::AddRef(), C4Network2IOConnection::DelRef(), pDataConn, pMsgConn, and SetDataConn().
Referenced by getDataConn(), C4Network2::HandleConnRe(), RemoveConn(), and SetDataConn().
|
inline |
Definition at line 112 of file C4Network2Client.h.
Referenced by C4ClientList::CtrlRemove(), C4Network2::HandleStatusAck(), C4Network2::Join(), and C4Network2::SendJoinData().
|
friend |
Definition at line 46 of file C4Network2Client.h.
|
protected |
Definition at line 56 of file C4Network2Client.h.
Referenced by AddAddr(), DoConnectAttempt(), hasAddr(), and SendAddresses().
|
protected |
Definition at line 57 of file C4Network2Client.h.
Referenced by AddAddr(), and DoConnectAttempt().
|
protected |
Definition at line 65 of file C4Network2Client.h.
Referenced by getStatus().
|
protected |
Definition at line 58 of file C4Network2Client.h.
Referenced by AddAddr(), ClearAddr(), DoConnectAttempt(), getAddrCnt(), hasAddr(), and SendAddresses().
|
protected |
Definition at line 68 of file C4Network2Client.h.
Referenced by getLastActivity().
|
protected |
Definition at line 72 of file C4Network2Client.h.
Referenced by AddAddr(), DoConnectAttempt(), and getNextConnAttempt().
|
protected |
Definition at line 62 of file C4Network2Client.h.
Referenced by AddLocalAddrs(), and getInterfaceIDs().
|
protected |
Definition at line 59 of file C4Network2Client.h.
Referenced by AddAddrFromPuncher(), and DoTCPSimultaneousOpen().
|
protected |
Definition at line 53 of file C4Network2Client.h.
Referenced by DoConnectAttempt(), DoTCPSimultaneousOpen(), getClient(), C4Network2ClientList::GetLocal(), and ~C4Network2Client().
|
protected |
Definition at line 71 of file C4Network2Client.h.
Referenced by DoConnectAttempt(), getDataConn(), hasConn(), RemoveConn(), SetDataConn(), SetMsgConn(), and ~C4Network2Client().
|
protected |
Definition at line 71 of file C4Network2Client.h.
Referenced by CloseConns(), DoConnectAttempt(), getMsgConn(), hasConn(), isConnected(), RemoveConn(), SetDataConn(), SetMsgConn(), and ~C4Network2Client().
|
protected |
Definition at line 76 of file C4Network2Client.h.
Referenced by C4Network2ClientList::Count(), C4Network2ClientList::DeleteClient(), C4Network2ClientList::GetClient(), C4Network2ClientList::GetClientByID(), getNext(), C4Network2ClientList::GetNextClient(), and C4Network2ClientList::GetNextClientAfterID().
|
protected |
Definition at line 77 of file C4Network2Client.h.
Referenced by AddAddr(), DoConnectAttempt(), DoTCPSimultaneousOpen(), and SendAddresses().
|
protected |
Definition at line 80 of file C4Network2Client.h.
Referenced by ClearGraphs(), CreateGraphs(), and getStatPing().
|
protected |
Definition at line 73 of file C4Network2Client.h.
Referenced by DoConnectAttempt(), and DoTCPSimultaneousOpen().