small fixes to let server joining work. (temporary version though.)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13315 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
20e6fe74b2
commit
bf2d907ccf
@ -25,6 +25,7 @@
|
||||
#include "config/user_config.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "online/servers_manager.hpp"
|
||||
|
||||
namespace Online{
|
||||
static Synchronised<CurrentUser*> user_singleton(NULL);
|
||||
@ -209,6 +210,7 @@ namespace Online{
|
||||
request->setParameter("token", m_token);
|
||||
request->setParameter("id", m_id);
|
||||
request->setParameter("server_id", server_id);
|
||||
HTTPManager::get()->addRequest(request);
|
||||
return request;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,8 @@ ServerInfoDialog::ServerInfoDialog(Server * server, bool join) :
|
||||
m_cancel_widget = getWidget<IconButtonWidget>("cancel");
|
||||
assert(m_cancel_widget != NULL);
|
||||
m_options_widget->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
|
||||
requestJoin();
|
||||
if (join)
|
||||
requestJoin();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -75,7 +76,7 @@ ServerInfoDialog::~ServerInfoDialog()
|
||||
// -----------------------------------------------------------------------------
|
||||
void ServerInfoDialog::requestJoin()
|
||||
{
|
||||
Online::CurrentUser::acquire()->requestServerJoin(m_server->getServerId());
|
||||
m_server_join_request = Online::CurrentUser::acquire()->requestServerJoin(m_server->getServerId());
|
||||
Online::CurrentUser::release();
|
||||
}
|
||||
|
||||
@ -122,6 +123,8 @@ void ServerInfoDialog::onUpdate(float dt)
|
||||
{
|
||||
if(m_server_join_request->isSuccess())
|
||||
{
|
||||
ServersManager::acquire()->setJoinedServer(m_server);
|
||||
ServersManager::release();
|
||||
m_enter_lobby = true;
|
||||
}
|
||||
else
|
||||
@ -148,7 +151,9 @@ void ServerInfoDialog::onUpdate(float dt)
|
||||
{
|
||||
ModalDialog::dismiss();
|
||||
if (m_enter_lobby)
|
||||
{
|
||||
StateManager::get()->pushScreen(NetworkingLobby::getInstance());
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user