| 297 | } |
| 298 | |
| 299 | void 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 | |
| 326 | void CNetworkServer::ParseCheatBlackList(std::weak_ptr <CNetworkServer> self) |
| 327 | { |
nothing calls this directly
no test coverage detected