MCPcopy Create free account
hub / github.com/ddnet/ddnet / DummyConnect

Method DummyConnect

src/engine/client/client.cpp:790–836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788}
789
790void CClient::DummyConnect()
791{
792 if(m_aNetClient[CONN_MAIN].State() != NETSTATE_ONLINE)
793 {
794 log_info("client", "Not online.");
795 return;
796 }
797
798 if(!DummyAllowed())
799 {
800 log_info("client", "Dummy is not allowed on this server.");
801 return;
802 }
803 if(DummyConnecting())
804 {
805 log_info("client", "Dummy is already connecting.");
806 return;
807 }
808 if(DummyConnected())
809 {
810 // causes log spam with connect+swap binds
811 // https://github.com/ddnet/ddnet/issues/9426
812 // log_info("client", "Dummy is already connected.");
813 return;
814 }
815 if(DummyConnectingDelayed())
816 {
817 log_info("client", "Wait before connecting dummy again.");
818 return;
819 }
820
821 m_LastDummyConnectTime = GlobalTime();
822 m_aRconAuthed[1] = 0;
823 m_DummySendConnInfo = true;
824
825 g_Config.m_ClDummyCopyMoves = 0;
826 g_Config.m_ClDummyHammer = 0;
827
828 m_DummyConnecting = true;
829 // connect to the server
830 if(IsSixup())
831 m_aNetClient[CONN_DUMMY].Connect7(m_aNetClient[CONN_MAIN].ServerAddress(), 1);
832 else
833 m_aNetClient[CONN_DUMMY].Connect(m_aNetClient[CONN_MAIN].ServerAddress(), 1);
834
835 m_aGametimeMarginGraphs[CONN_DUMMY].Init(-150.0f, 150.0f);
836}
837
838void CClient::DummyDisconnect(const char *pReason)
839{

Callers 2

RenderGameMethod · 0.80
Con_DummyConnectMethod · 0.80

Calls 5

ServerAddressMethod · 0.80
StateMethod · 0.45
Connect7Method · 0.45
ConnectMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected