Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/application.cc')
-rw-r--r--src/core/application.cc33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/core/application.cc b/src/core/application.cc
index 810bacb..a5d2937 100644
--- a/src/core/application.cc
+++ b/src/core/application.cc
@@ -19,9 +19,12 @@ namespace core
extern "C" void func_print(std::stringstream &args)
{
char text[MAXCMDSIZE];
- // FIXME leading space
- if (args.getline(text, MAXCMDSIZE))
- con_print << text << std::endl;
+ if (args.getline(text, MAXCMDSIZE)) {
+ // remove the leading space
+ if (text[0] && text[1]) {
+ con_print << text+1 << std::endl;
+ }
+ }
}
extern "C" void func_help(std::stringstream &args)
@@ -49,6 +52,16 @@ extern "C" void func_disconnect(std::stringstream &args)
Application::instance()->disconnect();
}
+extern "C" void func_listfunc(std::stringstream &args)
+{
+ func::list();
+}
+
+extern "C" void func_listcvar(std::stringstream &args)
+{
+ cvar::list();
+}
+
// --------------- signal_handler -----------------------------------
extern "C" void signal_handler(int signum)
@@ -118,10 +131,11 @@ void Application::init()
func::add("connect", func_connect);
func::add("disconnect", func_disconnect);
+ func::add("listcvar", func_listcvar);
+ func::add("listfunc", func_listfunc);
+
if (game())
game()->connected = false;
- else
- con_warn << "No game module loaded!" << std::endl;
current_time = 0;
}
@@ -129,11 +143,10 @@ void Application::shutdown()
{
con_print << "Shutting down core..." << std::endl;
- if (game())
- if (game()->connected)
- disconnect();
- else
- con_warn << "No game module loaded!" << std::endl;
+ if (game() && game()->connected)
+ disconnect();
+
+ //if (game()) unload();
filesystem::shutdown();
}