mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-12 10:28:05 +00:00
chore: convert all auth packets to LUBitStreams
Split things out to their correct files as well
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
#include "Logger.h"
|
||||
#include "Game.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "eServerDisconnectIdentifiers.h"
|
||||
#include "eGameMasterLevel.h"
|
||||
#include "CommonPackets.h"
|
||||
|
||||
User::User(const SystemAddress& sysAddr, const std::string& username, const std::string& sessionKey) {
|
||||
m_AccountID = 0;
|
||||
@@ -108,7 +108,10 @@ void User::UserOutOfSync() {
|
||||
if (m_AmountOfTimesOutOfSync > m_MaxDesyncAllowed) {
|
||||
//YEET
|
||||
LOG("User %s was out of sync %i times out of %i, disconnecting for suspected speedhacking.", m_Username.c_str(), m_AmountOfTimesOutOfSync, m_MaxDesyncAllowed);
|
||||
Game::server->Disconnect(this->m_SystemAddress, eServerDisconnectIdentifiers::PLAY_SCHEDULE_TIME_DONE);
|
||||
CommonPackets::DisconnectNotify notification;
|
||||
notification.disconnectID = eServerDisconnectIdentifiers::PLAY_SCHEDULE_TIME_DONE;
|
||||
notification.Send(this->m_SystemAddress);
|
||||
Game::server->Disconnect(this->m_SystemAddress);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -105,7 +105,6 @@ namespace Mail {
|
||||
|
||||
struct MailLUBitStream : public LUBitStream {
|
||||
eMessageID messageID = eMessageID::UnknownError;
|
||||
SystemAddress sysAddr = UNASSIGNED_SYSTEM_ADDRESS;
|
||||
Entity* player = nullptr;
|
||||
|
||||
MailLUBitStream() = default;
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// Classes
|
||||
#include "Character.h"
|
||||
#include "ChatPackets.h"
|
||||
#include "CommonPackets.h"
|
||||
#include "dServer.h"
|
||||
#include "PlayerManager.h"
|
||||
#include "User.h"
|
||||
@@ -16,7 +17,6 @@
|
||||
|
||||
// Enums
|
||||
#include "MessageType/Chat.h"
|
||||
#include "eServerDisconnectIdentifiers.h"
|
||||
#include "eObjectBits.h"
|
||||
|
||||
namespace GMGreaterThanZeroCommands {
|
||||
@@ -31,8 +31,10 @@ namespace GMGreaterThanZeroCommands {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Count not find player of name: " + username);
|
||||
return;
|
||||
}
|
||||
|
||||
Game::server->Disconnect(player->GetSystemAddress(), eServerDisconnectIdentifiers::KICK);
|
||||
CommonPackets::DisconnectNotify notification;
|
||||
notification.disconnectID = eServerDisconnectIdentifiers::KICK;
|
||||
notification.Send(player->GetSystemAddress());
|
||||
Game::server->Disconnect(player->GetSystemAddress());
|
||||
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Kicked: " + username);
|
||||
} else {
|
||||
@@ -69,7 +71,10 @@ namespace GMGreaterThanZeroCommands {
|
||||
if (accountId != 0) Database::Get()->UpdateAccountBan(accountId, true);
|
||||
|
||||
if (player != nullptr) {
|
||||
Game::server->Disconnect(player->GetSystemAddress(), eServerDisconnectIdentifiers::FREE_TRIAL_EXPIRED);
|
||||
CommonPackets::DisconnectNotify notification;
|
||||
notification.disconnectID = eServerDisconnectIdentifiers::FREE_TRIAL_EXPIRED;
|
||||
notification.Send(player->GetSystemAddress());
|
||||
Game::server->Disconnect(player->GetSystemAddress());
|
||||
}
|
||||
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Banned: " + GeneralUtils::ASCIIToUTF16(splitArgs[0]));
|
||||
|
Reference in New Issue
Block a user