Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-09-27 17:16:15 +0000
committerStijn Buys <ingar@osirion.org>2008-09-27 17:16:15 +0000
commitca0c1d3e6f8b5fa4eb2e0a86fcf47b12fb600786 (patch)
tree5d72e330f11350065806e83cc8712693241b9aad /src/core/commandbuffer.cc
parent29984680d6e0e52efec489497b1796e056164442 (diff)
mission targets, texture unloading, private messages
Diffstat (limited to 'src/core/commandbuffer.cc')
-rw-r--r--src/core/commandbuffer.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/core/commandbuffer.cc b/src/core/commandbuffer.cc
index c111e17..5ed3787 100644
--- a/src/core/commandbuffer.cc
+++ b/src/core/commandbuffer.cc
@@ -64,6 +64,11 @@ void func_list_zone(std::string const &args)
}
}
+void func_list_model(std::string const &args)
+{
+ model::Model::list();
+}
+
void func_set(std::string const &args)
{
std::istringstream argstream(args);
@@ -160,6 +165,9 @@ void CommandBuffer::init()
func = Func::add("list_zone", (FuncPtr)func_list_zone);
func->set_info("list zones");
+ Func::add("list_model", (FuncPtr) func_list_model);
+ func->set_info("list models");
+
func = Func::add("set", (FuncPtr)func_set);
func->set_info("[variable] [str] set variable value");
@@ -185,6 +193,7 @@ void CommandBuffer::shutdown()
Func::remove("list_var");
Func::remove("list_func");
Func::remove("list_ent");
+ Func::remove("list_model");
Func::remove("list_zone");
Func::remove("print");
Func::remove("print_file");
@@ -205,6 +214,10 @@ void CommandBuffer::exec(std::string const &cmdline)
aux::to_lowercase(command);
//con_debug << "Executing '" << cmdline << "'\n";
+ if ((command[0] == '\\') || (command[0] == '/')) {
+ command.erase(0, 1);
+ }
+
// is it a function
Func *f = Func::find(command);
if (f) {
@@ -248,10 +261,15 @@ void CommandBuffer::exec(std::string const &cmdline)
}
// this gets forwarded to the server
- if (connection())
- connection()->forward(cmdline);
- else
+ if (connection()) {
+ if ((cmdline[0] == '\\') || (cmdline[0] == '/')) {
+ connection()->forward(cmdline.substr(1, cmdline.size()-1));
+ } else {
+ connection()->forward(cmdline);
+ }
+ } else {
con_print << "Unknown command '" << command << "^N'\n";
+ }
}
void CommandBuffer::exec()