mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-21 21:17:25 +00:00
it compiles
This commit is contained in:
parent
5d85b9ec2d
commit
93d0186a25
@ -4,6 +4,7 @@
|
||||
#include "BitStream.h"
|
||||
|
||||
struct PlayerData;
|
||||
struct TeamData;
|
||||
|
||||
enum class eAddFriendResponseType : uint8_t;
|
||||
|
||||
|
@ -187,6 +187,7 @@ void HandlePacket(Packet* packet) {
|
||||
LOG("A server is connecting, awaiting user list.");
|
||||
}
|
||||
if (packet->length < 4) return; // Nothing left to process. Need 4 bytes to continue.
|
||||
|
||||
CINSTREAM;
|
||||
inStream.SetReadOffset(BYTES_TO_BITS(1));
|
||||
|
||||
@ -199,12 +200,10 @@ void HandlePacket(Packet* packet) {
|
||||
|
||||
switch (chatMessageID) {
|
||||
case eChatMessageType::GM_MUTE:
|
||||
// verif internal
|
||||
Game::playerContainer.MuteUpdate(packet);
|
||||
break;
|
||||
|
||||
case eChatMessageType::CREATE_TEAM:
|
||||
// verif internal
|
||||
Game::playerContainer.CreateTeamServer(packet);
|
||||
break;
|
||||
case eChatMessageType::GET_FRIENDS_LIST:
|
||||
@ -277,30 +276,24 @@ void HandlePacket(Packet* packet) {
|
||||
ChatPacketHandler::HandleTeamLootOption(packet);
|
||||
break;
|
||||
case eChatMessageType::GMLEVEL_UPDATE:
|
||||
// verify internal
|
||||
ChatPacketHandler::HandleGMLevelUpdate(packet);
|
||||
break;
|
||||
case eChatMessageType::WHO:
|
||||
// verify internal
|
||||
ChatPacketHandler::HandleWho(packet);
|
||||
break;
|
||||
case eChatMessageType::SHOW_ALL:
|
||||
// verify internal
|
||||
ChatPacketHandler::HandleShowAll(packet);
|
||||
break;
|
||||
case eChatMessageType::LOGIN_SESSION_NOTIFY:
|
||||
// verify internal
|
||||
Game::playerContainer.InsertPlayer(packet);
|
||||
break;
|
||||
case eChatMessageType::GM_ANNOUNCE:{
|
||||
// verify internal
|
||||
//we just forward this packet to every connected server
|
||||
CINSTREAM;
|
||||
Game::server->Send(&inStream, packet->systemAddress, true); //send to everyone except origin
|
||||
Game::server->Send(inStream, packet->systemAddress, true); //send to everyone except origin
|
||||
}
|
||||
break;
|
||||
case eChatMessageType::UNEXPECTED_DISCONNECT:
|
||||
// verify internal
|
||||
Game::playerContainer.RemovePlayer(packet);
|
||||
break;
|
||||
case eChatMessageType::USER_CHANNEL_CHAT_MESSAGE:
|
||||
@ -346,14 +339,13 @@ void HandlePacket(Packet* packet) {
|
||||
case eChatMessageType::PRG_CSR_COMMAND:
|
||||
case eChatMessageType::HEARTBEAT_REQUEST_FROM_WORLD:
|
||||
case eChatMessageType::UPDATE_FREE_TRIAL_STATUS:
|
||||
LOG("Unhandled CHAT Message id: %s (%i)", StringifiedEnum::ToString(chat_message_type).data(), chat_message_type);
|
||||
LOG("Unhandled CHAT Message id: %s (%i)", StringifiedEnum::ToString(chatMessageID).data(), chatMessageID);
|
||||
break;
|
||||
default:
|
||||
LOG("Unknown CHAT Message id: %i", chat_message_type);
|
||||
}
|
||||
LOG("Unknown CHAT Message id: %i", chatMessageID);
|
||||
}
|
||||
|
||||
if (static_cast<eConnectionType>(packet->data[1]) == eConnectionType::WORLD) {
|
||||
if (connection == eConnectionType::WORLD) {
|
||||
switch (static_cast<eWorldMessageType>(packet->data[3])) {
|
||||
case eWorldMessageType::ROUTE_PACKET: {
|
||||
LOG("Routing packet from world");
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "eGameMasterLevel.h"
|
||||
#include "ChatPackets.h"
|
||||
#include "dConfig.h"
|
||||
#include "eChatMessageType.h"
|
||||
|
||||
void PlayerContainer::Initialize() {
|
||||
m_MaxNumberOfBestFriends =
|
||||
|
@ -74,6 +74,7 @@ enum class eChatMessageType :uint32_t {
|
||||
HEARTBEAT_REQUEST_FROM_WORLD,
|
||||
UPDATE_FREE_TRIAL_STATUS,
|
||||
// CUSTOM DLU MESSAGE ID FOR INTERNAL USE
|
||||
CREATE_TEAM,
|
||||
};
|
||||
|
||||
#endif //!__ECHATMESSAGETYPE__H__
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eMatchUpdate.h"
|
||||
#include "eConnectionType.h"
|
||||
#include "eChatMessageType.h"
|
||||
|
||||
#include "CDCurrencyTableTable.h"
|
||||
#include "CDActivityRewardsTable.h"
|
||||
|
@ -820,7 +820,7 @@ void HandlePacket(Packet* packet) {
|
||||
|
||||
{
|
||||
CBITSTREAM;
|
||||
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT_INTERNAL, eChatMessageType::PLAYER_REMOVED_NOTIFICATION);
|
||||
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT_INTERNAL, eChatMessageType::UNEXPECTED_DISCONNECT);
|
||||
bitStream.Write(user->GetLoggedInChar());
|
||||
Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false);
|
||||
}
|
||||
@ -989,7 +989,7 @@ void HandlePacket(Packet* packet) {
|
||||
// This means we swapped characters and we need to remove the previous player from the container.
|
||||
if (static_cast<uint32_t>(lastCharacter) != playerID) {
|
||||
CBITSTREAM;
|
||||
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT_INTERNAL, eChatMessageType::PLAYER_REMOVED_NOTIFICATION);
|
||||
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT_INTERNAL, eChatMessageType::UNEXPECTED_DISCONNECT);
|
||||
bitStream.Write(lastCharacter);
|
||||
Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false);
|
||||
}
|
||||
@ -1135,7 +1135,7 @@ void HandlePacket(Packet* packet) {
|
||||
const auto& playerName = character->GetName();
|
||||
|
||||
CBITSTREAM;
|
||||
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT_INTERNAL, eChatMessageType::PLAYER_ADDED_NOTIFICATION);
|
||||
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT_INTERNAL, eChatMessageType::LOGIN_SESSION_NOTIFY);
|
||||
bitStream.Write(player->GetObjectID());
|
||||
bitStream.Write<uint32_t>(playerName.size());
|
||||
for (size_t i = 0; i < playerName.size(); i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user