Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base')
-rw-r--r--src/game/base/shipdealer.cc11
-rw-r--r--src/game/base/shipmodel.cc6
-rw-r--r--src/game/base/shipmodel.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/game/base/shipdealer.cc b/src/game/base/shipdealer.cc
index b38855b..d825e2c 100644
--- a/src/game/base/shipdealer.cc
+++ b/src/game/base/shipdealer.cc
@@ -83,7 +83,18 @@ void ShipDealer::func_buy(core::Player *player, const std::string &args)
}
if (!shipmodel) {
+ // enable rcon buffering
+ sys::ConsoleInterface::instance()->set_rcon(true);
ShipModel::list();
+
+ while (sys::ConsoleInterface::instance()->rconbuf().size()) {
+ player->send((*sys::ConsoleInterface::instance()->rconbuf().begin()));
+ sys::ConsoleInterface::instance()->rconbuf().pop_front();
+ }
+
+ // disable rcon buffering
+ sys::ConsoleInterface::instance()->set_rcon(false);
+
player->send("Usage: buy ship label");
return;
}
diff --git a/src/game/base/shipmodel.cc b/src/game/base/shipmodel.cc
index dacc5a6..a6a2bf9 100644
--- a/src/game/base/shipmodel.cc
+++ b/src/game/base/shipmodel.cc
@@ -75,4 +75,10 @@ ShipModel *ShipModel::search(const std::string searchstr)
return (ShipModel *) core::Info::search(shipmodel_infotype, searchstr);
}
+
+void ShipModel::list()
+{
+ core::Info::list(shipmodel_infotype);
+}
+
}
diff --git a/src/game/base/shipmodel.h b/src/game/base/shipmodel.h
index dc56033..3c7f6df 100644
--- a/src/game/base/shipmodel.h
+++ b/src/game/base/shipmodel.h
@@ -85,6 +85,8 @@ public:
static ShipModel *find(const std::string & label);
static ShipModel *search(const std::string searchstr);
+
+ static void list();
static core::InfoType *shipmodel_infotype;