Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions dAuthServer/AuthServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

//Auth includes:
#include "AuthPackets.h"
#include "CommonPackets.h"
#include "ServiceType.h"
#include "MessageType/Server.h"
#include "MessageType/Auth.h"
Expand Down Expand Up @@ -166,15 +167,13 @@ int main(int argc, char** argv) {
void HandlePacket(Packet* packet) {
if (packet->length < 4) return;

if (packet->data[0] == ID_USER_PACKET_ENUM) {
if (static_cast<ServiceType>(packet->data[1]) == ServiceType::COMMON) {
if (static_cast<MessageType::Server>(packet->data[3]) == MessageType::Server::VERSION_CONFIRM) {
AuthPackets::HandleHandshake(Game::server, packet);
}
} else if (static_cast<ServiceType>(packet->data[1]) == ServiceType::AUTH) {
if (static_cast<MessageType::Auth>(packet->data[3]) == MessageType::Auth::LOGIN_REQUEST) {
AuthPackets::HandleLoginRequest(Game::server, packet);
}
}
CINSTREAM;
LUBitStream luBitStream;
if (!luBitStream.ReadHeader(inStream)) return;

if (luBitStream.connectionType == ServiceType::COMMON) {
CommonPackets::Handle(inStream, packet->systemAddress);
} else if (luBitStream.connectionType == ServiceType::AUTH) {
AuthPackets::Handle(inStream, packet->systemAddress);
}
}
24 changes: 0 additions & 24 deletions dCommon/dEnums/eLoginResponse.h

This file was deleted.

24 changes: 0 additions & 24 deletions dCommon/dEnums/eServerDisconnectIdentifiers.h

This file was deleted.

7 changes: 5 additions & 2 deletions dGame/User.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#include "Logger.h"
#include "Game.h"
#include "dZoneManager.h"
#include "eServerDisconnectIdentifiers.h"
#include "eGameMasterLevel.h"
#include "BitStreamUtils.h"
#include "MessageType/Chat.h"
#include <chrono>
#include <ctime>
#include "CommonPackets.h"

User::User(const SystemAddress& sysAddr, const std::string& username, const std::string& sessionKey) {
m_AccountID = 0;
Expand Down Expand Up @@ -132,7 +132,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);
}
}

Expand Down
1 change: 0 additions & 1 deletion dGame/dUtilities/Mail.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ namespace Mail {

struct MailLUBitStream : public LUBitStream {
eMessageID messageID = eMessageID::UnknownError;
SystemAddress sysAddr = UNASSIGNED_SYSTEM_ADDRESS;
Entity* player = nullptr;

MailLUBitStream() = default;
Expand Down
13 changes: 9 additions & 4 deletions dGame/dUtilities/SlashCommands/GMGreaterThanZeroCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Classes
#include "Character.h"
#include "ChatPackets.h"
#include "CommonPackets.h"
#include "dServer.h"
#include "PlayerManager.h"
#include "User.h"
Expand All @@ -16,7 +17,6 @@

// Enums
#include "MessageType/Chat.h"
#include "eServerDisconnectIdentifiers.h"
#include "eObjectBits.h"

namespace GMGreaterThanZeroCommands {
Expand All @@ -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 {
Expand Down Expand Up @@ -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]));
Expand Down
Loading
Loading