Remove --online and clarify global networking
This commit is contained in:
parent
1610158405
commit
d984409c6b
19
src/main.cpp
19
src/main.cpp
@ -559,7 +559,14 @@ void cmdLineHelp()
|
|||||||
" --aiNP=a,b,... Use the karts a, b, ... for the AI, no additional player kart.\n"
|
" --aiNP=a,b,... Use the karts a, b, ... for the AI, no additional player kart.\n"
|
||||||
" --laps=N Define number of laps to N.\n"
|
" --laps=N Define number of laps to N.\n"
|
||||||
" --mode=N N=1 Beginner, N=2 Intermediate, N=3 Expert, N=4 SuperTux.\n"
|
" --mode=N N=1 Beginner, N=2 Intermediate, N=3 Expert, N=4 SuperTux.\n"
|
||||||
" --type=N N=0 Normal, N=1 Time trial, N=2 Follow The Leader\n"
|
" --type=N N=0 Normal, N=1 Time trial, N=2 Battle, N=3 Soccer,\n"
|
||||||
|
" N=4 Follow The Leader. In configure server use --battle-mode=n\n"
|
||||||
|
" for battle server and --soccer-timed / goals for soccer server\n"
|
||||||
|
" to control verbosely, see below:\n"
|
||||||
|
" --battle-mode=n Specify battle mode in netowrk, 0 is Free-For-All and\n"
|
||||||
|
" 1 is Capture The Flag.\n"
|
||||||
|
" --soccer-timed Use time limit mode in network soccer game.\n"
|
||||||
|
" --soccer-goals Use goals limit mode in network soccer game.\n"
|
||||||
" --reverse Play track in reverse (if allowed)\n"
|
" --reverse Play track in reverse (if allowed)\n"
|
||||||
" -f, --fullscreen Use fullscreen display.\n"
|
" -f, --fullscreen Use fullscreen display.\n"
|
||||||
" -w, --windowed Use windowed display (default).\n"
|
" -w, --windowed Use windowed display (default).\n"
|
||||||
@ -610,10 +617,6 @@ void cmdLineHelp()
|
|||||||
" --team-choosing Allow choosing team in lobby, implicitly allowed in lan or\n"
|
" --team-choosing Allow choosing team in lobby, implicitly allowed in lan or\n"
|
||||||
" password protected server. This function cannot be used in\n"
|
" password protected server. This function cannot be used in\n"
|
||||||
" owner-less server.\n"
|
" owner-less server.\n"
|
||||||
" --soccer-timed Use time limit mode in network soccer game.\n"
|
|
||||||
" --soccer-goals Use goals limit mode in network soccer game.\n"
|
|
||||||
" --battle-mode=n Specify battle mode in netowrk, 0 is Free For All and\n"
|
|
||||||
" 1 is Capture The Flag.\n"
|
|
||||||
" --network-gp=n Specify number of tracks used in network grand prix.\n"
|
" --network-gp=n Specify number of tracks used in network grand prix.\n"
|
||||||
" --no-validation Allow non validated and unencrypted connection in wan.\n"
|
" --no-validation Allow non validated and unencrypted connection in wan.\n"
|
||||||
" --ranked Server will submit ranking to stk addons server.\n"
|
" --ranked Server will submit ranking to stk addons server.\n"
|
||||||
@ -737,7 +740,7 @@ int handleCmdLinePreliminary()
|
|||||||
if(CommandLine::has("--debug=all") )
|
if(CommandLine::has("--debug=all") )
|
||||||
UserConfigParams::m_verbosity |= UserConfigParams::LOG_ALL;
|
UserConfigParams::m_verbosity |= UserConfigParams::LOG_ALL;
|
||||||
if(CommandLine::has("--online"))
|
if(CommandLine::has("--online"))
|
||||||
MainMenuScreen::m_enable_online=true;
|
History::m_online_history_replay = true;
|
||||||
#if !(defined(SERVER_ONLY) || defined(ANDROID))
|
#if !(defined(SERVER_ONLY) || defined(ANDROID))
|
||||||
if(CommandLine::has("--apitrace"))
|
if(CommandLine::has("--apitrace"))
|
||||||
{
|
{
|
||||||
@ -1553,7 +1556,7 @@ int handleCmdLine()
|
|||||||
history->setReplayHistory(true);
|
history->setReplayHistory(true);
|
||||||
// Force the no-start screen flag, since this initialises
|
// Force the no-start screen flag, since this initialises
|
||||||
// the player structures correctly.
|
// the player structures correctly.
|
||||||
if(!MainMenuScreen::m_enable_online)
|
if (!History::m_online_history_replay)
|
||||||
UserConfigParams::m_no_start_screen = true;
|
UserConfigParams::m_no_start_screen = true;
|
||||||
} // --history
|
} // --history
|
||||||
|
|
||||||
@ -2100,7 +2103,7 @@ int main(int argc, char *argv[] )
|
|||||||
{
|
{
|
||||||
// This will setup the race manager etc.
|
// This will setup the race manager etc.
|
||||||
history->Load();
|
history->Load();
|
||||||
if (!MainMenuScreen::m_enable_online)
|
if (!History::m_online_history_replay)
|
||||||
{
|
{
|
||||||
race_manager->setupPlayerKartInfo();
|
race_manager->setupPlayerKartInfo();
|
||||||
race_manager->startNew(false);
|
race_manager->startNew(false);
|
||||||
|
@ -28,12 +28,11 @@
|
|||||||
#include "network/rewind_manager.hpp"
|
#include "network/rewind_manager.hpp"
|
||||||
#include "physics/physics.hpp"
|
#include "physics/physics.hpp"
|
||||||
#include "race/race_manager.hpp"
|
#include "race/race_manager.hpp"
|
||||||
#include "states_screens/main_menu_screen.hpp"
|
|
||||||
#include "tracks/track.hpp"
|
#include "tracks/track.hpp"
|
||||||
#include "utils/constants.hpp"
|
#include "utils/constants.hpp"
|
||||||
|
|
||||||
History* history = 0;
|
History* history = 0;
|
||||||
|
bool History::m_online_history_replay = false;
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/** Initialises the history object and sets the mode to none.
|
/** Initialises the history object and sets the mode to none.
|
||||||
*/
|
*/
|
||||||
@ -272,7 +271,7 @@ void History::Load()
|
|||||||
if(sscanf(s, "model %d: %1023s",&n, s1) != 2)
|
if(sscanf(s, "model %d: %1023s",&n, s1) != 2)
|
||||||
Log::fatal("History", "No model information for kart %d found.", i);
|
Log::fatal("History", "No model information for kart %d found.", i);
|
||||||
m_kart_ident.push_back(s1);
|
m_kart_ident.push_back(s1);
|
||||||
if(i<race_manager->getNumPlayers() && !MainMenuScreen::m_enable_online)
|
if(i<race_manager->getNumPlayers() && !m_online_history_replay)
|
||||||
{
|
{
|
||||||
race_manager->setPlayerKart(i, s1);
|
race_manager->setPlayerKart(i, s1);
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ private:
|
|||||||
|
|
||||||
void allocateMemory(int size=-1);
|
void allocateMemory(int size=-1);
|
||||||
public:
|
public:
|
||||||
|
static bool m_online_history_replay;
|
||||||
History ();
|
History ();
|
||||||
void initRecording ();
|
void initRecording ();
|
||||||
void Save ();
|
void Save ();
|
||||||
|
@ -68,8 +68,6 @@
|
|||||||
using namespace GUIEngine;
|
using namespace GUIEngine;
|
||||||
using namespace Online;
|
using namespace Online;
|
||||||
|
|
||||||
bool MainMenuScreen::m_enable_online = false;
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
MainMenuScreen::MainMenuScreen() : Screen("main_menu.stkgui")
|
MainMenuScreen::MainMenuScreen() : Screen("main_menu.stkgui")
|
||||||
@ -497,24 +495,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
|
|||||||
"\"Connect to the Internet\"."));
|
"\"Connect to the Internet\"."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Define this to require a login to the stk server (default behaviour)
|
OnlineScreen::getInstance()->push();
|
||||||
// Undefine for testing LAN only.
|
|
||||||
if (MainMenuScreen::m_enable_online)
|
|
||||||
{
|
|
||||||
OnlineScreen::getInstance()->push();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (PlayerManager::getCurrentOnlineId())
|
|
||||||
{
|
|
||||||
ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId());
|
|
||||||
TabOnlineProfileAchievements::getInstance()->push();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UserScreen::getInstance()->push();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (selection == "addons")
|
else if (selection == "addons")
|
||||||
{
|
{
|
||||||
|
@ -38,9 +38,6 @@ private:
|
|||||||
MainMenuScreen();
|
MainMenuScreen();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Temporary disable the online menu while it is being worked at. */
|
|
||||||
static bool m_enable_online;
|
|
||||||
|
|
||||||
virtual void onUpdate(float delta) OVERRIDE;
|
virtual void onUpdate(float delta) OVERRIDE;
|
||||||
|
|
||||||
/** \brief implement callback from parent class GUIEngine::Screen */
|
/** \brief implement callback from parent class GUIEngine::Screen */
|
||||||
|
@ -73,6 +73,23 @@ void OnlineScreen::loadedFromFile()
|
|||||||
|
|
||||||
void OnlineScreen::beforeAddingWidget()
|
void OnlineScreen::beforeAddingWidget()
|
||||||
{
|
{
|
||||||
|
} // beforeAddingWidget
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
void OnlineScreen::init()
|
||||||
|
{
|
||||||
|
Screen::init();
|
||||||
|
|
||||||
|
m_online = getWidget<IconButtonWidget>("online");
|
||||||
|
assert(m_online);
|
||||||
|
|
||||||
|
m_user_id = getWidget<ButtonWidget>("user-id");
|
||||||
|
assert(m_user_id);
|
||||||
|
|
||||||
|
RibbonWidget* r = getWidget<RibbonWidget>("menu_toprow");
|
||||||
|
r->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
|
||||||
|
|
||||||
bool is_logged_in = false;
|
bool is_logged_in = false;
|
||||||
if (PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_GUEST ||
|
if (PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_GUEST ||
|
||||||
PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_IN)
|
PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_IN)
|
||||||
@ -84,26 +101,15 @@ void OnlineScreen::beforeAddingWidget()
|
|||||||
if (wan)
|
if (wan)
|
||||||
{
|
{
|
||||||
wan->setActive(is_logged_in);
|
wan->setActive(is_logged_in);
|
||||||
wan->setVisible(is_logged_in);
|
if (!is_logged_in)
|
||||||
|
{
|
||||||
|
//I18N: Shown to players when he is not is not logged in
|
||||||
|
wan->setTooltip(_("You must be logged in to play Global "
|
||||||
|
"networking. Click your username above."));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
wan->setTooltip("");
|
||||||
}
|
}
|
||||||
} // beforeAddingWidget
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
void OnlineScreen::init()
|
|
||||||
{
|
|
||||||
Screen::init();
|
|
||||||
|
|
||||||
m_online = getWidget<IconButtonWidget>("online");
|
|
||||||
|
|
||||||
if (!MainMenuScreen::m_enable_online)
|
|
||||||
m_online->setActive(false);
|
|
||||||
|
|
||||||
m_user_id = getWidget<ButtonWidget>("user-id");
|
|
||||||
assert(m_user_id);
|
|
||||||
|
|
||||||
RibbonWidget* r = getWidget<RibbonWidget>("menu_toprow");
|
|
||||||
r->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
|
|
||||||
|
|
||||||
// Pre-add a default single player profile in network
|
// Pre-add a default single player profile in network
|
||||||
if (!m_enable_splitscreen->getState() &&
|
if (!m_enable_splitscreen->getState() &&
|
||||||
|
Loading…
Reference in New Issue
Block a user