From 730c452ff5896ed66114e6b2153add9379edef5c Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 21 Feb 2010 12:36:17 +0000 Subject: network info messages bugfixes --- src/game/base/shipdealer.cc | 11 +++++++++++ src/game/base/shipmodel.cc | 6 ++++++ src/game/base/shipmodel.h | 2 ++ 3 files changed, 19 insertions(+) (limited to 'src/game/base') 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; -- cgit v1.2.3