aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/connections.cc9
-rw-r--r--src/querymanager.cc4
-rw-r--r--src/querymanager.hh10
3 files changed, 12 insertions, 11 deletions
diff --git a/src/connections.cc b/src/connections.cc
index b851954..b148292 100644
--- a/src/connections.cc
+++ b/src/connections.cc
@@ -189,9 +189,9 @@ void CheckConnectionInput(TConnection *Connection, int Events){
int ReadSize = Connection->RWSize;
if(ReadSize == 0){
if(Connection->RWPosition < 2){
- ReadSize = 2 - Connection->RWPosition;
+ ReadSize = 2;
}else{
- ReadSize = 6 - Connection->RWPosition;
+ ReadSize = 6;
}
ASSERT(ReadSize > 0);
}
@@ -392,7 +392,8 @@ void CheckConnectionQueryRequest(TConnection *Connection){
SendQueryFailed(Connection);
}
}else if(Connection->ApplicationType == APPLICATION_TYPE_LOGIN){
- if(QueryType == QUERY_LOGIN_ACCOUNT){
+ // TODO(fusion): Probably have a custom query for querying world status?
+ if(QueryType == QUERY_LOGIN_ACCOUNT || QueryType == QUERY_GET_WORLDS){
ProcessQuery(Connection);
}else{
LOG_ERR("Invalid LOGIN query %d (%s) from %s",
@@ -599,7 +600,7 @@ void ProcessConnections(void){
}
for(int i = 0; i < g_Config.MaxConnections; i += 1){
- if(g_Connections[i].State == CONNECTION_FREE || g_Connections[i].Socket == -1){
+ if(g_Connections[i].State == CONNECTION_FREE){
continue;
}
diff --git a/src/querymanager.cc b/src/querymanager.cc
index 1c638b2..e4a05b8 100644
--- a/src/querymanager.cc
+++ b/src/querymanager.cc
@@ -240,7 +240,7 @@ bool StringFormat(char *Dest, int DestCapacity, const char *Format, ...){
}
bool StringFormatTime(char *Dest, int DestCapacity, const char *Format, int Timestamp){
- struct tm tm = GetLocalTime((int)Timestamp);
+ struct tm tm = GetLocalTime((time_t)Timestamp);
int Result = (int)strftime(Dest, DestCapacity, Format, &tm);
// NOTE(fusion): `strftime` will return ZERO if it's unable to fit the result
@@ -801,7 +801,7 @@ int main(int argc, const char **argv){
g_Config.MariaDB.MaxCachedStatements = 100;
// Connection Config
- g_Config.QueryManagerPort = 7174;
+ g_Config.QueryManagerPort = 7173;
StringBufCopy(g_Config.QueryManagerPassword, "");
g_Config.QueryWorkerThreads = 1;
g_Config.QueryBufferSize = (int)MB(1);
diff --git a/src/querymanager.hh b/src/querymanager.hh
index c9ab96b..eb11754 100644
--- a/src/querymanager.hh
+++ b/src/querymanager.hh
@@ -1234,11 +1234,11 @@ enum : int {
};
enum ConnectionState: int {
- CONNECTION_FREE = 0,
- CONNECTION_READING = 1,
- CONNECTION_REQUEST = 2,
- CONNECTION_RESPONSE = 3,
- CONNECTION_WRITING = 4,
+ CONNECTION_FREE = 0,
+ CONNECTION_READING = 1,
+ CONNECTION_REQUEST = 2,
+ CONNECTION_RESPONSE = 3,
+ CONNECTION_WRITING = 4,
};
struct TConnection{