MCPcopy Create free account
hub / github.com/cppla/ServerStatus / Run

Method Run

server/src/main.cpp:1023–1063  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1021}
1022
1023int CMain::Run()
1024{
1025 if(m_Server.Init(this, m_Config.m_aBindAddr, m_Config.m_Port))
1026 return 1;
1027
1028 if(ReadConfig())
1029 return 1;
1030
1031 // Start JSON Update Thread
1032 m_JSONUpdateThreadData.m_ReloadRequired = 2;
1033 m_JSONUpdateThreadData.pClients = m_aClients;
1034 m_JSONUpdateThreadData.pConfig = &m_Config;
1035 m_JSONUpdateThreadData.pWatchDogs = m_aCWatchDogs;
1036 m_JSONUpdateThreadData.pMain = this;
1037 void *LoadThread = thread_create(JSONUpdateThread, &m_JSONUpdateThreadData);
1038 // Start SSL check thread
1039 static SSLCheckThreadData sslData; sslData.pMain = this; thread_create(SSLCheckThread, &sslData);
1040 //thread_detach(LoadThread);
1041
1042 while(gs_Running)
1043 {
1044 if(gs_ReloadConfig)
1045 {
1046 if(ReadConfig())
1047 return 1;
1048 m_Server.NetBan()->UnbanAll();
1049 gs_ReloadConfig = 0;
1050 }
1051
1052 m_Server.Update();
1053
1054 // wait for incomming data
1055 net_socket_read_wait(*m_Server.Network()->Socket(), 10);
1056 }
1057
1058 dbg_msg("server", "Closing.");
1059 m_Server.Network()->Close();
1060 thread_wait(LoadThread);
1061
1062 return 0;
1063}
1064
1065int main(int argc, const char *argv[])
1066{

Callers 1

mainFunction · 0.80

Calls 11

thread_createFunction · 0.85
net_socket_read_waitFunction · 0.85
dbg_msgFunction · 0.85
thread_waitFunction · 0.85
UnbanAllMethod · 0.80
SocketMethod · 0.80
NetworkMethod · 0.80
CloseMethod · 0.80
InitMethod · 0.45
NetBanMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected