mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-08-03 04:19:20 -04:00
Added serverNetworkMessages library
This commit is contained in:
+69
@@ -0,0 +1,69 @@
|
||||
// CentralTaskMessages.cpp
|
||||
// copyright 2001 Verant Interactive
|
||||
// Author: Justin Randall
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#include "serverNetworkMessages/FirstServerNetworkMessages.h"
|
||||
#include "serverNetworkMessages/CentralTaskMessages.h"
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
SpawnGameServer::SpawnGameServer(const std::string & newVolumeName, const std::string & newClusterName) :
|
||||
GameNetworkMessage("SpawnGameServer"),
|
||||
clusterName(newClusterName),
|
||||
volumeName(newVolumeName)
|
||||
{
|
||||
addVariable(clusterName);
|
||||
addVariable(volumeName);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
SpawnGameServer::SpawnGameServer(Archive::ReadIterator & source) :
|
||||
GameNetworkMessage("SpawnGameServer"),
|
||||
clusterName(),
|
||||
volumeName()
|
||||
{
|
||||
addVariable(clusterName);
|
||||
addVariable(volumeName);
|
||||
unpack(source);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
SpawnGameServer::~SpawnGameServer()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
CentralGameServiceAddress::CentralGameServiceAddress(const std::string & newClientServiceAddress, const uint16 newClientServicePort) :
|
||||
GameNetworkMessage("CentralGameServiceAddress"),
|
||||
clientServiceAddress(newClientServiceAddress),
|
||||
clientServicePort(newClientServicePort)
|
||||
{
|
||||
addVariable(clientServiceAddress);
|
||||
addVariable(clientServicePort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
CentralGameServiceAddress::CentralGameServiceAddress(Archive::ReadIterator & source) :
|
||||
GameNetworkMessage("CentralGameServiceAddress"),
|
||||
clientServiceAddress(),
|
||||
clientServicePort()
|
||||
{
|
||||
addVariable(clientServiceAddress);
|
||||
addVariable(clientServicePort);
|
||||
unpack(source);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
CentralGameServiceAddress::~CentralGameServiceAddress()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
// CentralTaskMessages.h
|
||||
// copyright 2001 Verant Interactive
|
||||
// Author: Justin Randall
|
||||
|
||||
#ifndef _CentralTaskMessages_H
|
||||
#define _CentralTaskMessages_H
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#include "sharedNetworkMessages/GameNetworkMessage.h"
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
namespace CentralTaskMessageConstants
|
||||
{
|
||||
const unsigned char SpawnGameServer = 1;
|
||||
const unsigned char CentralGameServiceAddress = 2;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
class SpawnGameServer : public GameNetworkMessage
|
||||
{
|
||||
public:
|
||||
SpawnGameServer(const std::string & newVolumeName, const std::string & newClusterName);
|
||||
SpawnGameServer(Archive::ReadIterator & source);
|
||||
~SpawnGameServer();
|
||||
|
||||
const std::string & getClusterName(void) const;
|
||||
const std::string & getVolumeName(void) const;
|
||||
|
||||
private:
|
||||
Archive::AutoVariable<std::string> clusterName;
|
||||
Archive::AutoVariable<std::string> volumeName;
|
||||
|
||||
SpawnGameServer();
|
||||
SpawnGameServer(const SpawnGameServer&);
|
||||
SpawnGameServer& operator= (const SpawnGameServer&);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const std::string & SpawnGameServer::getClusterName(void) const
|
||||
{
|
||||
return clusterName.get();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const std::string & SpawnGameServer::getVolumeName(void) const
|
||||
{
|
||||
return volumeName.get();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
class CentralGameServiceAddress : public GameNetworkMessage
|
||||
{
|
||||
public:
|
||||
CentralGameServiceAddress(const std::string & newClientServiceAddress, const uint16 newClientServicePort);
|
||||
CentralGameServiceAddress(Archive::ReadIterator & source);
|
||||
~CentralGameServiceAddress();
|
||||
|
||||
const std::string & getGameServiceAddress (void) const;
|
||||
const uint16 getGameServicePort (void) const;
|
||||
private:
|
||||
Archive::AutoVariable<std::string> clientServiceAddress;
|
||||
Archive::AutoVariable<uint16> clientServicePort;
|
||||
|
||||
CentralGameServiceAddress();
|
||||
CentralGameServiceAddress(const CentralGameServiceAddress&);
|
||||
CentralGameServiceAddress& operator= (const CentralGameServiceAddress&);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const std::string & CentralGameServiceAddress::getGameServiceAddress(void) const
|
||||
{
|
||||
return clientServiceAddress.get();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const uint16 CentralGameServiceAddress::getGameServicePort(void) const
|
||||
{
|
||||
return clientServicePort.get();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#endif // _CentralTaskMessages_H
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
//========================================================================
|
||||
//
|
||||
// TaskProcessDiedMessage.cpp - tells Gameserver object baseline data has ended.
|
||||
//
|
||||
// copyright 2003 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "serverNetworkMessages/FirstServerNetworkMessages.h"
|
||||
#include "serverNetworkMessages/TaskProcessDiedMessage.h"
|
||||
|
||||
#include "serverNetworkMessages/GameGameServerMessages.h"
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param id id of object we are updating
|
||||
*/
|
||||
TaskProcessDiedMessage::TaskProcessDiedMessage(const int id, const std::string & processName) :
|
||||
GameNetworkMessage("TaskProcessDiedMessage"),
|
||||
m_processId(id),
|
||||
m_processName(processName)
|
||||
{
|
||||
addVariable(m_processId);
|
||||
addVariable(m_processName);
|
||||
|
||||
} // TaskProcessDiedMessage::TaskProcessDiedMessage
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
TaskProcessDiedMessage::TaskProcessDiedMessage(Archive::ReadIterator & source) :
|
||||
GameNetworkMessage("TaskProcessDiedMessage"),
|
||||
m_processId(),
|
||||
m_processName()
|
||||
{
|
||||
addVariable(m_processId);
|
||||
addVariable(m_processName);
|
||||
unpack(source);
|
||||
} // TaskProcessDiedMessage::TaskProcessDiedMessage
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Class destructor.
|
||||
*/
|
||||
TaskProcessDiedMessage::~TaskProcessDiedMessage()
|
||||
{
|
||||
} // TaskProcessDiedMessage::~TaskProcessDiedMessage
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
//========================================================================
|
||||
//
|
||||
// TaskProcessDiedMessage.h - tells Gameserver object baseline data has ended.
|
||||
//
|
||||
// copyright 2003 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#ifndef _INCLUDED_TaskProcessDiedMessage_H
|
||||
#define _INCLUDED_TaskProcessDiedMessage_H
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#include "sharedNetworkMessages/GameNetworkMessage.h"
|
||||
#include <string>
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
class TaskProcessDiedMessage : public GameNetworkMessage
|
||||
{
|
||||
public:
|
||||
explicit TaskProcessDiedMessage (const int processId, const std::string & processName);
|
||||
TaskProcessDiedMessage(Archive::ReadIterator & source);
|
||||
~TaskProcessDiedMessage ();
|
||||
|
||||
const int & getProcessId(void) const;
|
||||
const std::string & getProcessName(void) const;
|
||||
|
||||
private:
|
||||
Archive::AutoVariable<int> m_processId;
|
||||
Archive::AutoVariable<std::string> m_processName;
|
||||
|
||||
TaskProcessDiedMessage();
|
||||
TaskProcessDiedMessage(const TaskProcessDiedMessage&);
|
||||
TaskProcessDiedMessage& operator= (const TaskProcessDiedMessage&);
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const int & TaskProcessDiedMessage::getProcessId() const
|
||||
{
|
||||
return m_processId.get();
|
||||
} // TaskProcessDiedMessage::getId
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const std::string & TaskProcessDiedMessage::getProcessName() const
|
||||
{
|
||||
return m_processName.get();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
#endif // _INCLUDED_TaskProcessDiedMessage_H
|
||||
Reference in New Issue
Block a user