aboutsummaryrefslogtreecommitdiff
path: root/src/query.hh
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/query.hh
parent0612480d9beb19b9e90b3a4f1198b3da1fd21f6a (diff)
downloadgame-56bdec57609cd00d7827a3008a9c6b06707097ca.tar.gz
game-56bdec57609cd00d7827a3008a9c6b06707097ca.zip
all `crplayer.cc` functions outside `TPlayer`
Diffstat (limited to 'src/query.hh')
-rw-r--r--src/query.hh43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/query.hh b/src/query.hh
new file mode 100644
index 0000000..f9cd8de
--- /dev/null
+++ b/src/query.hh
@@ -0,0 +1,43 @@
+#ifndef TIBIA_QUERY_HH_
+#define TIBIA_QUERY_HH_ 1
+
+#include "common.hh"
+#include "thread.hh"
+
+struct TQueryManagerConnection{
+ TQueryManagerConnection(int QueryBufferSize);
+ int loadWorldConfig(int *WorldType, int *RebootTime,
+ int *IPAddress, int *Port,
+ int *MaxPlayers, int *PremiumPlayerBuffer,
+ int *MaxNewbies, int *PremiumNewbieBuffer);
+ int loadPlayers(uint32 MinimumCharacterID, int *NumberOfPlayers,
+ char (*Names)[30], uint32 *CharacterIDs);
+
+ bool isConnected(void){
+ return this->Socket >= 0;
+ }
+
+ // DATA
+ // =================
+ int BufferSize;
+ uint8 *Buffer;
+ TReadBuffer ReadBuffer;
+ TWriteBuffer WriteBuffer;
+ int Socket;
+ bool QueryOk;
+};
+
+struct TQueryManagerConnectionPool{
+ int NumberOfConnections;
+ TQueryManagerConnection *QueryManagerConnection;
+ bool *QueryManagerConnectionFree;
+ Semaphore FreeQueryManagerConnections;
+ Semaphore QueryManagerConnectionMutex;
+};
+
+struct TQueryManagerPoolConnection{
+ TQueryManagerConnectionPool *QueryManagerConnectionPool;
+ TQueryManagerConnection *QueryManagerConnection;
+};
+
+#endif //TIBIA_QUERY_HH_