aboutsummaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-06-17 03:13:05 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-06-17 03:13:05 -0300
commit56bdec57609cd00d7827a3008a9c6b06707097ca (patch)
tree08e42a536bf807842de299047195c9ecf5d526ae /src/main.cc
parent0612480d9beb19b9e90b3a4f1198b3da1fd21f6a (diff)
downloadgame-56bdec57609cd00d7827a3008a9c6b06707097ca.tar.gz
game-56bdec57609cd00d7827a3008a9c6b06707097ca.zip
all `crplayer.cc` functions outside `TPlayer`
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/main.cc b/src/main.cc
index 7a804e0..c0180c2 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -5,6 +5,7 @@
#include "magic.hh"
#include "objects.hh"
#include "operate.hh"
+#include "query.hh"
#include "stubs.hh"
@@ -184,36 +185,27 @@ static void LockGame(void){
}
void LoadWorldConfig(void){
-#if 0
- // TODO(fusion): Whenever we implement query/database stuff.
- TQueryManagerConnection Connection(0x4000);
- if(Connection.WriteBuffer.Position < 0){
+ TQueryManagerConnection Connection(KB(16));
+ if(!Connection.isConnected()){
error("LoadWorldConfig: Kann nicht zum Query-Manager verbinden.\n");
throw "cannot connect to querymanager";
}
+ int HelpWorldType;
int HelpGameAddress[4];
- int Ret = Connection.loadWorldConfig(&WorldType, &RebootTime, HelpGameAddress,
- &Port, &MaxPlayers, &PremiumPlayerBuffer, &MaxNewbies, &PremiumNewbieBuffer);
- if(Ret != 0){ // TODO(fusion): Maybe `Ret != QUERY_OK` or something?
+ int Ret = Connection.loadWorldConfig(&HelpWorldType, &RebootTime,
+ HelpGameAddress, &GamePort,
+ &MaxPlayers, &PremiumPlayerBuffer,
+ &MaxNewbies, &PremiumNewbieBuffer);
+ if(Ret != 0){
error("LoadWorldConfig: Kann Konfigurationsdaten nicht holen.\n");
throw "cannot load world config";
}
- // NOTE(fusion): Ugh...
+ WorldType = (TWorldType)HelpWorldType;
snprintf(GameAddress, sizeof(GameAddress), "%d.%d.%d.%d",
- HelpGameAddress[0], HelpGameAddress[1],
- HelpGameAddress[2], HelpGameAddress[3]);
-#endif
-
- WorldType = NORMAL;
- RebootTime = 6 * 60; // minutes
- strcpy(GameAddress, "127.0.0.1"); // I KNOW
- GamePort = 7171;
- MaxPlayers = 1000;
- PremiumPlayerBuffer = 100;
- MaxNewbies = 200;
- PremiumNewbieBuffer = 50;
+ HelpGameAddress[0], HelpGameAddress[1],
+ HelpGameAddress[2], HelpGameAddress[3]);
}
static void InitAll(void){