Added serverNetworkMessages library

This commit is contained in:
Anonymous
2014-01-15 02:34:23 -07:00
parent 222d858a18
commit 77f207ef4e
698 changed files with 35405 additions and 2 deletions
@@ -0,0 +1,37 @@
// ======================================================================
//
// CentralPlanetServerConnect.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "serverNetworkMessages/FirstServerNetworkMessages.h"
#include "serverNetworkMessages/CentralPlanetServerConnect.h"
// ======================================================================
CentralPlanetServerConnect::CentralPlanetServerConnect (const std::string &sceneId, const std::string &connectionAddress, uint16 gameServerPort) :
GameNetworkMessage("CentralPlanetServerConnect"),
m_sceneId(sceneId),
m_connectionAddress(connectionAddress),
m_gameServerPort(gameServerPort)
{
addVariable(m_sceneId);
addVariable(m_connectionAddress);
addVariable(m_gameServerPort);
}
// ----------------------------------------------------------------------
CentralPlanetServerConnect::CentralPlanetServerConnect (Archive::ReadIterator &source) :
GameNetworkMessage("CentralPlanetServerConnect"),
m_sceneId()
{
addVariable(m_sceneId);
addVariable(m_connectionAddress);
addVariable(m_gameServerPort);
unpack(source);
}
// ======================================================================
@@ -0,0 +1,70 @@
// ======================================================================
//
// CentralPlanetServerConnect.h
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#ifndef INCLUDED_CentralPlanetServerConnect_H
#define INCLUDED_CentralPlanetServerConnect_H
// ======================================================================
#include <string>
#include "sharedNetworkMessages/GameNetworkMessage.h"
// ======================================================================
/**
* Identify the Planet Server to Central
* Sent From: Planet Server
* Sent To: Central
* Action: Identifies which scene this Planet Server handles.
*/
class CentralPlanetServerConnect : public GameNetworkMessage
{
public:
CentralPlanetServerConnect (const std::string &sceneId, const std::string &connectionAddress, uint16 gameServerPort);
CentralPlanetServerConnect (Archive::ReadIterator &source);
const std::string &getSceneId() const;
const std::string &getConnectionAddress() const;
uint16 getGameServerPort() const;
private:
Archive::AutoVariable<std::string> m_sceneId;
Archive::AutoVariable<std::string> m_connectionAddress;
Archive::AutoVariable<uint16> m_gameServerPort;
private:
CentralPlanetServerConnect ();
CentralPlanetServerConnect(const CentralPlanetServerConnect&);
CentralPlanetServerConnect& operator= (const CentralPlanetServerConnect&);
};
// ----------------------------------------------------------------------
inline const std::string &CentralPlanetServerConnect::getSceneId() const
{
return m_sceneId.get();
}
// ----------------------------------------------------------------------
inline const std::string &CentralPlanetServerConnect::getConnectionAddress() const
{
return m_connectionAddress.get();
}
// ----------------------------------------------------------------------
inline uint16 CentralPlanetServerConnect::getGameServerPort() const
{
return m_gameServerPort.get();
}
// ======================================================================
#endif
@@ -0,0 +1,49 @@
// ======================================================================
//
// GameServerForLoginMessage.cpp
//
// Copyright 2001-2003 Sony Online Entertainment
//
// ======================================================================
#include "serverNetworkMessages/FirstServerNetworkMessages.h"
#include "serverNetworkMessages/GameServerForLoginMessage.h"
#include "unicodeArchive/UnicodeArchive.h"
// ======================================================================
GameServerForLoginMessage::GameServerForLoginMessage(uint32 stationId, uint32 server, const NetworkId & characterId) :
GameNetworkMessage("GameServerForLoginMessage"),
m_stationId(stationId),
m_server(server),
m_characterId(characterId)
{
addVariable(m_stationId);
addVariable(m_server);
addVariable(m_characterId);
}
// ----------------------------------------------------------------------
GameServerForLoginMessage::GameServerForLoginMessage(Archive::ReadIterator &source) :
GameNetworkMessage("GameServerForLoginMessage"),
m_stationId(),
m_server(),
m_characterId()
{
addVariable(m_stationId);
addVariable(m_server);
addVariable(m_characterId);
unpack(source);
}
//-----------------------------------------------------------------------
GameServerForLoginMessage::~GameServerForLoginMessage()
{
}
// ======================================================================
@@ -0,0 +1,70 @@
// ======================================================================
//
// GameServerForLoginMessage.h
//
// Copyright 2001-2003 Sony Online Entertainment
//
// ======================================================================
#ifndef INCLUDED_GameServerForLoginMessage_H
#define INCLUDED_GameServerForLoginMessage_H
// ======================================================================
#include "sharedNetworkMessages/GameNetworkMessage.h"
#include "sharedFoundation/NetworkId.h"
// ======================================================================
/**
* Reply to RequestGameServerForLoginMessage. Identifies the game server
* to use to log in.
*
* Sent from: PlanetServer
* Sent to: ConnectionServer (via Central)
* Action: Connect the client to the specified game server
*/
class GameServerForLoginMessage : public GameNetworkMessage
{
public:
GameServerForLoginMessage(uint32 stationId, uint32 server, const NetworkId & characterId);
GameServerForLoginMessage(Archive::ReadIterator &source);
~GameServerForLoginMessage();
public:
uint32 getStationId() const;
uint32 getServer() const;
const NetworkId& getCharacterId() const;
private:
Archive::AutoVariable<uint32> m_stationId;
Archive::AutoVariable<uint32> m_server;
Archive::AutoVariable<NetworkId> m_characterId;
private:
GameServerForLoginMessage();
GameServerForLoginMessage(const GameServerForLoginMessage&);
GameServerForLoginMessage& operator= (const GameServerForLoginMessage&);
};
// ======================================================================
inline uint32 GameServerForLoginMessage::getStationId() const
{
return m_stationId.get();
}
// ----------------------------------------------------------------------
inline uint32 GameServerForLoginMessage::getServer() const
{
return m_server.get();
}
inline const NetworkId & GameServerForLoginMessage::getCharacterId() const
{
return m_characterId.get();
}
// ======================================================================
#endif
@@ -0,0 +1,60 @@
// ======================================================================
//
// RequestGameServerForLoginMessage.cpp
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#include "serverNetworkMessages/FirstServerNetworkMessages.h"
#include "serverNetworkMessages/RequestGameServerForLoginMessage.h"
//#include "PlanetGameServerMessages.h"
#include "unicodeArchive/UnicodeArchive.h"
// ======================================================================
RequestGameServerForLoginMessage::RequestGameServerForLoginMessage(uint32 stationId, const NetworkId &characterId, const NetworkId &containerId, const std::string &scene, const Vector &coordinates, bool forCtsSourceCharacter) :
GameNetworkMessage("RequestGameServerForLoginMessage"),
m_stationId(stationId),
m_characterId(characterId),
m_containerId(containerId),
m_scene(scene),
m_coordinates(coordinates),
m_forCtsSourceCharacter(forCtsSourceCharacter)
{
addVariable(m_stationId);
addVariable(m_characterId);
addVariable(m_containerId);
addVariable(m_scene);
addVariable(m_coordinates);
addVariable(m_forCtsSourceCharacter);
}
// ----------------------------------------------------------------------
RequestGameServerForLoginMessage::RequestGameServerForLoginMessage(Archive::ReadIterator & source) :
GameNetworkMessage("RequestGameServerForLoginMessage"),
m_stationId(),
m_characterId(),
m_containerId(),
m_scene(),
m_coordinates(),
m_forCtsSourceCharacter()
{
addVariable(m_stationId);
addVariable(m_characterId);
addVariable(m_containerId);
addVariable(m_scene);
addVariable(m_coordinates);
addVariable(m_forCtsSourceCharacter);
unpack(source);
}
//-----------------------------------------------------------------------
RequestGameServerForLoginMessage::~RequestGameServerForLoginMessage()
{
}
// ======================================================================
@@ -0,0 +1,98 @@
// ======================================================================
//
// RequestGameServerForLoginMessage.h
// copyright (c) 2001 Sony Online Entertainment
//
// ======================================================================
#ifndef INCLUDED_RequestGameServerForLoginMessage_H
#define INCLUDED_RequestGameServerForLoginMessage_H
// ======================================================================
#include "sharedNetworkMessages/GameNetworkMessage.h"
// ======================================================================
/**
* Pick a game server for login
*
* Sent from: ConnectionServer
* Sent to: PlanetServer (via Central)
* Action: Pick a good game server to use based on the coordinates
* specified. Reply with GameServerForLoginMessage.
*/
class RequestGameServerForLoginMessage : public GameNetworkMessage
{
public:
RequestGameServerForLoginMessage (uint32 stationId, const NetworkId &characterId, const NetworkId &containerId, const std::string &scene, const Vector &coordinates, bool forCtsSourceCharacter);
RequestGameServerForLoginMessage (Archive::ReadIterator & source);
~RequestGameServerForLoginMessage ();
public:
const std::string & getScene() const;
const Vector & getCoordinates() const;
uint32 getStationId() const;
const NetworkId & getContainerId() const;
const NetworkId & getCharacterId() const;
bool getForCtsSourceCharacter() const;
private:
Archive::AutoVariable<uint32> m_stationId;
Archive::AutoVariable<NetworkId> m_characterId;
Archive::AutoVariable<NetworkId> m_containerId;
Archive::AutoVariable<std::string> m_scene;
Archive::AutoVariable<Vector> m_coordinates;
Archive::AutoVariable<bool> m_forCtsSourceCharacter;
private:
RequestGameServerForLoginMessage();
RequestGameServerForLoginMessage(const RequestGameServerForLoginMessage&);
RequestGameServerForLoginMessage& operator= (const RequestGameServerForLoginMessage&);
};
// ======================================================================
inline const std::string &RequestGameServerForLoginMessage::getScene() const
{
return m_scene.get();
}
// ----------------------------------------------------------------------
inline const Vector &RequestGameServerForLoginMessage::getCoordinates() const
{
return m_coordinates.get();
}
// ----------------------------------------------------------------------
inline uint32 RequestGameServerForLoginMessage::getStationId() const
{
return m_stationId.get();
}
// ----------------------------------------------------------------------
inline const NetworkId &RequestGameServerForLoginMessage::getContainerId() const
{
return m_containerId.get();
}
// ----------------------------------------------------------------------
inline const NetworkId &RequestGameServerForLoginMessage::getCharacterId() const
{
return m_characterId.get();
}
// ----------------------------------------------------------------------
inline bool RequestGameServerForLoginMessage::getForCtsSourceCharacter() const
{
return m_forCtsSourceCharacter.get();
}
// ======================================================================
#endif