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/info.cc')
-rw-r--r--src/core/info.cc34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/core/info.cc b/src/core/info.cc
index 5615f8b..1a4f68f 100644
--- a/src/core/info.cc
+++ b/src/core/info.cc
@@ -8,6 +8,7 @@
#include "core/info.h"
#include "sys/sys.h"
#include "core/info.h"
+#include "core/gameinterface.h"
#include <iomanip>
@@ -16,11 +17,8 @@ namespace core
/* ---- class InfoType --------------------------------------------- */
-InfoType::InfoType(const char *label)
+InfoType::InfoType(const char *label) : Label(label)
{
- if (label)
- set_label(label);
-
infotype_registry.push_back(this);
}
@@ -59,7 +57,7 @@ InfoType *InfoType::find(const std::string & label)
unsigned int info_id_counter = 0;
// server-side constructor, assigns an id
-Info::Info(const InfoType *type)
+Info::Info(const InfoType *type, const char *label) : Label(label)
{
info_id_counter++;
info_id = info_id_counter;
@@ -71,30 +69,19 @@ Info::Info(const InfoType *type)
info_price = 0;
}
-// client-side constructor, does not assign an id
-Info::Info(const InfoType *type, const std::string & label)
-{
- info_id = 0;
- info_type = type;
- info_registry.push_back(this);
-
- info_model = 0;
- info_timestamp = 0;
- info_price = 0;
-
- set_label(label);
-}
-
-// client-side constructor, does not assign an id
+// client-side constructor, id is passed as param
Info::Info(const unsigned int id)
{
info_id = id;
info_type = 0;
info_registry.push_back(this);
- info_model = 0;
- info_timestamp = 0;
+ info_model = 0;
info_price = 0;
+
+ info_timestamp = 1;
+
+ add_text("Requesting server information...");
}
Info::~Info()
@@ -209,6 +196,9 @@ void Info::receive_server_update(std::istream &is)
add_text(n);
}
+
+ // set timestamp to 0
+ info_timestamp = 0;
}
void Info::print() const