diff options
author | Stijn Buys <ingar@osirion.org> | 2008-11-08 12:58:05 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-11-08 12:58:05 +0000 |
commit | dbb28ef3422bf2442e15d75fd52180cfb9b40102 (patch) | |
tree | 16b9f8bb8b5bfa64f9676e4eed134dbe15299c90 /src/client | |
parent | e3512a1b55e97b2eba62847e6e28065eec24c92f (diff) |
adds rcon, rconpassword and sv_password
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/client.cc | 28 | ||||
-rw-r--r-- | src/client/input.cc | 2 |
2 files changed, 21 insertions, 9 deletions
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); diff --git a/src/client/input.cc b/src/client/input.cc index d4ccb17..1df64df 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -686,7 +686,7 @@ void frame() switch (event.type) { case SDL_VIDEORESIZE: - video::resize((float) event.resize.w, (float) event.resize.h); + video::resize(event.resize.w, event.resize.h); break; case SDL_MOUSEMOTION: |