other than needing reformatting this should build unless i forgot

something
This commit is contained in:
DarthArgus
2016-09-29 21:29:55 -05:00
parent d87f7a4f84
commit a282307898
2 changed files with 43 additions and 40 deletions
@@ -15,6 +15,8 @@
#include "sharedNetworkMessages/ConsoleChannelMessages.h"
#include "sharedNetworkMessages/GenericValueTypeMessage.h"
#include "sharedFoundation/CrcConstexpr.hpp"
// ======================================================================
PlanetServerConnection::PlanetServerConnection(UdpConnectionMT *u, TcpClient *t) :
@@ -69,39 +71,36 @@ void PlanetServerConnection::onReceive(Archive::ByteStream const &message)
GameNetworkMessage const msg(ri);
ri = message.begin();
const uint32 msgType = msg.getType();
if (!m_forwardDestinationServers.empty())
{
if (isMessageForwardable(msg.getType()))
{
m_forwardMessages.push_back(std::make_pair(message, m_forwardDestinationServers.back()));
return;
}
else if (msg.isType("EndForward"))
{
if (--m_forwardCounts.back() == 0)
{
m_forwardCounts.pop_back();
m_forwardDestinationServers.pop_back();
if (m_forwardDestinationServers.empty())
pushAndClearObjectForwarding();
switch (msgType) {
case constcrc("EndForward"): {
if (--m_forwardCounts.back() == 0) {
m_forwardCounts.pop_back();
m_forwardDestinationServers.pop_back();
if (m_forwardDestinationServers.empty()) {
pushAndClearObjectForwarding();
}
}
return;
}
return;
}
else if (msg.isType("BeginForward"))
{
GenericValueTypeMessage<std::vector<uint32> > const beginForwardMessage(ri);
if (beginForwardMessage.getValue() == m_forwardDestinationServers.back())
++m_forwardCounts.back();
else
{
m_forwardCounts.push_back(1);
m_forwardDestinationServers.push_back(beginForwardMessage.getValue());
case constcrc("BeginForward") : {
GenericValueTypeMessage <std::vector<uint32>> const beginForwardMessage(ri);
if (beginForwardMessage.getValue() == m_forwardDestinationServers.back())
++m_forwardCounts.back();
else {
m_forwardCounts.push_back(1);
m_forwardDestinationServers.push_back(beginForwardMessage.getValue());
}
return;
}
return;
}
}
if (msg.isType("BeginForward"))
if (constcrc("BeginForward"))
{
GenericValueTypeMessage<std::vector<uint32> > const beginForwardMessage(ri);
@@ -112,20 +111,22 @@ void PlanetServerConnection::onReceive(Archive::ByteStream const &message)
ServerConnection::onReceive(message);
if (msg.isType("CentralPlanetServerConnect"))
{
CentralPlanetServerConnect const id(ri);
sceneId = id.getSceneId();
}
else if (msg.isType("TaskSpawnProcess"))
{
TaskSpawnProcess const spawn(ri);
CentralServer::getInstance().sendTaskMessage(spawn);
}
else if (msg.isType("ConGenericMessage"))
{
ConGenericMessage const con(ri);
ConsoleConnection::onCommandComplete(con.getMsg(), static_cast<int>(con.getMsgId()));
switch (msgType) {
case constcrc("CentralPlanetServerConnect") : {
CentralPlanetServerConnect const id(ri);
sceneId = id.getSceneId();
break;
}
case constcrc("TaskSpawnProcess") : {
TaskSpawnProcess const spawn(ri);
CentralServer::getInstance().sendTaskMessage(spawn);
break;
}
case constcrc("ConGenericMessage") : {
ConGenericMessage const con(ri);
ConsoleConnection::onCommandComplete(con.getMsg(), static_cast<int>(con.getMsgId()));
break;
}
}
}
@@ -54,6 +54,8 @@
#include "sharedUtility/DataTableManager.h"
#include <vector>
#include "sharedFoundation/CrcConstexpr.hpp"
// ======================================================================
namespace ConnectionServerNamespace
{