72 lines
1.9 KiB
C++
72 lines
1.9 KiB
C++
// Copyright (C) 2007-2025 EQ2EMulator
|
|
// Licensed under GPL v3
|
|
#ifndef LOGINSERVER_H
|
|
#define LOGINSERVER_H
|
|
|
|
#include "../common/servertalk.h"
|
|
#include "../common/linked_list.h"
|
|
#include "../common/timer.h"
|
|
#include "../common/queue.h"
|
|
#include "../common/Mutex.h"
|
|
#include "../common/TCPConnection.h"
|
|
#include <deque>
|
|
#include "MutexMap.h"
|
|
|
|
#ifdef WIN32
|
|
void AutoInitLoginServer(void *tmp);
|
|
#else
|
|
void *AutoInitLoginServer(void *tmp);
|
|
#endif
|
|
bool InitLoginServer();
|
|
|
|
class LoginServer{
|
|
public:
|
|
LoginServer(const char* iAddress = 0, int16 iPort = 5999);
|
|
~LoginServer();
|
|
|
|
bool Process();
|
|
bool Connect(const char* iAddress = 0, int16 iPort = 0);
|
|
|
|
bool ConnectToUpdateServer(const char* iAddress = 0, int16 iPort = 0);
|
|
|
|
void SendInfo();
|
|
void SendStatus();
|
|
void GetLatestTables();
|
|
|
|
void SendPacket(ServerPacket* pack) { tcpc->SendPacket(pack); }
|
|
int8 GetState() { return tcpc->GetState(); }
|
|
bool Connected() { return tcpc->Connected(); }
|
|
|
|
void SendFilterNameResponse ( int8 resp , int32 acct_id , int32 char_id );
|
|
|
|
void SendDeleteCharacter ( CharacterTimeStamp_Struct* cts );
|
|
|
|
int32 DetermineCharacterLoginRequest ( UsertoWorldRequest_Struct* utwr, ZoneChangeDetails* details, std::string name);
|
|
void SendCharApprovedLogin(int8 response, std::string peerAddress, std::string peerInternalAddress, std::string clientIP, int16 peerPort, int32 account_id, int32 char_id, int32 key, int32 world_id, int32 from_id);
|
|
void InitLoginServerVariables();
|
|
|
|
sint16 minLockedStatus;
|
|
sint16 maxPlayers;
|
|
sint16 minGameFullStatus;
|
|
|
|
void SendImmediateEquipmentUpdatesForChar(int32 char_id);
|
|
|
|
bool CanReconnect() { return pTryReconnect; }
|
|
|
|
private:
|
|
bool try_auto_update;
|
|
bool pTryReconnect;
|
|
TCPConnection* tcpc;
|
|
int32 LoginServerIP;
|
|
int32 UpdateServerIP;
|
|
int16 LoginServerPort;
|
|
|
|
uchar* data_waiting;
|
|
MutexMap<int32, LoginZoneUpdate>* zone_updates;
|
|
MutexMap<int32, LoginEquipmentUpdate>* loginEquip_updates;
|
|
int32 last_checked_time;
|
|
|
|
Timer* statusupdate_timer;
|
|
};
|
|
#endif
|