mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-01 01:16:03 -04:00
. . . another one bites the dust
This commit is contained in:
+217
-200
@@ -167,238 +167,255 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
Archive::ReadIterator ri = message.begin();
|
||||
GameNetworkMessage m(ri);
|
||||
ri = message.begin();
|
||||
|
||||
const uint32 messageType = m.getType();
|
||||
|
||||
if (m.isType("NewCentralConnectionServer"))
|
||||
{
|
||||
const NewCentralConnectionServer ncs(ri);
|
||||
|
||||
m_chatServicePort = ncs.getChatServicePort();
|
||||
m_csServicePort = ncs.getCustomerServicePort();
|
||||
|
||||
m_clientServicePortPrivate = ncs.getClientServicePortPrivate();
|
||||
m_clientServicePortPublic = ncs.getClientServicePortPublic();
|
||||
m_gameServicePort = ncs.getGameServicePort();
|
||||
m_pingPort = ncs.getPingPort();
|
||||
m_connectionServerNumber = ncs.getConnectionServerNumber();
|
||||
m_gameServiceAddress = ncs.getGameServiceAddress();
|
||||
m_clientServiceAddress = ncs.getClientServiceAddress();
|
||||
m_chatServiceAddress = ncs.getChatServiceAddress();
|
||||
m_customerServiceAddress = ncs.getCustomerServiceAddress();
|
||||
|
||||
CentralServer::getInstance().addConnectionServerConnection(this);
|
||||
|
||||
//Now broadcast to gameservers
|
||||
ConnectionServerAddress const addressMessage(m_gameServiceAddress, m_gameServicePort);
|
||||
CentralServer::getInstance().broadcastToGameServers(addressMessage);
|
||||
|
||||
//Send to chat server
|
||||
const int ct = static_cast<int>(EnumerateServers::CONNECTION_SERVER);
|
||||
EnumerateServers e(true, getChatServiceAddress(), getChatServicePort(), ct);
|
||||
|
||||
if (!getChatServiceAddress().empty() && (getChatServicePort() != 0))
|
||||
switch(messageType) {
|
||||
case constcrc("NewCentralConnectionServer") :
|
||||
{
|
||||
CentralServer::getInstance().broadcastToChatServers(e);
|
||||
const NewCentralConnectionServer ncs(ri);
|
||||
|
||||
m_chatServicePort = ncs.getChatServicePort();
|
||||
m_csServicePort = ncs.getCustomerServicePort();
|
||||
|
||||
m_clientServicePortPrivate = ncs.getClientServicePortPrivate();
|
||||
m_clientServicePortPublic = ncs.getClientServicePortPublic();
|
||||
m_gameServicePort = ncs.getGameServicePort();
|
||||
m_pingPort = ncs.getPingPort();
|
||||
m_connectionServerNumber = ncs.getConnectionServerNumber();
|
||||
m_gameServiceAddress = ncs.getGameServiceAddress();
|
||||
m_clientServiceAddress = ncs.getClientServiceAddress();
|
||||
m_chatServiceAddress = ncs.getChatServiceAddress();
|
||||
m_customerServiceAddress = ncs.getCustomerServiceAddress();
|
||||
|
||||
CentralServer::getInstance().addConnectionServerConnection(this);
|
||||
|
||||
//Now broadcast to gameservers
|
||||
ConnectionServerAddress const addressMessage(m_gameServiceAddress, m_gameServicePort);
|
||||
CentralServer::getInstance().broadcastToGameServers(addressMessage);
|
||||
|
||||
//Send to chat server
|
||||
const int ct = static_cast<int>(EnumerateServers::CONNECTION_SERVER);
|
||||
EnumerateServers e(true, getChatServiceAddress(), getChatServicePort(), ct);
|
||||
|
||||
if (!getChatServiceAddress().empty() && (getChatServicePort() != 0))
|
||||
{
|
||||
CentralServer::getInstance().broadcastToChatServers(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("ChatServ", ("ConnectionServerConnection::onReceive() Chat service address and port are invalid, unable to CentralServer::getInstance().broadcastToChatServers()"));
|
||||
}
|
||||
|
||||
//Send to CS servers
|
||||
const EnumerateServers e2(true, getCustomerServiceAddress(), getCustomerServicePort(), ct);
|
||||
|
||||
if (!getCustomerServiceAddress().empty()
|
||||
&& (getCustomerServicePort() != 0))
|
||||
{
|
||||
CentralServer::getInstance().broadcastToCustomerServiceServers(e2);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("ChatServ", ("ConnectionServerConnection::onReceive() Customer service address and port are invalid, unable to CentralServer::getInstance().broadcastToCustomerServiceServers()"));
|
||||
}
|
||||
|
||||
//Send to login Servers
|
||||
if ((getClientServicePortPrivate() != 0) || (getClientServicePortPublic() != 0))
|
||||
{
|
||||
const LoginConnectionServerAddress csa(m_id, getClientServiceAddress(), getClientServicePortPrivate(),
|
||||
getClientServicePortPublic(), getPlayerCount(), getPingPort());
|
||||
CentralServer::getInstance().sendToAllLoginServers(csa);
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
case constcrc("UpdateConnectionServerStatus") :
|
||||
{
|
||||
LOG("ChatServ", ("ConnectionServerConnection::onReceive() Chat service address and port are invalid, unable to CentralServer::getInstance().broadcastToChatServers()"));
|
||||
DEBUG_REPORT_LOG(true, ("Got update status for connection server\n"));
|
||||
const UpdateConnectionServerStatus ucs(ri);
|
||||
m_clientServicePortPublic = ucs.getPublicPort();
|
||||
m_clientServicePortPrivate = ucs.getPrivatePort();
|
||||
UpdateLoginConnectionServerStatus ulc(getId(), m_clientServicePortPublic, m_clientServicePortPrivate, getPlayerCount());
|
||||
CentralServer::getInstance().sendToAllLoginServers(ulc);
|
||||
break;
|
||||
}
|
||||
|
||||
//Send to CS servers
|
||||
const EnumerateServers e2(true, getCustomerServiceAddress(), getCustomerServicePort(), ct);
|
||||
|
||||
if (!getCustomerServiceAddress().empty()
|
||||
&& (getCustomerServicePort() != 0))
|
||||
case constcrc("TaskSpawnProcess") :
|
||||
{
|
||||
CentralServer::getInstance().broadcastToCustomerServiceServers(e2);
|
||||
const TaskSpawnProcess spawn(ri);
|
||||
CentralServer::getInstance().sendTaskMessage(spawn);
|
||||
break;
|
||||
}
|
||||
else
|
||||
case constcrc("NewPseudoClientConnection") :
|
||||
{
|
||||
LOG("ChatServ", ("ConnectionServerConnection::onReceive() Customer service address and port are invalid, unable to CentralServer::getInstance().broadcastToCustomerServiceServers()"));
|
||||
}
|
||||
const GenericValueTypeMessage<std::pair<unsigned int, int8> > info(ri);
|
||||
s_pseudoClientConnectionMap[info.getValue().first] = std::make_pair(static_cast<TransferRequestMoveValidation::TransferRequestSource>(info.getValue().second), this);
|
||||
|
||||
//Send to login Servers
|
||||
if ((getClientServicePortPrivate() != 0) || (getClientServicePortPublic() != 0))
|
||||
// remove corresponding "non pseudo client connection"
|
||||
CentralServer::getInstance().removeFromAccountConnectionMap(static_cast<StationId>(info.getValue().first));
|
||||
break;
|
||||
}
|
||||
case constcrc("DestroyPseudoClientConnection") :
|
||||
{
|
||||
const LoginConnectionServerAddress csa(m_id, getClientServiceAddress(), getClientServicePortPrivate(),
|
||||
getClientServicePortPublic(), getPlayerCount(), getPingPort());
|
||||
CentralServer::getInstance().sendToAllLoginServers(csa);
|
||||
const GenericValueTypeMessage<unsigned int> info(ri);
|
||||
std::map<unsigned int, std::pair<TransferRequestMoveValidation::TransferRequestSource, ConnectionServerConnection *> >::iterator f = s_pseudoClientConnectionMap.find(info.getValue());
|
||||
if (f != s_pseudoClientConnectionMap.end())
|
||||
{
|
||||
s_pseudoClientConnectionMap.erase(f);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (m.isType("UpdateConnectionServerStatus"))
|
||||
{
|
||||
DEBUG_REPORT_LOG(true, ("Got update status for connection server\n"));
|
||||
const UpdateConnectionServerStatus ucs(ri);
|
||||
m_clientServicePortPublic = ucs.getPublicPort();
|
||||
m_clientServicePortPrivate = ucs.getPrivatePort();
|
||||
UpdateLoginConnectionServerStatus ulc(getId(), m_clientServicePortPublic, m_clientServicePortPrivate, getPlayerCount());
|
||||
CentralServer::getInstance().sendToAllLoginServers(ulc);
|
||||
}
|
||||
|
||||
else if (m.isType("TaskSpawnProcess"))
|
||||
{
|
||||
const TaskSpawnProcess spawn(ri);
|
||||
CentralServer::getInstance().sendTaskMessage(spawn);
|
||||
}
|
||||
else if (m.isType("NewPseudoClientConnection"))
|
||||
{
|
||||
const GenericValueTypeMessage<std::pair<unsigned int, int8> > info(ri);
|
||||
s_pseudoClientConnectionMap[info.getValue().first] = std::make_pair(static_cast<TransferRequestMoveValidation::TransferRequestSource>(info.getValue().second), this);
|
||||
|
||||
// remove corresponding "non pseudo client connection"
|
||||
CentralServer::getInstance().removeFromAccountConnectionMap(static_cast<StationId>(info.getValue().first));
|
||||
}
|
||||
else if (m.isType("DestroyPseudoClientConnection"))
|
||||
{
|
||||
const GenericValueTypeMessage<unsigned int> info(ri);
|
||||
std::map<unsigned int, std::pair<TransferRequestMoveValidation::TransferRequestSource, ConnectionServerConnection *> >::iterator f = s_pseudoClientConnectionMap.find(info.getValue());
|
||||
if (f != s_pseudoClientConnectionMap.end())
|
||||
case constcrc("TransferReceiveDataFromGameServer") :
|
||||
{
|
||||
s_pseudoClientConnectionMap.erase(f);
|
||||
}
|
||||
}
|
||||
else if (m.isType("TransferReceiveDataFromGameServer"))
|
||||
{
|
||||
const GenericValueTypeMessage<TransferCharacterData> transferReply(ri);
|
||||
const GenericValueTypeMessage<TransferCharacterData> transferReply(ri);
|
||||
|
||||
if (transferReply.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
if (transferReply.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(transferReply);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Got TransferReceiveDataFromGameServer: %s", transferReply.getValue().toString().c_str()));
|
||||
|
||||
// send character to ConnectionServer for creation on the destination server
|
||||
GenericValueTypeMessage<TransferCharacterData> login("TransferLoginCharacterToDestinationServer", transferReply.getValue());
|
||||
CentralServer::getInstance().sendToArbitraryLoginServer(login);
|
||||
LOG("CustomerService", ("CharacterTransfer: Sending TransferLoginCharacterToDestinationServer to CentralServer (via LoginServer) (%s) for (%s)", transferReply.getValue().getDestinationGalaxy().c_str(), login.getValue().toString().c_str()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case constcrc("ApplyTransferDataSuccess") :
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(transferReply);
|
||||
const GenericValueTypeMessage<TransferCharacterData> success(ri);
|
||||
|
||||
// send message to source galaxy (via LoginServer) to mark
|
||||
// the source character as having been transferred to prevent
|
||||
// all future login of the character
|
||||
{
|
||||
const GenericValueTypeMessage<std::pair<std::string, NetworkId> > msg("CtsCompletedForcharacter", std::make_pair(success.getValue().getSourceGalaxy(), success.getValue().getCharacterId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(msg));
|
||||
}
|
||||
|
||||
// send the message back to the transfer server, which then
|
||||
// sends a disable login request to the source central server,
|
||||
// "removing" the account on the source galaxy.
|
||||
if (success.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(success);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Received ApplyTransferDataSuccess from ConnectionServer. %s", success.getValue().toString().c_str()));
|
||||
LOG("CustomerService", ("CharacterTransfer: Sending ToggleAvatarLoginStatus request to LoginServer"));
|
||||
|
||||
const ToggleAvatarLoginStatus toggleLoginStatus(success.getValue().getSourceGalaxy(), success.getValue().getSourceStationId(), success.getValue().getCharacterId(), false);
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(toggleLoginStatus));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
case constcrc("ApplyTransferDataFail") :
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Got TransferReceiveDataFromGameServer: %s", transferReply.getValue().toString().c_str()));
|
||||
const GenericValueTypeMessage<TransferCharacterData> fail(ri);
|
||||
|
||||
// send character to ConnectionServer for creation on the destination server
|
||||
GenericValueTypeMessage<TransferCharacterData> login("TransferLoginCharacterToDestinationServer", transferReply.getValue());
|
||||
CentralServer::getInstance().sendToArbitraryLoginServer(login);
|
||||
LOG("CustomerService", ("CharacterTransfer: Sending TransferLoginCharacterToDestinationServer to CentralServer (via LoginServer) (%s) for (%s)", transferReply.getValue().getDestinationGalaxy().c_str(), login.getValue().toString().c_str()));
|
||||
// send the message back to the transfer server, which then
|
||||
// sends a delete request to the destination central server,
|
||||
// "removing" the account on the destination galaxy.
|
||||
if (fail.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(fail);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Received ApplyTransferDataFail from ConnectionServer. %s", fail.getValue().toString().c_str()));
|
||||
LOG("CustomerService", ("CharacterTransfer: failed to apply transfer data. Deleting character on destination server. %s", fail.getValue().toString().c_str()));
|
||||
|
||||
GenericValueTypeMessage<TransferCharacterData> const deleteCharacter("DeleteFailedTransfer", fail.getValue());
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(deleteCharacter));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestSource("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getSourceGalaxy(), fail.getValue().getSourceStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestSource));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestTarget("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getDestinationGalaxy(), fail.getValue().getDestinationStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestTarget));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (m.isType("ApplyTransferDataSuccess"))
|
||||
{
|
||||
const GenericValueTypeMessage<TransferCharacterData> success(ri);
|
||||
|
||||
// send message to source galaxy (via LoginServer) to mark
|
||||
// the source character as having been transferred to prevent
|
||||
// all future login of the character
|
||||
case constcrc("TransferCreateCharacterFailed") :
|
||||
{
|
||||
const GenericValueTypeMessage<std::pair<std::string, NetworkId> > msg("CtsCompletedForcharacter", std::make_pair(success.getValue().getSourceGalaxy(), success.getValue().getCharacterId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(msg));
|
||||
}
|
||||
const GenericValueTypeMessage<TransferCharacterData> fail(ri);
|
||||
|
||||
// send the message back to the transfer server, which then
|
||||
// sends a disable login request to the source central server,
|
||||
// "removing" the account on the source galaxy.
|
||||
if (success.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
if (fail.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(fail);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Received TransferCreateCharacterFailed. %s", fail.getValue().toString().c_str()));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestSource("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getSourceGalaxy(), fail.getValue().getSourceStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestSource));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestTarget("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getDestinationGalaxy(), fail.getValue().getDestinationStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestTarget));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case constcrc("ReplyTransferDataFail") :
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(success);
|
||||
const GenericValueTypeMessage<TransferCharacterData> reply(ri);
|
||||
|
||||
if (reply.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(reply);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Transfer failed: Failed to retrieve character data. %s", reply.getValue().toString().c_str()));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestSource("RequestTransferClosePseudoClientConnection", std::make_pair(reply.getValue().getSourceGalaxy(), reply.getValue().getSourceStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestSource));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestTarget("RequestTransferClosePseudoClientConnection", std::make_pair(reply.getValue().getDestinationGalaxy(), reply.getValue().getDestinationStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestTarget));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
case constcrc("TransferFailGameServerClosedConnectionWithConnectionServer") :
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Received ApplyTransferDataSuccess from ConnectionServer. %s", success.getValue().toString().c_str()));
|
||||
LOG("CustomerService", ("CharacterTransfer: Sending ToggleAvatarLoginStatus request to LoginServer"));
|
||||
const GenericValueTypeMessage<TransferCharacterData> fail(ri);
|
||||
|
||||
const ToggleAvatarLoginStatus toggleLoginStatus(success.getValue().getSourceGalaxy(), success.getValue().getSourceStationId(), success.getValue().getCharacterId(), false);
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(toggleLoginStatus));
|
||||
if (fail.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(fail);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Transfer failed: GameServer connection closed while transfer was in progress. %s", fail.getValue().toString().c_str()));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestSource("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getSourceGalaxy(), fail.getValue().getSourceStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestSource));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestTarget("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getDestinationGalaxy(), fail.getValue().getDestinationStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestTarget));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (m.isType("ApplyTransferDataFail"))
|
||||
{
|
||||
const GenericValueTypeMessage<TransferCharacterData> fail(ri);
|
||||
|
||||
// send the message back to the transfer server, which then
|
||||
// sends a delete request to the destination central server,
|
||||
// "removing" the account on the destination galaxy.
|
||||
if (fail.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
case constcrc("AccountFeatureIdRequest") :
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(fail);
|
||||
const AccountFeatureIdRequest msg(ri);
|
||||
CentralServer::getInstance().sendToArbitraryLoginServer(msg);
|
||||
break;
|
||||
}
|
||||
else
|
||||
case constcrc("AdjustAccountFeatureIdRequest") :
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Received ApplyTransferDataFail from ConnectionServer. %s", fail.getValue().toString().c_str()));
|
||||
LOG("CustomerService", ("CharacterTransfer: failed to apply transfer data. Deleting character on destination server. %s", fail.getValue().toString().c_str()));
|
||||
|
||||
GenericValueTypeMessage<TransferCharacterData> const deleteCharacter("DeleteFailedTransfer", fail.getValue());
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(deleteCharacter));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestSource("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getSourceGalaxy(), fail.getValue().getSourceStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestSource));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestTarget("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getDestinationGalaxy(), fail.getValue().getDestinationStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestTarget));
|
||||
const AdjustAccountFeatureIdRequest msg(ri);
|
||||
CentralServer::getInstance().sendToArbitraryLoginServer(msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (m.isType("TransferCreateCharacterFailed"))
|
||||
{
|
||||
const GenericValueTypeMessage<TransferCharacterData> fail(ri);
|
||||
|
||||
if (fail.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
default :
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(fail);
|
||||
ServerConnection::onReceive(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Received TransferCreateCharacterFailed. %s", fail.getValue().toString().c_str()));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestSource("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getSourceGalaxy(), fail.getValue().getSourceStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestSource));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestTarget("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getDestinationGalaxy(), fail.getValue().getDestinationStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestTarget));
|
||||
}
|
||||
}
|
||||
else if (m.isType("ReplyTransferDataFail"))
|
||||
{
|
||||
const GenericValueTypeMessage<TransferCharacterData> reply(ri);
|
||||
|
||||
if (reply.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(reply);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Transfer failed: Failed to retrieve character data. %s", reply.getValue().toString().c_str()));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestSource("RequestTransferClosePseudoClientConnection", std::make_pair(reply.getValue().getSourceGalaxy(), reply.getValue().getSourceStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestSource));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestTarget("RequestTransferClosePseudoClientConnection", std::make_pair(reply.getValue().getDestinationGalaxy(), reply.getValue().getDestinationStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestTarget));
|
||||
}
|
||||
}
|
||||
else if (m.isType("TransferFailGameServerClosedConnectionWithConnectionServer"))
|
||||
{
|
||||
const GenericValueTypeMessage<TransferCharacterData> fail(ri);
|
||||
|
||||
if (fail.getValue().getTransferRequestSource() == TransferRequestMoveValidation::TRS_transfer_server)
|
||||
{
|
||||
CentralServer::getInstance().sendToTransferServer(fail);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("CustomerService", ("CharacterTransfer: Transfer failed: GameServer connection closed while transfer was in progress. %s", fail.getValue().toString().c_str()));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestSource("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getSourceGalaxy(), fail.getValue().getSourceStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestSource));
|
||||
|
||||
GenericValueTypeMessage<std::pair<std::string, unsigned int> > const closeRequestTarget("RequestTransferClosePseudoClientConnection", std::make_pair(fail.getValue().getDestinationGalaxy(), fail.getValue().getDestinationStationId()));
|
||||
IGNORE_RETURN(CentralServer::getInstance().sendToArbitraryLoginServer(closeRequestTarget));
|
||||
}
|
||||
}
|
||||
else if (m.isType("AccountFeatureIdRequest"))
|
||||
{
|
||||
const AccountFeatureIdRequest msg(ri);
|
||||
CentralServer::getInstance().sendToArbitraryLoginServer(msg);
|
||||
}
|
||||
else if (m.isType("AdjustAccountFeatureIdRequest"))
|
||||
{
|
||||
const AdjustAccountFeatureIdRequest msg(ri);
|
||||
CentralServer::getInstance().sendToArbitraryLoginServer(msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerConnection::onReceive(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user