From aa59c89fa2c401607adc7ac9a016537691602e6d Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 18 Jul 2013 16:33:59 -0400 Subject: [PATCH] logging in in the save preview will update the login button on the main screen --- src/client/Client.cpp | 4 ---- src/gui/game/GameController.cpp | 17 ++--------------- src/gui/game/GameController.h | 1 - src/gui/login/LoginController.cpp | 5 +---- 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 25fd430f9..a9f70329b 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -1273,7 +1273,6 @@ RequestBroker::Request * Client::GetUserInfoAsync(std::string username) LoginStatus Client::Login(std::string username, std::string password, User & user) { lastError = ""; - std::stringstream urlStream; std::stringstream hashStream; char passwordHash[33]; char totalHash[33]; @@ -1296,7 +1295,6 @@ LoginStatus Client::Login(std::string username, std::string password, User & use char * postDatas[] = { (char*)username.c_str(), totalHash }; int postLengths[] = { username.length(), 32 }; data = http_multipart_post("http://" SERVER "/Login.json", postNames, postDatas, postLengths, NULL, NULL, NULL, &dataStatus, &dataLength); - //data = http_auth_get("http://" SERVER "/Login.json", (char*)username.c_str(), (char*)password.c_str(), NULL, &dataStatus, &dataLength); if(dataStatus == 200 && data) { try @@ -1355,9 +1353,7 @@ LoginStatus Client::Login(std::string username, std::string password, User & use lastError = http_ret_text(dataStatus); } if(data) - { free(data); - } return LoginError; } diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 7312cbe7d..311cc0cbf 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -79,18 +79,6 @@ public: } }; - -class GameController::RenderCallback: public ControllerCallback -{ - GameController * cc; -public: - RenderCallback(GameController * cc_) { cc = cc_; } - virtual void ControllerExit() - { - //cc->gameModel->SetUser(cc->loginWindow->GetUser()); - } -}; - class GameController::OptionsCallback: public ControllerCallback { GameController * cc; @@ -99,7 +87,6 @@ public: virtual void ControllerExit() { cc->gameModel->UpdateQuickOptions(); - //cc->gameModel->SetUser(cc->loginWindow->GetUser()); } }; @@ -1219,7 +1206,7 @@ void GameController::HideConsole() void GameController::OpenRenderOptions() { - renderOptions = new RenderController(gameModel->GetRenderer(), new RenderCallback(this)); + renderOptions = new RenderController(gameModel->GetRenderer(), NULL); ui::Engine::Ref().ShowWindow(renderOptions->GetView()); } @@ -1230,7 +1217,7 @@ void GameController::OpenSaveWindow() GameController * c; public: SaveUploadedCallback(GameController * _c): c(_c) {} - virtual ~SaveUploadedCallback() {}; + virtual ~SaveUploadedCallback() {} virtual void SaveUploaded(SaveInfo save) { save.SetVote(1); diff --git a/src/gui/game/GameController.h b/src/gui/game/GameController.h index 844fbe777..88f426bc6 100644 --- a/src/gui/game/GameController.h +++ b/src/gui/game/GameController.h @@ -47,7 +47,6 @@ private: public: bool HasDone; class SearchCallback; - class RenderCallback; class SSaveCallback; class TagsCallback; class StampsCallback; diff --git a/src/gui/login/LoginController.cpp b/src/gui/login/LoginController.cpp index fd8e5769e..812dada39 100644 --- a/src/gui/login/LoginController.cpp +++ b/src/gui/login/LoginController.cpp @@ -31,12 +31,9 @@ void LoginController::Exit() { ui::Engine::Ref().CloseWindow(); } + Client::Ref().SetAuthUser(loginModel->GetUser()); if(callback) callback->ControllerExit(); - else - { - Client::Ref().SetAuthUser(loginModel->GetUser()); - } HasExited = true; }