mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
Make logger automatically put a newline (#675)
at the end of the line remove all the newlines in log calls
This commit is contained in:
@@ -27,23 +27,23 @@ void AuthPackets::HandleHandshake(dServer* server, Packet* packet) {
|
||||
uint64_t header = inStream.Read(header);
|
||||
uint32_t clientVersion = 0;
|
||||
inStream.Read(clientVersion);
|
||||
|
||||
server->GetLogger()->Log("AuthPackets", "Received client version: %i\n", clientVersion);
|
||||
|
||||
server->GetLogger()->Log("AuthPackets", "Received client version: %i", clientVersion);
|
||||
SendHandshake(server, packet->systemAddress, server->GetIP(), server->GetPort());
|
||||
}
|
||||
|
||||
void AuthPackets::SendHandshake(dServer* server, const SystemAddress& sysAddr, const std::string& nextServerIP, uint16_t nextServerPort) {
|
||||
RakNet::BitStream bitStream;
|
||||
PacketUtils::WriteHeader(bitStream, SERVER, MSG_SERVER_VERSION_CONFIRM);
|
||||
bitStream.Write<unsigned int>(NET_VERSION);
|
||||
bitStream.Write<unsigned int>(NET_VERSION);
|
||||
bitStream.Write(uint32_t(0x93));
|
||||
|
||||
|
||||
if (nextServerPort == 1001) bitStream.Write(uint32_t(1)); //Conn: auth
|
||||
else bitStream.Write(uint32_t(4)); //Conn: world
|
||||
|
||||
|
||||
bitStream.Write(uint32_t(0)); //Server process ID
|
||||
bitStream.Write(nextServerPort);
|
||||
|
||||
|
||||
server->Send(&bitStream, sysAddr, false);
|
||||
}
|
||||
|
||||
@@ -55,15 +55,15 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
// Fetch account details
|
||||
sql::PreparedStatement* stmt = Database::CreatePreppedStmt("SELECT password, banned, locked, play_key_id, gm_level FROM accounts WHERE name=? LIMIT 1;");
|
||||
stmt->setString(1, szUsername);
|
||||
|
||||
|
||||
sql::ResultSet* res = stmt->executeQuery();
|
||||
|
||||
|
||||
if (res->rowsCount() == 0) {
|
||||
server->GetLogger()->Log("AuthPackets", "No user found!\n");
|
||||
server->GetLogger()->Log("AuthPackets", "No user found!");
|
||||
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_WRONG_PASS_OR_USER, "", "", 2001, username);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
std::string sqlPass = "";
|
||||
bool sqlBanned = false;
|
||||
bool sqlLocked = false;
|
||||
@@ -77,7 +77,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
sqlPlayKey = res->getInt(4);
|
||||
sqlGmLevel = res->getInt(5);
|
||||
}
|
||||
|
||||
|
||||
delete stmt;
|
||||
delete res;
|
||||
|
||||
@@ -92,7 +92,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
//Check to see if we have a play key:
|
||||
if (sqlPlayKey == 0 && sqlGmLevel == 0) {
|
||||
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH, "Your account doesn't have a play key associated with it!", "", 2001, username);
|
||||
server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but they don't have a play key.\n", username.c_str());
|
||||
server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but they don't have a play key.", username.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
keyCheckStmt->setInt(1, sqlPlayKey);
|
||||
auto keyRes = keyCheckStmt->executeQuery();
|
||||
bool isKeyActive = false;
|
||||
|
||||
|
||||
if (keyRes->rowsCount() == 0 && sqlGmLevel == 0) {
|
||||
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH, "Your account doesn't have a play key associated with it!", "", 2001, username);
|
||||
return;
|
||||
@@ -113,13 +113,13 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
|
||||
if (!isKeyActive && sqlGmLevel == 0) {
|
||||
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH, "Your play key has been disabled.", "", 2001, username);
|
||||
server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but their play key was disabled\n", username.c_str());
|
||||
server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but their play key was disabled", username.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (sqlBanned) {
|
||||
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_BANNED, "", "", 2001, username); return;
|
||||
|
||||
if (sqlBanned) {
|
||||
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_BANNED, "", "", 2001, username); return;
|
||||
}
|
||||
|
||||
if (sqlLocked) {
|
||||
@@ -131,7 +131,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
* First attempt bcrypt.
|
||||
* If that fails, fallback to old method and setup bcrypt for new login.
|
||||
*/
|
||||
|
||||
|
||||
bool loginSuccess = true;
|
||||
|
||||
int32_t bcryptState = ::bcrypt_checkpw(password.c_str(), sqlPass.c_str());
|
||||
@@ -162,7 +162,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
assert(bcryptState == 0);
|
||||
|
||||
sql::PreparedStatement* accountUpdate = Database::CreatePreppedStmt("UPDATE accounts SET password = ? WHERE name = ? LIMIT 1;");
|
||||
|
||||
|
||||
accountUpdate->setString(1, std::string(hash, BCRYPT_HASHSIZE).c_str());
|
||||
accountUpdate->setString(2, szUsername);
|
||||
|
||||
@@ -176,7 +176,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
|
||||
if (!loginSuccess) {
|
||||
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_WRONG_PASS_OR_USER, "", "", 2001, username);
|
||||
server->GetLogger()->Log("AuthPackets", "Wrong password used\n");
|
||||
server->GetLogger()->Log("AuthPackets", "Wrong password used");
|
||||
}
|
||||
else {
|
||||
SystemAddress system = packet->systemAddress; //Copy the sysAddr before the Packet gets destroyed from main
|
||||
@@ -185,7 +185,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
AuthPackets::SendLoginResponse(server, system, LOGIN_RESPONSE_GENERAL_FAILED, "", "", 0, username);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ZoneInstanceManager::Instance()->RequestZoneTransfer(server, 0, 0, false, [system, server, username](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string zoneIP, uint16_t zonePort) {
|
||||
AuthPackets::SendLoginResponse(server, system, LOGIN_RESPONSE_SUCCESS, "", zoneIP, zonePort, username);
|
||||
});
|
||||
@@ -195,11 +195,11 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
|
||||
void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAddr, eLoginResponse responseCode, const std::string& errorMsg, const std::string& wServerIP, uint16_t wServerPort, std::string username) {
|
||||
RakNet::BitStream packet;
|
||||
PacketUtils::WriteHeader(packet, CLIENT, MSG_CLIENT_LOGIN_RESPONSE);
|
||||
|
||||
|
||||
packet.Write(static_cast<uint8_t>(responseCode));
|
||||
|
||||
|
||||
PacketUtils::WritePacketString("Talk_Like_A_Pirate", 33, &packet);
|
||||
|
||||
|
||||
// 7 unknown strings - perhaps other IP addresses?
|
||||
PacketUtils::WritePacketString("", 33, &packet);
|
||||
PacketUtils::WritePacketString("", 33, &packet);
|
||||
@@ -208,44 +208,44 @@ void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAdd
|
||||
PacketUtils::WritePacketString("", 33, &packet);
|
||||
PacketUtils::WritePacketString("", 33, &packet);
|
||||
PacketUtils::WritePacketString("", 33, &packet);
|
||||
|
||||
|
||||
packet.Write(static_cast<uint16_t>(1)); // Version Major
|
||||
packet.Write(static_cast<uint16_t>(10)); // Version Current
|
||||
packet.Write(static_cast<uint16_t>(64)); // Version Minor
|
||||
|
||||
|
||||
// Writes the user key
|
||||
uint32_t sessionKey = rand(); // not mt but whatever
|
||||
std::string userHash = std::to_string(sessionKey);
|
||||
userHash = md5(userHash);
|
||||
PacketUtils::WritePacketWString(userHash, 33, &packet);
|
||||
|
||||
|
||||
// Write the Character and Chat IPs
|
||||
PacketUtils::WritePacketString(wServerIP, 33, &packet);
|
||||
PacketUtils::WritePacketString("", 33, &packet);
|
||||
|
||||
|
||||
// Write the Character and Chat Ports
|
||||
packet.Write(static_cast<uint16_t>(wServerPort));
|
||||
packet.Write(static_cast<uint16_t>(0));
|
||||
|
||||
|
||||
// Write another IP
|
||||
PacketUtils::WritePacketString("", 33, &packet);
|
||||
|
||||
|
||||
// Write a GUID or something...
|
||||
PacketUtils::WritePacketString("00000000-0000-0000-0000-000000000000", 37, &packet);
|
||||
|
||||
|
||||
packet.Write(static_cast<uint32_t>(0)); // ???
|
||||
|
||||
|
||||
// Write the localization
|
||||
PacketUtils::WritePacketString("US", 3, &packet);
|
||||
|
||||
|
||||
packet.Write(static_cast<uint8_t>(false)); // User first logged in?
|
||||
packet.Write(static_cast<uint8_t>(false)); // User is F2P?
|
||||
packet.Write(static_cast<uint64_t>(0)); // ???
|
||||
|
||||
|
||||
// Write custom error message
|
||||
packet.Write(static_cast<uint16_t>(errorMsg.length()));
|
||||
PacketUtils::WritePacketWString(errorMsg, static_cast<uint32_t>(errorMsg.length()), &packet);
|
||||
|
||||
|
||||
// Here write auth logs
|
||||
packet.Write(static_cast<uint32_t>(20));
|
||||
for (uint32_t i = 0; i < 20; ++i) {
|
||||
@@ -254,7 +254,7 @@ void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAdd
|
||||
packet.Write(static_cast<uint32_t>(14000));
|
||||
packet.Write(static_cast<uint32_t>(0));
|
||||
}
|
||||
|
||||
|
||||
server->Send(&packet, sysAddr, false);
|
||||
|
||||
//Inform the master server that we've created a session for this user:
|
||||
@@ -265,6 +265,6 @@ void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAdd
|
||||
PacketUtils::WriteString(bitStream, username, 66);
|
||||
server->SendToMaster(&bitStream);
|
||||
|
||||
server->GetLogger()->Log("AuthPackets", "Set sessionKey: %i for user %s\n", sessionKey, username.c_str());
|
||||
server->GetLogger()->Log("AuthPackets", "Set sessionKey: %i for user %s", sessionKey, username.c_str());
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@
|
||||
void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* packet) {
|
||||
User* user = UserManager::Instance()->GetUser(sysAddr);
|
||||
if (!user) {
|
||||
Game::logger->Log("ClientPackets", "Unable to get user to parse chat message\n");
|
||||
Game::logger->Log("ClientPackets", "Unable to get user to parse chat message");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,14 +71,14 @@ void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* pack
|
||||
if (!user->GetLastChatMessageApproved() && !isMythran) return;
|
||||
|
||||
std::string sMessage = GeneralUtils::UTF16ToWTF8(message);
|
||||
Game::logger->Log("Chat", "%s: %s\n", playerName.c_str(), sMessage.c_str());
|
||||
Game::logger->Log("Chat", "%s: %s", playerName.c_str(), sMessage.c_str());
|
||||
ChatPackets::SendChatMessage(sysAddr, chatChannel, playerName, user->GetLoggedInChar(), isMythran, message);
|
||||
}
|
||||
|
||||
void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Packet* packet) {
|
||||
User* user = UserManager::Instance()->GetUser(sysAddr);
|
||||
if (!user) {
|
||||
Game::logger->Log("ClientPackets", "Unable to get user to parse position update\n");
|
||||
Game::logger->Log("ClientPackets", "Unable to get user to parse position update");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -240,14 +240,14 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
|
||||
void ClientPackets::HandleChatModerationRequest(const SystemAddress& sysAddr, Packet* packet) {
|
||||
User* user = UserManager::Instance()->GetUser(sysAddr);
|
||||
if (!user) {
|
||||
Game::logger->Log("ClientPackets", "Unable to get user to parse chat moderation request\n");
|
||||
Game::logger->Log("ClientPackets", "Unable to get user to parse chat moderation request");
|
||||
return;
|
||||
}
|
||||
|
||||
auto* entity = Player::GetPlayer(sysAddr);
|
||||
|
||||
if (entity == nullptr) {
|
||||
Game::logger->Log("ClientPackets", "Unable to get player to parse chat moderation request\n");
|
||||
Game::logger->Log("ClientPackets", "Unable to get player to parse chat moderation request");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
void WorldPackets::SendLoadStaticZone(const SystemAddress& sysAddr, float x, float y, float z, uint32_t checksum) {
|
||||
RakNet::BitStream bitStream;
|
||||
PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_LOAD_STATIC_ZONE);
|
||||
|
||||
|
||||
auto zone = dZoneManager::Instance()->GetZone()->GetZoneID();
|
||||
bitStream.Write(static_cast<uint16_t>(zone.GetMapID()));
|
||||
bitStream.Write(static_cast<uint16_t>(zone.GetInstanceID()));
|
||||
@@ -33,7 +33,7 @@ void WorldPackets::SendLoadStaticZone(const SystemAddress& sysAddr, float x, flo
|
||||
bitStream.Write(z);
|
||||
|
||||
bitStream.Write(static_cast<uint32_t>(0)); // Change this to eventually use 4 on activity worlds
|
||||
|
||||
|
||||
SEND_PACKET
|
||||
}
|
||||
|
||||
@@ -42,23 +42,23 @@ void WorldPackets::SendCharacterList ( const SystemAddress& sysAddr, User* user
|
||||
|
||||
RakNet::BitStream bitStream;
|
||||
PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_CHARACTER_LIST_RESPONSE);
|
||||
|
||||
|
||||
std::vector<Character*> characters = user->GetCharacters();
|
||||
bitStream.Write(static_cast<uint8_t>(characters.size()));
|
||||
bitStream.Write(static_cast<uint8_t>(0)); //character index in front, just picking 0
|
||||
|
||||
|
||||
for (uint32_t i = 0; i < characters.size(); ++i) {
|
||||
bitStream.Write(characters[i]->GetObjectID());
|
||||
bitStream.Write(static_cast<uint32_t>(0));
|
||||
|
||||
|
||||
PacketUtils::WriteWString(bitStream, characters[i]->GetName(), 33);
|
||||
PacketUtils::WriteWString(bitStream, characters[i]->GetUnapprovedName(), 33);
|
||||
|
||||
|
||||
bitStream.Write(static_cast<uint8_t>(characters[i]->GetNameRejected()));
|
||||
bitStream.Write(static_cast<uint8_t>(false));
|
||||
|
||||
|
||||
PacketUtils::WriteString(bitStream, "", 10);
|
||||
|
||||
|
||||
bitStream.Write(characters[i]->GetShirtColor());
|
||||
bitStream.Write(characters[i]->GetShirtStyle());
|
||||
bitStream.Write(characters[i]->GetPantsColor());
|
||||
@@ -79,12 +79,12 @@ void WorldPackets::SendCharacterList ( const SystemAddress& sysAddr, User* user
|
||||
|
||||
const auto& equippedItems = characters[i]->GetEquippedItems();
|
||||
bitStream.Write(static_cast<uint16_t>(equippedItems.size()));
|
||||
|
||||
|
||||
for (uint32_t j = 0; j < equippedItems.size(); ++j) {
|
||||
bitStream.Write(equippedItems[j]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SEND_PACKET
|
||||
}
|
||||
|
||||
@@ -112,11 +112,11 @@ void WorldPackets::SendCharacterDeleteResponse(const SystemAddress& sysAddr, boo
|
||||
void WorldPackets::SendTransferToWorld ( const SystemAddress& sysAddr, const std::string& serverIP, uint32_t serverPort, bool mythranShift ) {
|
||||
RakNet::BitStream bitStream;
|
||||
PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_TRANSFER_TO_WORLD);
|
||||
|
||||
|
||||
PacketUtils::WriteString(bitStream, serverIP, 33);
|
||||
bitStream.Write(static_cast<uint16_t>(serverPort));
|
||||
bitStream.Write(static_cast<uint8_t>(mythranShift));
|
||||
|
||||
|
||||
SEND_PACKET
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ void WorldPackets::SendServerState ( const SystemAddress& sysAddr ) {
|
||||
void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, Entity* entity, const std::string& xmlData, const std::u16string& username, int32_t gm) {
|
||||
RakNet::BitStream bitStream;
|
||||
PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_CREATE_CHARACTER);
|
||||
|
||||
|
||||
RakNet::BitStream data;
|
||||
data.Write<uint32_t>(7); //LDF key count
|
||||
|
||||
@@ -155,7 +155,7 @@ void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, Entity* ent
|
||||
chatmode->WriteToPacket(&data);
|
||||
xmlConfigData->WriteToPacket(&data);
|
||||
reputation->WriteToPacket(&data);
|
||||
|
||||
|
||||
delete objid;
|
||||
delete lot;
|
||||
delete xmlConfigData;
|
||||
@@ -168,7 +168,7 @@ void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, Entity* ent
|
||||
bitStream.Write<uint32_t>(data.GetNumberOfBytesUsed() + 1);
|
||||
bitStream.Write<uint8_t>(0);
|
||||
bitStream.Write((char*)data.GetData(), data.GetNumberOfBytesUsed());
|
||||
#else
|
||||
#else
|
||||
//Compress the data before sending:
|
||||
const int reservedSize = 5 * 1024 * 1024;
|
||||
uint8_t compressedData[reservedSize];
|
||||
@@ -185,7 +185,7 @@ void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, Entity* ent
|
||||
|
||||
PacketUtils::SavePacket("chardata.bin", (const char *)bitStream.GetData(), static_cast<uint32_t>(bitStream.GetNumberOfBytesUsed()));
|
||||
SEND_PACKET
|
||||
Game::logger->Log("WorldPackets", "Sent CreateCharacter for ID: %llu\n", entity->GetObjectID());
|
||||
Game::logger->Log("WorldPackets", "Sent CreateCharacter for ID: %llu", entity->GetObjectID());
|
||||
}
|
||||
|
||||
void WorldPackets::SendChatModerationResponse(const SystemAddress& sysAddr, bool requestAccepted, uint32_t requestID, const std::string& receiver, std::vector<std::pair<uint8_t, uint8_t>> unacceptedItems) {
|
||||
@@ -215,11 +215,11 @@ void WorldPackets::SendChatModerationResponse(const SystemAddress& sysAddr, bool
|
||||
void WorldPackets::SendGMLevelChange(const SystemAddress& sysAddr, bool success, uint8_t highestLevel, uint8_t prevLevel, uint8_t newLevel) {
|
||||
CBITSTREAM
|
||||
PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_MAKE_GM_RESPONSE);
|
||||
|
||||
|
||||
bitStream.Write<uint8_t>(success);
|
||||
bitStream.Write<uint16_t>(highestLevel);
|
||||
bitStream.Write<uint16_t>(prevLevel);
|
||||
bitStream.Write<uint16_t>(newLevel);
|
||||
|
||||
|
||||
SEND_PACKET
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
//! Replica Constructor class
|
||||
class ReplicaConstructor : public ReceiveConstructionInterface {
|
||||
public:
|
||||
public:
|
||||
ReplicaReturnResult ReceiveConstruction(RakNet::BitStream *inBitStream, RakNetTime timestamp, NetworkID networkID, NetworkIDObject *existingObject, SystemAddress senderId, ReplicaManager *caller) {
|
||||
return REPLICA_PROCESSING_DONE;
|
||||
}
|
||||
@@ -60,11 +60,11 @@ dServer::dServer(const std::string& ip, int port, int instanceID, int maxConnect
|
||||
|
||||
if (mIsOkay) {
|
||||
if (zoneID == 0)
|
||||
mLogger->Log("dServer", "Server is listening on %s:%i with encryption: %i\n", ip.c_str(), port, int(useEncryption));
|
||||
mLogger->Log("dServer", "Server is listening on %s:%i with encryption: %i", ip.c_str(), port, int(useEncryption));
|
||||
else
|
||||
mLogger->Log("dServer", "Server is listening on %s:%i with encryption: %i, running zone %i / %i\n", ip.c_str(), port, int(useEncryption), zoneID, instanceID);
|
||||
mLogger->Log("dServer", "Server is listening on %s:%i with encryption: %i, running zone %i / %i", ip.c_str(), port, int(useEncryption), zoneID, instanceID);
|
||||
}
|
||||
else { mLogger->Log("dServer", "FAILED TO START SERVER ON IP/PORT: %s:%i\n", ip.c_str(), port); return; }
|
||||
else { mLogger->Log("dServer", "FAILED TO START SERVER ON IP/PORT: %s:%i", ip.c_str(), port); return; }
|
||||
|
||||
mLogger->SetLogToConsole(prevLogSetting);
|
||||
|
||||
@@ -104,13 +104,13 @@ Packet* dServer::ReceiveFromMaster() {
|
||||
if (packet->length < 1) { mMasterPeer->DeallocatePacket(packet); return nullptr; }
|
||||
|
||||
if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION || packet->data[0] == ID_CONNECTION_LOST) {
|
||||
mLogger->Log("dServer", "Lost our connection to master, shutting DOWN!\n");
|
||||
mLogger->Log("dServer", "Lost our connection to master, shutting DOWN!");
|
||||
mMasterConnectionActive = false;
|
||||
//ConnectToMaster(); //We'll just shut down now
|
||||
}
|
||||
|
||||
|
||||
if (packet->data[0] == ID_CONNECTION_REQUEST_ACCEPTED) {
|
||||
mLogger->Log("dServer", "Established connection to master, zone (%i), instance (%i)\n",this->GetZoneID(), this->GetInstanceID());
|
||||
mLogger->Log("dServer", "Established connection to master, zone (%i), instance (%i)",this->GetZoneID(), this->GetInstanceID());
|
||||
mMasterConnectionActive = true;
|
||||
mMasterSystemAddress = packet->systemAddress;
|
||||
MasterPackets::SendServerInfo(this, packet);
|
||||
|
Reference in New Issue
Block a user