From dbb28ef3422bf2442e15d75fd52180cfb9b40102 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 8 Nov 2008 12:58:05 +0000 Subject: adds rcon, rconpassword and sv_password --- src/client/client.cc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'src/client/client.cc') diff --git a/src/client/client.cc b/src/client/client.cc index 823a384..6fccbe8 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -101,8 +101,13 @@ void Client::init(int count, char **arguments) core::Cvar::sv_private = core::Cvar::set("sv_private", "0"); core::Application::init(count, arguments); - // client variables + // engine variables + cl_framerate = core::Cvar::get("cl_framerate", "125", core::Cvar::Archive); + cl_framerate->set_info("[int] client framerate in frames/sec"); + + // player info variables core::Cvar *cvar = 0; + cvar = core::Cvar::get("cl_name", "Player", core::Cvar::Archive | core::Cvar::Info); cvar->set_info("[str] player name"); @@ -111,9 +116,9 @@ void Client::init(int count, char **arguments) cvar = core::Cvar::get("cl_colorsecond", "1.0 1.0 1.0", core::Cvar::Archive | core::Cvar::Info); cvar->set_info("[r g b] player secondary color"); - - cl_framerate = core::Cvar::get("cl_framerate", "125", core::Cvar::Archive); - cl_framerate->set_info("[int] client framerate in frames/sec"); + + cvar = core::Cvar::get("rconpassword", "", core::Cvar::Archive | core::Cvar::Info); + cvar->set_info("[string] password for remote console access"); // initialize SDL, but do not initialize any subsystems SDL_Init(0); @@ -207,15 +212,22 @@ void Client::frame(unsigned long timestamp) if (!core::application()->connected() && !ui::console()->visible()) { ui::console()->toggle(); } - } else { + } else if (!ui::root()->active()) { + // show the main menu on non-interactive modules - if (!core::game()->interactive() && !ui::root()->active()) { + if (!core::game()->interactive()) { ui::root()->show_menu("main"); - } - if (core::game()->interactive() && !ui::root()->active() && !core::localcontrol()) { + // show the join menu when player does not control an entity + } else if (core::game()->time() && !core::localcontrol()) { ui::root()->show_menu("join"); } + } else { + if (core::localcontrol()) { + if (ui::root()->active()->label().compare("join") == 0) { + ui::root()->hide_menu(); + } + } } video::frame((float)(timestamp - previous_timestamp) / 1000.0f); -- cgit v1.2.3