more conversion, 100% gurantee there will be errors here until i fix

This commit is contained in:
DarthArgus
2016-09-30 15:39:01 -05:00
parent 0c09c87640
commit 0a9357271d
6 changed files with 920 additions and 952 deletions
@@ -29,6 +29,9 @@
#include "sharedNetworkMessages/GenericValueTypeMessage.h"
#include "sharedLog/Log.h"
#include "sharedLog/SetupSharedLog.h"
#include "sharedFoundation/CrcConstexpr.hpp"
#include <stdio.h>
//-----------------------------------------------------------------------
@@ -68,7 +71,9 @@ CommodityServer::~CommodityServer()
void CommodityServer::receiveMessage(const MessageDispatch::Emitter & source, const MessageDispatch::MessageBase & message)
{
if(message.isType("CommoditiesLoadDone"))
const uint32 messageType = message.getType();
if(messageType == constcrc("CommoditiesLoadDone"))
{
m_commoditiesServerLoadDone = 1;
@@ -76,7 +81,7 @@ void CommodityServer::receiveMessage(const MessageDispatch::Emitter & source, co
if (m_commoditiesServerLoadTime == -1)
m_commoditiesServerLoadTime = (time(0) - m_timeCommoditiesServerStarted) / 60;
}
else if (message.isType("DatabaseServerConnectionClosed"))
else if (messageType == constcrc("DatabaseServerConnectionClosed"))
{
WARNING(true, ("[Commodities Server] : No connection to the database server. Shutting down.\n"));
exit(0);
@@ -21,6 +21,8 @@
#include "serverNetworkMessages/GetMarketAuctionBidsMessage.h"
#include "UnicodeUtils.h"
#include "sharedFoundation/CrcConstexpr.hpp"
//-----------------------------------------------------------------------
DatabaseServerConnection::DatabaseServerConnection(const std::string & a, const unsigned short p) :
@@ -65,151 +67,161 @@ void DatabaseServerConnection::onReceive(const Archive::ByteStream & message)
Archive::ReadIterator ri = message.begin();
GameNetworkMessage msg(ri);
ri = message.begin();
const uint32 messageType = msg.getType();
if (msg.isType("CommoditiesLoadDone"))
{
if (currentLocationCount != lastLocationCount)
switch(messageType) {
case constcrc("CommoditiesLoadDone") :
{
DEBUG_REPORT_LOG(true, (" -- %d AuctionLocations record received\n", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received\n", currentLocationCount));
lastLocationCount = currentLocationCount;
}
if (currentAuctionCount != lastAuctionCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctions record received\n", currentAuctionCount));
LOG("CommoditiesServer", ("%d MarketAuctions record received\n", currentAuctionCount));
lastAuctionCount = currentAuctionCount;
}
if (currentAuctionAttributeCount != lastAuctionAttributeCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctionAttributes record received\n", currentAuctionAttributeCount));
LOG("CommoditiesServer", ("%d MarketAuctionAttributes record received\n", currentAuctionAttributeCount));
lastAuctionAttributeCount = currentAuctionAttributeCount;
}
if (currentBidCount != lastBidCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctionBids record received\n", currentBidCount));
LOG("CommoditiesServer", ("%d MarketAuctionBids record received", currentBidCount));
lastBidCount = currentBidCount;
}
REPORT_LOG("DatabaseServerConnection", ("CommoditiesLoadDone Message received on connection with the database server\n"));
CommoditiesLoadDoneMessage m(ri);
REPORT_LOG("DatabaseServerConnection", ("%d rows received on Auction_Locations\n", m.getAuctionLocationsCount()));
REPORT_LOG("DatabaseServerConnection", ("%d rows received on Market_Auctions\n", m.getMarketAuctionsCount()));
REPORT_LOG("DatabaseServerConnection", ("%d rows received on Market_Auction_Attributes\n", m.getMarketAuctionAttributesCount()));
REPORT_LOG("DatabaseServerConnection", ("%d rows received on Market_Auction_Bids\n", m.getMarketAuctionBidsCount()));
LOG("CommoditiesServer", ("CommoditiesLoadDone Message received, %d rows Auction_Locations, %d rows Market_Auctions, %d rows Market_Auction_Attributes, %d rows Market_Auction_Bids", m.getAuctionLocationsCount(), m.getMarketAuctionsCount(), m.getMarketAuctionAttributesCount(), m.getMarketAuctionBidsCount()));
LOG("CommoditiesServer", ("Start build index for attribute search"));
AuctionMarket::getInstance().BuildAuctionsSearchableAttributeList();
LOG("CommoditiesServer", ("End build index for attribute search"));
emitMessage(m);
}
else if (msg.isType("GetAuctionLocationsMessage"))
{
GetAuctionLocationsMessage m(ri);
const std::list<GetAuctionLocationsMessage::AuctionLocation> & auctionLocations = m.getAuctionLocations();
for (std::list<GetAuctionLocationsMessage::AuctionLocation>::const_iterator iter = auctionLocations.begin(); iter != auctionLocations.end(); ++iter)
{
AuctionMarket::getInstance().onReceiveAuctionLocations(iter->locationId, iter->locationName, iter->ownerId, iter->salesTax, iter->salesTaxBankId, iter->emptyDate, iter->lastAccessDate, iter->inactiveDate, iter->status, iter->searchEnabled, iter->entranceCharge);
currentLocationCount++;
if (currentLocationCount - lastLocationCount >= 1000)
if (currentLocationCount != lastLocationCount)
{
DEBUG_REPORT_LOG(true, (" -- %d AuctionLocations record received\n", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received\n", currentLocationCount));
lastLocationCount = currentLocationCount;
}
}
}
else if (msg.isType("GetMarketAuctionsMessage"))
{
if (currentLocationCount != lastLocationCount)
{
DEBUG_REPORT_LOG(true, (" -- %d AuctionLocations record received\n", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received\n", currentLocationCount));
lastLocationCount = currentLocationCount;
}
GetMarketAuctionsMessage m(ri);
const std::list<GetMarketAuctionsMessage::MarketAuction> & auctions = m.getAuctions();
for (std::list<GetMarketAuctionsMessage::MarketAuction>::const_iterator iter = auctions.begin(); iter != auctions.end(); ++iter)
{
AuctionMarket::getInstance().onReceiveMarketAuctions(iter->itemId, iter->ownerId, iter->creatorId, iter->locationId, iter->minBid, iter->buyNowPrice, iter->auctionTimer, iter->oob, iter->userDescription, iter->category, iter->itemTemplateId, iter->itemName, iter->itemTimer, iter->active, iter->itemSize);
currentAuctionCount++;
if (currentAuctionCount - lastAuctionCount >= 10000)
if (currentAuctionCount != lastAuctionCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctions record received\n", currentAuctionCount));
LOG("CommoditiesServer", ("%d MarketAuctions record received", currentAuctionCount));
LOG("CommoditiesServer", ("%d MarketAuctions record received\n", currentAuctionCount));
lastAuctionCount = currentAuctionCount;
}
}
}
else if (msg.isType("GetMarketAuctionAttributesMessage"))
{
if (currentLocationCount != lastLocationCount)
{
DEBUG_REPORT_LOG(true, (" -- %d AuctionLocations record received\n", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received\n", currentLocationCount));
lastLocationCount = currentLocationCount;
}
if (currentAuctionCount != lastAuctionCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctions record received\n", currentAuctionCount));
LOG("CommoditiesServer", ("%d MarketAuctions record received\n", currentAuctionCount));
lastAuctionCount = currentAuctionCount;
}
GetMarketAuctionAttributesMessage m(ri);
const std::list<GetMarketAuctionAttributesMessage::MarketAuctionAttribute> & attributes = m.getAttributes();
for (std::list<GetMarketAuctionAttributesMessage::MarketAuctionAttribute>::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter)
{
AuctionMarket::getInstance().onReceiveMarketAuctionAttributes(iter->itemId, iter->attributeName, iter->attributeValue);
currentAuctionAttributeCount++;
if (currentAuctionAttributeCount - lastAuctionAttributeCount >= 10000)
if (currentAuctionAttributeCount != lastAuctionAttributeCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctionAttributes record received\n", currentAuctionAttributeCount));
LOG("CommoditiesServer", ("%d MarketAuctionAttributes record received", currentAuctionAttributeCount));
LOG("CommoditiesServer", ("%d MarketAuctionAttributes record received\n", currentAuctionAttributeCount));
lastAuctionAttributeCount = currentAuctionAttributeCount;
}
}
}
else if (msg.isType("GetMarketAuctionBidsMessage"))
{
if (currentLocationCount != lastLocationCount)
{
DEBUG_REPORT_LOG(true, (" -- %d AuctionLocations record received\n", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received\n", currentLocationCount));
lastLocationCount = currentLocationCount;
}
if (currentAuctionCount != lastAuctionCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctions record received\n", currentAuctionCount));
LOG("CommoditiesServer", ("%d MarketAuctions record received\n", currentAuctionCount));
lastAuctionCount = currentAuctionCount;
}
if (currentAuctionAttributeCount != lastAuctionAttributeCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctionAttributes record received\n", currentAuctionAttributeCount));
LOG("CommoditiesServer", ("%d MarketAuctionAttributes record received\n", currentAuctionAttributeCount));
lastAuctionAttributeCount = currentAuctionAttributeCount;
}
GetMarketAuctionBidsMessage m(ri);
const std::list<GetMarketAuctionBidsMessage::MarketAuctionBid> & bids = m.getMarketAuctionBids();
for (std::list<GetMarketAuctionBidsMessage::MarketAuctionBid>::const_iterator iter = bids.begin(); iter != bids.end(); ++iter)
{
AuctionMarket::getInstance().onReceiveMarketAuctionBids(iter->itemId, iter->bidderId, iter->bid, iter->maxProxyBid);
currentBidCount++;
if (currentBidCount - lastBidCount >= 1000)
if (currentBidCount != lastBidCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctionBids record received\n", currentBidCount));
LOG("CommoditiesServer", ("%d MarketAuctionBids record received\n", currentBidCount));
LOG("CommoditiesServer", ("%d MarketAuctionBids record received", currentBidCount));
lastBidCount = currentBidCount;
}
REPORT_LOG("DatabaseServerConnection", ("CommoditiesLoadDone Message received on connection with the database server\n"));
CommoditiesLoadDoneMessage m(ri);
REPORT_LOG("DatabaseServerConnection", ("%d rows received on Auction_Locations\n", m.getAuctionLocationsCount()));
REPORT_LOG("DatabaseServerConnection", ("%d rows received on Market_Auctions\n", m.getMarketAuctionsCount()));
REPORT_LOG("DatabaseServerConnection", ("%d rows received on Market_Auction_Attributes\n", m.getMarketAuctionAttributesCount()));
REPORT_LOG("DatabaseServerConnection", ("%d rows received on Market_Auction_Bids\n", m.getMarketAuctionBidsCount()));
LOG("CommoditiesServer", ("CommoditiesLoadDone Message received, %d rows Auction_Locations, %d rows Market_Auctions, %d rows Market_Auction_Attributes, %d rows Market_Auction_Bids", m.getAuctionLocationsCount(), m.getMarketAuctionsCount(), m.getMarketAuctionAttributesCount(), m.getMarketAuctionBidsCount()));
LOG("CommoditiesServer", ("Start build index for attribute search"));
AuctionMarket::getInstance().BuildAuctionsSearchableAttributeList();
LOG("CommoditiesServer", ("End build index for attribute search"));
emitMessage(m);
break;
}
case constcrc("GetAuctionLocationsMessage") :
{
GetAuctionLocationsMessage m(ri);
const std::list<GetAuctionLocationsMessage::AuctionLocation> & auctionLocations = m.getAuctionLocations();
for (std::list<GetAuctionLocationsMessage::AuctionLocation>::const_iterator iter = auctionLocations.begin(); iter != auctionLocations.end(); ++iter)
{
AuctionMarket::getInstance().onReceiveAuctionLocations(iter->locationId, iter->locationName, iter->ownerId, iter->salesTax, iter->salesTaxBankId, iter->emptyDate, iter->lastAccessDate, iter->inactiveDate, iter->status, iter->searchEnabled, iter->entranceCharge);
currentLocationCount++;
if (currentLocationCount - lastLocationCount >= 1000)
{
DEBUG_REPORT_LOG(true, (" -- %d AuctionLocations record received\n", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received", currentLocationCount));
lastLocationCount = currentLocationCount;
}
}
break;
}
case constcrc("GetMarketAuctionsMessage") :
{
if (currentLocationCount != lastLocationCount)
{
DEBUG_REPORT_LOG(true, (" -- %d AuctionLocations record received\n", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received\n", currentLocationCount));
lastLocationCount = currentLocationCount;
}
GetMarketAuctionsMessage m(ri);
const std::list<GetMarketAuctionsMessage::MarketAuction> & auctions = m.getAuctions();
for (std::list<GetMarketAuctionsMessage::MarketAuction>::const_iterator iter = auctions.begin(); iter != auctions.end(); ++iter)
{
AuctionMarket::getInstance().onReceiveMarketAuctions(iter->itemId, iter->ownerId, iter->creatorId, iter->locationId, iter->minBid, iter->buyNowPrice, iter->auctionTimer, iter->oob, iter->userDescription, iter->category, iter->itemTemplateId, iter->itemName, iter->itemTimer, iter->active, iter->itemSize);
currentAuctionCount++;
if (currentAuctionCount - lastAuctionCount >= 10000)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctions record received\n", currentAuctionCount));
LOG("CommoditiesServer", ("%d MarketAuctions record received", currentAuctionCount));
lastAuctionCount = currentAuctionCount;
}
}
break;
}
case constcrc("GetMarketAuctionAttributesMessage") :
{
if (currentLocationCount != lastLocationCount)
{
DEBUG_REPORT_LOG(true, (" -- %d AuctionLocations record received\n", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received\n", currentLocationCount));
lastLocationCount = currentLocationCount;
}
if (currentAuctionCount != lastAuctionCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctions record received\n", currentAuctionCount));
LOG("CommoditiesServer", ("%d MarketAuctions record received\n", currentAuctionCount));
lastAuctionCount = currentAuctionCount;
}
GetMarketAuctionAttributesMessage m(ri);
const std::list<GetMarketAuctionAttributesMessage::MarketAuctionAttribute> & attributes = m.getAttributes();
for (std::list<GetMarketAuctionAttributesMessage::MarketAuctionAttribute>::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter)
{
AuctionMarket::getInstance().onReceiveMarketAuctionAttributes(iter->itemId, iter->attributeName, iter->attributeValue);
currentAuctionAttributeCount++;
if (currentAuctionAttributeCount - lastAuctionAttributeCount >= 10000)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctionAttributes record received\n", currentAuctionAttributeCount));
LOG("CommoditiesServer", ("%d MarketAuctionAttributes record received", currentAuctionAttributeCount));
lastAuctionAttributeCount = currentAuctionAttributeCount;
}
}
break;
}
case constcrc("GetMarketAuctionBidsMessage") :
{
if (currentLocationCount != lastLocationCount)
{
DEBUG_REPORT_LOG(true, (" -- %d AuctionLocations record received\n", currentLocationCount));
LOG("CommoditiesServer", ("%d AuctionLocations record received\n", currentLocationCount));
lastLocationCount = currentLocationCount;
}
if (currentAuctionCount != lastAuctionCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctions record received\n", currentAuctionCount));
LOG("CommoditiesServer", ("%d MarketAuctions record received\n", currentAuctionCount));
lastAuctionCount = currentAuctionCount;
}
if (currentAuctionAttributeCount != lastAuctionAttributeCount)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctionAttributes record received\n", currentAuctionAttributeCount));
LOG("CommoditiesServer", ("%d MarketAuctionAttributes record received\n", currentAuctionAttributeCount));
lastAuctionAttributeCount = currentAuctionAttributeCount;
}
GetMarketAuctionBidsMessage m(ri);
const std::list<GetMarketAuctionBidsMessage::MarketAuctionBid> & bids = m.getMarketAuctionBids();
for (std::list<GetMarketAuctionBidsMessage::MarketAuctionBid>::const_iterator iter = bids.begin(); iter != bids.end(); ++iter)
{
AuctionMarket::getInstance().onReceiveMarketAuctionBids(iter->itemId, iter->bidderId, iter->bid, iter->maxProxyBid);
currentBidCount++;
if (currentBidCount - lastBidCount >= 1000)
{
DEBUG_REPORT_LOG(true, (" -- %d MarketAuctionBids record received\n", currentBidCount));
LOG("CommoditiesServer", ("%d MarketAuctionBids record received\n", currentBidCount));
lastBidCount = currentBidCount;
}
}
break;
}
case constcrc("DeleteCharacterMessage") :
{
DeleteCharacterMessage message(ri);
AuctionMarket::getInstance().DeleteCharacter(message);
break;
}
}
else if(msg.isType("DeleteCharacterMessage"))
{
DeleteCharacterMessage message(ri);
AuctionMarket::getInstance().DeleteCharacter(message);
}
}
@@ -36,6 +36,8 @@
#include "serverNetworkMessages/QueryVendorItemCountMessage.h"
#include "serverNetworkMessages/UpdateVendorStatusMessage.h"
#include "sharedFoundation/CrcConstexpr.hpp"
//-----------------------------------------------------------------------
namespace GameServerConnectionNamespace
@@ -88,201 +90,235 @@ void GameServerConnection::onReceive(const Archive::ByteStream & message)
Archive::ReadIterator ri = message.begin();
GameNetworkMessage msg(ri);
ri = message.begin();
const uint32 messageType = msg.getType();
if(msg.isType("AcceptHighBidMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message AcceptHighBidMessage from game server id: %d.\n", m_gameServerId ));
AcceptHighBidMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().AcceptHighBid(message);
}
else if(msg.isType("AddAuctionMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message AddAuctionMessage from game server id: %d.\n", m_gameServerId ));
AddAuctionMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().AddAuction(message);
}
else if(msg.isType("AddBidMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message AddBidMessage from game server id: %d.\n", m_gameServerId ));
AddBidMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().AddBid(message);
}
else if(msg.isType("AddImmediateAuctionMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message AddImmediateAuctionMessage from game server id: %d.\n", m_gameServerId ));
AddImmediateAuctionMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().AddImmediateAuction(message);
}
else if(msg.isType("CancelAuctionMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message CancelAuctionMessage from game server id: %d.\n", m_gameServerId ));
CancelAuctionMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().CancelAuction(message);
}
else if(msg.isType("CreateVendorMarketMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message CreateVendorMarketMessage from game server id: %d.\n", m_gameServerId ));
CreateVendorMarketMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().CreateVendorMarket(message);
}
else if(msg.isType("DestroyVendorMarketMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message DestroyVendorMarketMessage from game server id: %d.\n", m_gameServerId ));
DestroyVendorMarketMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().DestroyVendorMarket(message);
}
else if(msg.isType("DeleteAuctionLocationMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message DeleteAuctionLocationMessage from game server id: %d.\n", m_gameServerId ));
DeleteAuctionLocationMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().DeleteAuctionLocation(message);
}
else if(msg.isType("GetItemDetailsMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetItemDetailsMessage from game server id: %d.\n", m_gameServerId ));
GetItemDetailsMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetItemDetails(message);
}
else if(msg.isType("GetItemMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetItemMessage from game server id: %d.\n", m_gameServerId ));
GetItemMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetItem(message);
}
else if(msg.isType("SetSalesTaxMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message SetSalesTaxMessage from game server id: %d.\n", m_gameServerId ));
SetSalesTaxMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().SetSalesTax(message);
}
else if(msg.isType("GetVendorOwnerMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetVendorOwnerMessage from game server id: %d.\n", m_gameServerId ));
GetVendorOwnerMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetVendorOwner(message);
}
else if(msg.isType("GetVendorValueMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetVendorValueMessage from game server id: %d.\n", m_gameServerId ));
GetVendorValueMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetVendorValue(message);
}
else if(msg.isType("QueryAuctionHeadersMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message QueryAuctionHeadersMessage from game server id: %d.\n", m_gameServerId ));
QueryAuctionHeadersMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().QueryAuctionHeaders(message);
}
else if(msg.isType("SetGameTimeMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message SetGameTimeMessage from game server id: %d.\n", m_gameServerId ));
SetGameTimeMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().SetGameTime(message);
}
else if(msg.isType("CleanupInvalidItemRetrievalMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message CleanupInvalidItemRetrievalMessage from game server id: %d.\n", m_gameServerId ));
CleanupInvalidItemRetrievalMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().CleanupInvalidItemRetrieval(message);
}
else if(msg.isType("QueryVendorItemCountMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message QueryVendorItemCountMessage from game server id: %d.\n", m_gameServerId ));
QueryVendorItemCountMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().QueryVendorItemCount(message);
}
else if(msg.isType("GetPlayerVendorCountMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetPlayerVendorCountMessage from game server id: %d.\n", m_gameServerId ));
GetPlayerVendorCountMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetPlayerVendorCount(message);
}
else if(msg.isType("UpdateVendorSearchOptionMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message UpdateVendorSearchOptionMessage from game server id: %d.\n", m_gameServerId ));
UpdateVendorSearchOptionMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().UpdateVendorSearchOption(message);
}
else if(msg.isType("SetEntranceChargeMessage"))
{
DEBUG_REPORT_LOG(/*m_showAllDebugInfo*/ true, ("[Commodities Server] : Received message SetEntranceChargeMessage from game server id: %d.\n", m_gameServerId ));
SetEntranceChargeMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().SetEntranceCharge(message);
}
else if(msg.isType("ResponseCommoditiesExcludedGotTypes"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message ResponseCommoditiesExcludedGotTypes from game server id: %d.\n", m_gameServerId ));
GenericValueTypeMessage<std::map<int, std::string> > message(ri);
AuctionMarket::getInstance().VerifyExcludedGotTypes(message.getValue());
}
else if(msg.isType("ResponseCommoditiesExcludedResourceClasses"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message ResponseCommoditiesExcludedResourceClasses from game server id: %d.\n", m_gameServerId ));
GenericValueTypeMessage<std::set<std::string> > message(ri);
AuctionMarket::getInstance().VerifyExcludedResourceClasses(message.getValue());
}
else if(msg.isType("ResponseResourceTreeHierarchy"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message ResponseResourceTreeHierarchy from game server id: %d.\n", m_gameServerId ));
GenericValueTypeMessage<std::map<int, std::set<int> > > message(ri);
AuctionMarket::getInstance().SetResourceTreeHierarchy(message.getValue());
}
else if(msg.isType("UpdateVendorStatusMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message UpdateVendorStatusMessage from game server id: %d.\n", m_gameServerId));
UpdateVendorStatusMessage message(ri);
AuctionMarket::getInstance().UpdateVendorStatus(message);
}
else if(msg.isType("UpdateVendorLocationMessage"))
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message UpdateVendorLocationMessage from game server id: %d.\n", m_gameServerId));
GenericValueTypeMessage<std::pair<NetworkId, std::string> > const message(ri);
AuctionMarket::getInstance().UpdateVendorLocation(message.getValue().first, message.getValue().second);
}
else if(msg.isType("GetItemAttributeData"))
{
GenericValueTypeMessage<std::pair<std::pair<NetworkId, std::string>, std::pair<std::pair<int, bool>, std::pair<bool, int> > > > const message(ri);
AuctionMarket::getInstance().getItemAttributeData(m_gameServerId, message.getValue().first.first, message.getValue().first.second, message.getValue().second.first.first, message.getValue().second.first.second, message.getValue().second.second.first, message.getValue().second.second.second);
}
else if(msg.isType("GetItemAttributeDataValues"))
{
GenericValueTypeMessage<std::pair<std::pair<NetworkId, std::pair<int, bool> >, std::pair<std::string, int> > > const message(ri);
AuctionMarket::getInstance().getItemAttributeDataValues(m_gameServerId, message.getValue().first.first, message.getValue().first.second.first, message.getValue().first.second.second, message.getValue().second.first, message.getValue().second.second);
}
else if(msg.isType("GetItemAttribute"))
{
GenericValueTypeMessage<std::pair<NetworkId, NetworkId> > const message(ri);
AuctionMarket::getInstance().getItemAttribute(m_gameServerId, message.getValue().first, message.getValue().second);
}
else if(msg.isType("GetVendorInfoForPlayer"))
{
GenericValueTypeMessage<std::pair<std::pair<NetworkId, NetworkId>, bool> > const message(ri);
AuctionMarket::getInstance().getVendorInfoForPlayer(m_gameServerId, message.getValue().first.first, message.getValue().first.second, message.getValue().second);
}
else if(msg.isType("GetALPQ"))
{
GenericValueTypeMessage<std::pair<NetworkId, int> > const message(ri);
AuctionMarket::getInstance().getAuctionLocationPriorityQueue(m_gameServerId, message.getValue().first, message.getValue().second);
switch(messageType) {
case constcrc("AcceptHighBidMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message AcceptHighBidMessage from game server id: %d.\n", m_gameServerId ));
AcceptHighBidMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().AcceptHighBid(message);
break;
}
case constcrc("AddAuctionMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message AddAuctionMessage from game server id: %d.\n", m_gameServerId ));
AddAuctionMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().AddAuction(message);
break;
}
case constcrc("AddBidMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message AddBidMessage from game server id: %d.\n", m_gameServerId ));
AddBidMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().AddBid(message);
break;
}
case constcrc("AddImmediateAuctionMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message AddImmediateAuctionMessage from game server id: %d.\n", m_gameServerId ));
AddImmediateAuctionMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().AddImmediateAuction(message);
break;
}
case constcrc("CancelAuctionMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message CancelAuctionMessage from game server id: %d.\n", m_gameServerId ));
CancelAuctionMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().CancelAuction(message);
break;
}
case constcrc("CreateVendorMarketMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message CreateVendorMarketMessage from game server id: %d.\n", m_gameServerId ));
CreateVendorMarketMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().CreateVendorMarket(message);
break;
}
case constcrc("DestroyVendorMarketMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message DestroyVendorMarketMessage from game server id: %d.\n", m_gameServerId ));
DestroyVendorMarketMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().DestroyVendorMarket(message);
break;
}
case constcrc("DeleteAuctionLocationMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message DeleteAuctionLocationMessage from game server id: %d.\n", m_gameServerId ));
DeleteAuctionLocationMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().DeleteAuctionLocation(message);
break;
}
case constcrc("GetItemDetailsMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetItemDetailsMessage from game server id: %d.\n", m_gameServerId ));
GetItemDetailsMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetItemDetails(message);
break;
}
case constcrc("GetItemMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetItemMessage from game server id: %d.\n", m_gameServerId ));
GetItemMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetItem(message);
break;
}
case constcrc("SetSalesTaxMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message SetSalesTaxMessage from game server id: %d.\n", m_gameServerId ));
SetSalesTaxMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().SetSalesTax(message);
break;
}
case constcrc("GetVendorOwnerMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetVendorOwnerMessage from game server id: %d.\n", m_gameServerId ));
GetVendorOwnerMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetVendorOwner(message);
break;
}
case constcrc("GetVendorValueMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetVendorValueMessage from game server id: %d.\n", m_gameServerId ));
GetVendorValueMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetVendorValue(message);
break;
}
case constcrc("QueryAuctionHeadersMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message QueryAuctionHeadersMessage from game server id: %d.\n", m_gameServerId ));
QueryAuctionHeadersMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().QueryAuctionHeaders(message);
break;
}
case constcrc("SetGameTimeMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message SetGameTimeMessage from game server id: %d.\n", m_gameServerId ));
SetGameTimeMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().SetGameTime(message);
break;
}
case constcrc("CleanupInvalidItemRetrievalMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message CleanupInvalidItemRetrievalMessage from game server id: %d.\n", m_gameServerId ));
CleanupInvalidItemRetrievalMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().CleanupInvalidItemRetrieval(message);
break;
}
case constcrc("QueryVendorItemCountMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message QueryVendorItemCountMessage from game server id: %d.\n", m_gameServerId ));
QueryVendorItemCountMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().QueryVendorItemCount(message);
break;
}
case constcrc("GetPlayerVendorCountMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message GetPlayerVendorCountMessage from game server id: %d.\n", m_gameServerId ));
GetPlayerVendorCountMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().GetPlayerVendorCount(message);
break;
}
case constcrc("UpdateVendorSearchOptionMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message UpdateVendorSearchOptionMessage from game server id: %d.\n", m_gameServerId ));
UpdateVendorSearchOptionMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().UpdateVendorSearchOption(message);
break;
}
case constcrc("SetEntranceChargeMessage") :
{
DEBUG_REPORT_LOG(/*m_showAllDebugInfo*/ true, ("[Commodities Server] : Received message SetEntranceChargeMessage from game server id: %d.\n", m_gameServerId ));
SetEntranceChargeMessage message(ri);
message.SetTrackId(m_gameServerId);
AuctionMarket::getInstance().SetEntranceCharge(message);
break;
}
case constcrc("ResponseCommoditiesExcludedGotTypes") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message ResponseCommoditiesExcludedGotTypes from game server id: %d.\n", m_gameServerId ));
GenericValueTypeMessage<std::map<int, std::string> > message(ri);
AuctionMarket::getInstance().VerifyExcludedGotTypes(message.getValue());
break;
}
case constcrc("ResponseCommoditiesExcludedResourceClasses") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message ResponseCommoditiesExcludedResourceClasses from game server id: %d.\n", m_gameServerId ));
GenericValueTypeMessage<std::set<std::string> > message(ri);
AuctionMarket::getInstance().VerifyExcludedResourceClasses(message.getValue());
break;
}
case constcrc("ResponseResourceTreeHierarchy") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message ResponseResourceTreeHierarchy from game server id: %d.\n", m_gameServerId ));
GenericValueTypeMessage<std::map<int, std::set<int> > > message(ri);
AuctionMarket::getInstance().SetResourceTreeHierarchy(message.getValue());
break;
}
case constcrc("UpdateVendorStatusMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message UpdateVendorStatusMessage from game server id: %d.\n", m_gameServerId));
UpdateVendorStatusMessage message(ri);
AuctionMarket::getInstance().UpdateVendorStatus(message);
break;
}
case constcrc("UpdateVendorLocationMessage") :
{
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server] : Received message UpdateVendorLocationMessage from game server id: %d.\n", m_gameServerId));
GenericValueTypeMessage<std::pair<NetworkId, std::string> > const message(ri);
AuctionMarket::getInstance().UpdateVendorLocation(message.getValue().first, message.getValue().second);
break;
}
case constcrc("GetItemAttributeData") :
{
GenericValueTypeMessage<std::pair<std::pair<NetworkId, std::string>, std::pair<std::pair<int, bool>, std::pair<bool, int> > > > const message(ri);
AuctionMarket::getInstance().getItemAttributeData(m_gameServerId, message.getValue().first.first, message.getValue().first.second, message.getValue().second.first.first, message.getValue().second.first.second, message.getValue().second.second.first, message.getValue().second.second.second);
break;
}
case constcrc("GetItemAttributeDataValues") :
{
GenericValueTypeMessage<std::pair<std::pair<NetworkId, std::pair<int, bool> >, std::pair<std::string, int> > > const message(ri);
AuctionMarket::getInstance().getItemAttributeDataValues(m_gameServerId, message.getValue().first.first, message.getValue().first.second.first, message.getValue().first.second.second, message.getValue().second.first, message.getValue().second.second);
break;
}
case constcrc("GetItemAttribute") :
{
GenericValueTypeMessage<std::pair<NetworkId, NetworkId> > const message(ri);
AuctionMarket::getInstance().getItemAttribute(m_gameServerId, message.getValue().first, message.getValue().second);
break;
}
case constcrc("GetVendorInfoForPlayer") :
{
GenericValueTypeMessage<std::pair<std::pair<NetworkId, NetworkId>, bool> > const message(ri);
AuctionMarket::getInstance().getVendorInfoForPlayer(m_gameServerId, message.getValue().first.first, message.getValue().first.second, message.getValue().second);
break;
}
case constcrc("GetALPQ") :
{
GenericValueTypeMessage<std::pair<NetworkId, int> > const message(ri);
AuctionMarket::getInstance().getAuctionLocationPriorityQueue(m_gameServerId, message.getValue().first, message.getValue().second);
break;
}
}
}
@@ -17,38 +17,7 @@
#include "sharedNetworkMessages/ChatOnLeaveRoom.h"
#include "sharedNetworkMessages/GenericValueTypeMessage.h"
//-----------------------------------------------------------------------
/*
void putClientsInRoom(const unsigned int roomId, const std::vector<NetworkId> & clients)
{
std::vector<NetworkId>::const_iterator i;
for(i = clients.begin(); i != clients.end(); ++i)
{
Client* client = ConnectionServer::getClient((*i));
DEBUG_REPORT_LOG(!client, ("Error, could not map %s to a client\n", (*i).getValueString().c_str()));
if (client)
client->enterRoom(roomId);
}
}
*/
//-----------------------------------------------------------------------
/*
void removeClientsFromRoom(const unsigned int roomId, const std::vector<NetworkId> & clients)
{
std::vector<NetworkId>::const_iterator i;
for(i = clients.begin(); i != clients.end(); ++i)
{
Client* client = ConnectionServer::getClient((*i));
DEBUG_REPORT_LOG(!client, ("Error, could not map %s to a client\n", (*i).getValueString().c_str()));
if (client)
client->leaveRoom(roomId);
}
}
*/
//-----------------------------------------------------------------------
#include "sharedFoundation/CrcConstexpr.hpp"
ChatServerConnection::ChatServerConnection(UdpConnectionMT * u, TcpClient * t) :
ServerConnection(u, t),
@@ -104,41 +73,16 @@ void ChatServerConnection::onReceive(const Archive::ByteStream & message)
Archive::ReadIterator ri = message.begin();
GameNetworkMessage m(ri);
ri = message.begin();
if (m.isType("GameClientMessage"))
{
//we're receiving a message to forward to the client.
//it is prefixed with NetworkId and reliable.
if (message.getType() == constcrc("GameClientMessage")) {
//we're receiving a message to forward to the client.
//it is prefixed with NetworkId and reliable.
const GameClientMessage msg(ri);
Archive::ReadIterator mri(msg.getByteStream());
GameNetworkMessage gnm(mri);
mri = msg.getByteStream().begin();
// The connection server wants to trap room
// enter/leave messages to cache clients
// in particular rooms for autorecovery when
// a chat server process is stopped then later
// restarted
//
// ************ THIS CODE DOES NOT WORK ***********
// The following code has been commented out since
// everyone in the group is sent these messages but
// the logic assumes that only the person entering
// or leaving a chat room is sent the message.
/*
if(gnm.isType("ChatOnEnteredRoom"))
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnEnteredRoom chat(cri);
putClientsInRoom(chat.getRoomId(), msg.getDistributionList());
}
else if(gnm.isType("ChatOnLeaveRoom"))
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnLeaveRoom chat(cri);
removeClientsFromRoom(chat.getRoomId(), msg.getDistributionList());
}
*/
const uint32 messageType = gnm.getType();
const std::vector<NetworkId> & d = msg.getDistributionList();
std::vector<NetworkId>::const_iterator i;
@@ -167,46 +111,55 @@ void ChatServerConnection::onReceive(const Archive::ByteStream & message)
DEBUG_REPORT_LOG(!client, ("Error, could not map %s to a client\n", (*i).getValueString().c_str()));
if (client)
{
if (!gnm.isType("ChatStatisticsCS"))
if (messageType !== constcrc("ChatStatisticsCS")) {
client->getClientConnection()->sendByteStream(msg.getByteStream(), msg.getReliable());
}
GameConnection *gc = client->getGameConnection();
if (gc)
{
if (gnm.isType("ChatOnGetFriendsList"))
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnGetFriendsList c(cri);
gc->send(c, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatOnGetFriendsList msg to game server\n"));
}
else if (gnm.isType("ChatOnChangeIgnoreStatus"))
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnChangeIgnoreStatus c(cri);
gc->send(c, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatOnChangeIgnoreStatus msg to game server\n"));
}
else if (gnm.isType("ChatOnChangeFriendStatus"))
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnChangeFriendStatus c(cri);
gc->send(c, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatOnChangeFriendStatus msg to game server\n"));
}
else if (gnm.isType("ChatOnGetIgnoreList"))
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnGetIgnoreList c(cri);
gc->send(c, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatOnGetIgnoreList msg to game server\n"));
}
else if (gnm.isType("ChatStatisticsCS"))
{
Archive::ReadIterator cri(msg.getByteStream());
GenericValueTypeMessage<std::pair<std::pair<NetworkId, int>, std::pair<int, int> > > chatStatistics(cri);
gc->send(chatStatistics, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatStatisticsCS msg to game server\n"));
switch(messageType) {
case constcrc("ChatOnGetFriendsList") :
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnGetFriendsList c(cri);
gc->send(c, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatOnGetFriendsList msg to game server\n"));
break;
}
case constcrc("ChatOnChangeIgnoreStatus") :
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnChangeIgnoreStatus c(cri);
gc->send(c, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatOnChangeIgnoreStatus msg to game server\n"));
break;
}
case constcrc("ChatOnChangeFriendStatus") :
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnChangeFriendStatus c(cri);
gc->send(c, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatOnChangeFriendStatus msg to game server\n"));
break;
}
case constcrc("ChatOnGetIgnoreList") :
{
Archive::ReadIterator cri(msg.getByteStream());
ChatOnGetIgnoreList c(cri);
gc->send(c, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatOnGetIgnoreList msg to game server\n"));
break;
}
case constcrc("ChatStatisticsCS") :
{
Archive::ReadIterator cri(msg.getByteStream());
GenericValueTypeMessage<std::pair<std::pair<NetworkId, int>, std::pair<int, int> > > chatStatistics(cri);
gc->send(chatStatistics, true);
//DEBUG_REPORT_LOG(true, ("Sending a ChatStatisticsCS msg to game server\n"));
break;
}
}
}
}
@@ -20,6 +20,8 @@
#include "sharedNetworkMessages/DisconnectPlayerMessage.h"
#include "sharedNetworkMessages/GenericValueTypeMessage.h"
#include "sharedFoundation/CrcConstexpr.hpp"
//----------------------------------------------------------------------
Client::Client(ClientConnection * cconn, const NetworkId& oid) :
@@ -157,7 +159,9 @@ void Client::leaveRoom(const unsigned int roomId)
void Client::receiveMessage(const MessageDispatch::Emitter & source, const MessageDispatch::MessageBase & message)
{
if(message.isType("GameConnectionClosed"))
const uint32 messageType = message.getType();
if(messageType == constcrc("GameConnectionClosed"))
{
// Game server has crashed. With luck, we'll get transferred to a new server shortly
// So, clear our connection and put us on a queue. If we don't get transferred in a
@@ -166,12 +170,12 @@ void Client::receiveMessage(const MessageDispatch::Emitter & source, const Messa
m_gameConnection = 0;
ConnectionServer::addRecoveringClient(getNetworkId());
}
else if(message.isType("ChatServerConnectionOpened"))
else if(messageType == constcrc("ChatServerConnectionOpened"))
{
const ChatServerConnection & chatConnection = static_cast<const ChatServerConnection &>(source);
setChatConnection(const_cast<ChatServerConnection*>(&chatConnection));
}
else if(message.isType("CustomerServiceConnectionOpened"))
else if(messageType == constcrc("CustomerServiceConnectionOpened"))
{
const CustomerServiceConnection & customerServiceConnection = static_cast<const CustomerServiceConnection &>(source);
setCustomerServiceConnection(const_cast<CustomerServiceConnection*>(&customerServiceConnection));
File diff suppressed because it is too large Load Diff