mirror of
https://github.com/HikikoMarmy/Champions-Reborn-Server.git
synced 2026-04-11 11:29:47 -03:00
Correct IP reporting to clients.
Force port 3000 (game expects it)
This commit is contained in:
@@ -148,7 +148,7 @@ sptr_game_session GameSessionManager::FindGame( const int32_t gameId )
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
sptr_game_session GameSessionManager::FindGame(const std::wstring& gameName)
|
sptr_game_session GameSessionManager::FindGame( const std::wstring &gameName )
|
||||||
{
|
{
|
||||||
if( gameName.empty() ) return nullptr;
|
if( gameName.empty() ) return nullptr;
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ bool GameSessionManager::RequestOpen( sptr_user user )
|
|||||||
session->m_state = GameSession::GameState::Open;
|
session->m_state = GameSession::GameState::Open;
|
||||||
|
|
||||||
// Tell the host its own address.
|
// Tell the host its own address.
|
||||||
NotifyGameDiscovered msg(user->m_discoveryAddr, user->m_discoveryPort);
|
NotifyGameDiscovered msg( user->m_discoveryAddr, 3000 );// user->m_discoveryPort);
|
||||||
user->sock->send( msg );
|
user->sock->send( msg );
|
||||||
|
|
||||||
Log::Info( "Game Session [%d] Discoverable on %s", gameId, user->m_discoveryAddr.c_str() );
|
Log::Info( "Game Session [%d] Discoverable on %s", gameId, user->m_discoveryAddr.c_str() );
|
||||||
@@ -272,18 +272,12 @@ bool GameSessionManager::RequestJoin( sptr_user join_user )
|
|||||||
join_user->m_isHost = false;
|
join_user->m_isHost = false;
|
||||||
|
|
||||||
// First, notify the host that a client is trying to connect.
|
// First, notify the host that a client is trying to connect.
|
||||||
NotifyClientRequestConnect msgNotifyReqConnect(join_user->m_discoveryAddr, join_user->m_discoveryPort);
|
NotifyClientRequestConnect msgNotifyReqConnect( join_user->m_discoveryAddr, 3000 );// join_user->m_discoveryPort);
|
||||||
host_user->sock->send(msgNotifyReqConnect);
|
host_user->sock->send( msgNotifyReqConnect );
|
||||||
|
|
||||||
// Then, tell the joiner where to send packets.
|
// Then, tell the joiner where to send packets.
|
||||||
NotifyClientDiscovered msgClientDiscovered(host_user->m_discoveryAddr, host_user->m_discoveryPort);
|
NotifyClientDiscovered msgClientDiscovered( join_user->m_discoveryAddr, 3000 );// host_user->m_discoveryPort);
|
||||||
join_user->sock->send(msgClientDiscovered);
|
join_user->sock->send( msgClientDiscovered );
|
||||||
|
|
||||||
Log::Info( "Send User Address to host [%S] from %s:%d", join_user->m_sessionId.c_str(), join_user->m_discoveryAddr.c_str(), join_user->m_discoveryPort );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log::Info( "Send Host Address to user [%S] from %s:%d", join_user->m_sessionId.c_str(), host_user->m_discoveryAddr.c_str(), join_user->m_discoveryPort );
|
|
||||||
|
|
||||||
Log::Info( "User [%S] Joining game session... [%d]", join_user->m_sessionId.c_str(), gameId );
|
Log::Info( "User [%S] Joining game session... [%d]", join_user->m_sessionId.c_str(), gameId );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user