MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / OnMySQLConnect

Method OnMySQLConnect

Source/Client/NM_Engine/ServerSocketAuth.cpp:299–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299void CNetworkServer::OnMySQLConnect(std::weak_ptr <CNetworkServer> self, AMY_SYSTEM_NS::error_code const& e)
300{
301 std::shared_ptr <CNetworkServer> _this(self.lock());
302 if (_this)
303 {
304 if (!e)
305 {
306 auto reconnect = true;
307
308 if (0 != mysql_options(_this->m_pSQLConnector.native(), MYSQL_OPT_RECONNECT, &reconnect))
309 {
310 NETWORK_LOG(LL_SYS, "mysql_option: %s", mysql_error(_this->m_pSQLConnector.native()));
311 }
312 mysql_set_character_set(_this->m_pSQLConnector.native(), "latin1");
313
314 NETWORK_LOG(LL_SYS, "Binding server on %s:%u", _this->m_pServerCfg.szBindIP.c_str(), _this->m_pServerCfg.usPort);
315 _this->Bind(_this->m_pServerCfg.szBindIP, _this->m_pServerCfg.usPort);
316
317 _this->ParseCheatBlackList(self);
318 }
319 else
320 {
321 NETWORK_LOG(LL_CRI, "Cannot connect to MySQL server! Error: %s(%d)", e.message().c_str(), e.value());
322 }
323 }
324}
325
326void CNetworkServer::ParseCheatBlackList(std::weak_ptr <CNetworkServer> self)
327{

Callers

nothing calls this directly

Calls 3

lockMethod · 0.80
BindMethod · 0.80
ParseCheatBlackListMethod · 0.80

Tested by

no test coverage detected