Revert "more conversions"

This reverts commit dd550b81db.
This commit is contained in:
DarthArgus
2018-05-17 17:23:55 +00:00
parent fee6bedc39
commit ce95df149f
16 changed files with 88 additions and 81 deletions
@@ -64,7 +64,7 @@ private:
typedef std::unordered_multimap<SceneId, GameServerConnection *> SceneGameMap; typedef std::unordered_multimap<SceneId, GameServerConnection *> SceneGameMap;
typedef std::pair<SceneGameMap::const_iterator, SceneGameMap::const_iterator> ServersList; typedef std::pair<SceneGameMap::const_iterator, SceneGameMap::const_iterator> ServersList;
typedef std::unordered_map<StationId, ConnectionServerConnection *> ConnectionServerSUIDMap; typedef std::unordered_map<uint32, ConnectionServerConnection *> ConnectionServerSUIDMap;
typedef std::map<NetworkId, std::pair<SceneId, time_t> > PlayerSceneMapType; typedef std::map<NetworkId, std::pair<SceneId, time_t> > PlayerSceneMapType;
@@ -5,8 +5,6 @@
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
#include "FirstChatServer.h" #include "FirstChatServer.h"
#include "sharedFoundation/StationId.h"
#include "ChatInterface.h" #include "ChatInterface.h"
#include "ChatServer.h" #include "ChatServer.h"
#include "ChatServerAvatarOwner.h" #include "ChatServerAvatarOwner.h"
@@ -53,7 +53,7 @@ struct GetAccountInfo
{ {
std::string avatarName; std::string avatarName;
NetworkId id; NetworkId id;
StationId suid; unsigned suid;
unsigned failedAttempts; unsigned failedAttempts;
}; };
@@ -394,7 +394,7 @@ unsigned VChatInterface::requestChannelCommand(ReturnAddress const & requester,
return track; return track;
} }
unsigned VChatInterface::requestConnectPlayer(StationId suid, std::string const & characterName, NetworkId const & netId, unsigned previousAttempts) unsigned VChatInterface::requestConnectPlayer(unsigned suid, std::string const & characterName, NetworkId const & netId, unsigned previousAttempts)
{ {
GetAccountInfo *info = new GetAccountInfo; GetAccountInfo *info = new GetAccountInfo;
info->avatarName = characterName; info->avatarName = characterName;
@@ -3,7 +3,6 @@
#ifndef _INCLUDED_VChatInterface_H #ifndef _INCLUDED_VChatInterface_H
#define _INCLUDED_VChatInterface_H #define _INCLUDED_VChatInterface_H
#include "sharedFoundation/StationId.h"
#include "sharedFoundation/NetworkId.h" #include "sharedFoundation/NetworkId.h"
#include <set> #include <set>
@@ -99,7 +98,7 @@ public:
unsigned command, unsigned command,
unsigned banTimeout); unsigned banTimeout);
unsigned requestConnectPlayer(StationId suid, std::string const & characterName, NetworkId const & netId, unsigned previousAttempts = 0); unsigned requestConnectPlayer(unsigned suid, std::string const & characterName, NetworkId const & netId, unsigned previousAttempts = 0);
unsigned requestChannelInfo(std::string const & channelName, ReturnAddress const & requester, bool isForGlobalBroadcast = false, std::string const & messageText = ""); unsigned requestChannelInfo(std::string const & channelName, ReturnAddress const & requester, bool isForGlobalBroadcast = false, std::string const & messageText = "");
@@ -308,7 +308,7 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg &msg) {
FATAL(clientIP.empty(), ("Remote IP is empty")); FATAL(clientIP.empty(), ("Remote IP is empty"));
DEBUG_WARNING(true, ("ConnectionServer::handleClientIdMessage - For ip %s suid is %" PRId64 " requestedSUID is %" PRId64 " and session is %s", clientIP.c_str(), m_suid, m_requestedSuid, sess.c_str())); DEBUG_WARNING(true, ("ConnectionServer::handleClientIdMessage - For ip %s suid is %" PRId64 " requestedSUID is %lu and session is %s", clientIP.c_str(), m_suid, m_requestedSuid, sess.c_str()));
webAPI api(sessURL); webAPI api(sessURL);
@@ -452,7 +452,7 @@ ClientConnection::onIdValidated(bool canLogin, bool canCreateRegularCharacter, b
ClientPermissionsMessage c(canLogin, canCreateRegularCharacter, canCreateJediCharacter, canSkipTutorial); ClientPermissionsMessage c(canLogin, canCreateRegularCharacter, canCreateJediCharacter, canSkipTutorial);
send(c, true); send(c, true);
DEBUG_REPORT_LOG(true, ("Permissions for %" PRId64 ":\n", getSUID())); DEBUG_REPORT_LOG(true, ("Permissions for %lu:\n", getSUID()));
DEBUG_REPORT_LOG(canLogin, ("\tcanLogin\n")); DEBUG_REPORT_LOG(canLogin, ("\tcanLogin\n"));
DEBUG_REPORT_LOG(canCreateRegularCharacter, ("\tcanCreateRegularCharacter\n")); DEBUG_REPORT_LOG(canCreateRegularCharacter, ("\tcanCreateRegularCharacter\n"));
DEBUG_REPORT_LOG(canCreateJediCharacter, ("\tcanCreateJediCharacter\n")); DEBUG_REPORT_LOG(canCreateJediCharacter, ("\tcanCreateJediCharacter\n"));
@@ -953,7 +953,7 @@ void ClientConnection::onReceive(const Archive::ByteStream &message) {
if (m_hasBeenValidated && !m_hasSelectedCharacter) //lint !e774 no this doesn't always eval to true if (m_hasBeenValidated && !m_hasSelectedCharacter) //lint !e774 no this doesn't always eval to true
{ {
ClientCreateCharacter clientCreate(ri); ClientCreateCharacter clientCreate(ri);
DEBUG_REPORT_LOG(true, ("Got ClientCreateCharacter message for %" PRId64 " with name %s\n", m_suid, Unicode::wideToNarrow(clientCreate.getCharacterName()).c_str())); DEBUG_REPORT_LOG(true, ("Got ClientCreateCharacter message for %lu with name %s\n", m_suid, Unicode::wideToNarrow(clientCreate.getCharacterName()).c_str()));
LOG("TraceCharacterCreation", ("%d sent ClientCreateCharacter(charaterName=%s, templateName=%s, scaleFactor=%f, startingLocation=%s, hairTemplateName=%s, profession=%s, jedi=%d, useNewbieTutorial=%d, skillTemplate=%s, workingSkill=%s)", getSUID(), Unicode::wideToNarrow(clientCreate.getCharacterName()).c_str(), clientCreate.getTemplateName().c_str(), clientCreate.getScaleFactor(), clientCreate.getStartingLocation().c_str(), clientCreate.getHairTemplateName().c_str(), clientCreate.getProfession().c_str(), static_cast<int>(clientCreate.getJedi()), static_cast<int>(clientCreate.getUseNewbieTutorial()), clientCreate.getSkillTemplate().c_str(), clientCreate.getWorkingSkill().c_str())); LOG("TraceCharacterCreation", ("%d sent ClientCreateCharacter(charaterName=%s, templateName=%s, scaleFactor=%f, startingLocation=%s, hairTemplateName=%s, profession=%s, jedi=%d, useNewbieTutorial=%d, skillTemplate=%s, workingSkill=%s)", getSUID(), Unicode::wideToNarrow(clientCreate.getCharacterName()).c_str(), clientCreate.getTemplateName().c_str(), clientCreate.getScaleFactor(), clientCreate.getStartingLocation().c_str(), clientCreate.getHairTemplateName().c_str(), clientCreate.getProfession().c_str(), static_cast<int>(clientCreate.getJedi()), static_cast<int>(clientCreate.getUseNewbieTutorial()), clientCreate.getSkillTemplate().c_str(), clientCreate.getWorkingSkill().c_str()));
if (!clientCreate.getUseNewbieTutorial() && !m_canSkipTutorial) { if (!clientCreate.getUseNewbieTutorial() && !m_canSkipTutorial) {
@@ -1232,7 +1232,7 @@ void
ClientConnection::onCharacterValidated(bool isValid, const NetworkId &character, const std::string &characterName, const NetworkId &container, const std::string &scene, const Vector &coordinates) { ClientConnection::onCharacterValidated(bool isValid, const NetworkId &character, const std::string &characterName, const NetworkId &container, const std::string &scene, const Vector &coordinates) {
if (!m_validatingCharacter) { if (!m_validatingCharacter) {
LOG("TraceCharacterSelection", ("%d received a validation response, but is not in the process of validation", getSUID())); LOG("TraceCharacterSelection", ("%d received a validation response, but is not in the process of validation", getSUID()));
DEBUG_REPORT_LOG(true, ("Got unexpected onCharacterValidated() for account %" PRId64 ".\n", getSUID())); DEBUG_REPORT_LOG(true, ("Got unexpected onCharacterValidated() for account %lu.\n", getSUID()));
return; return;
} }
m_validatingCharacter = false; m_validatingCharacter = false;
@@ -1405,7 +1405,7 @@ ClientConnection::onValidateClient(StationId suid, const std::string &username,
// ask CentralServer to tell all other ConnectionServers on this galaxy to drop duplicate connections for this account // ask CentralServer to tell all other ConnectionServers on this galaxy to drop duplicate connections for this account
// and ask CentralServer (via LoginServer) to tell all ConnectionServers on other galaxies to drop duplicate connections for this account // and ask CentralServer (via LoginServer) to tell all ConnectionServers on other galaxies to drop duplicate connections for this account
if (!m_usingAdminLogin && !m_isSecure) { if (!m_usingAdminLogin && !m_isSecure) {
GenericValueTypeMessage <std::pair<StationId, std::string>> const dropDuplicateConnections("ConnSrvDropDupeConns", std::make_pair(m_suid, m_sessionId)); GenericValueTypeMessage <std::pair<uint32, std::string>> const dropDuplicateConnections("ConnSrvDropDupeConns", std::make_pair(m_suid, m_sessionId));
ConnectionServer::sendToCentralProcess(dropDuplicateConnections); ConnectionServer::sendToCentralProcess(dropDuplicateConnections);
} }
} }
@@ -1418,9 +1418,9 @@ std::string ClientConnection::describeAccount(const ClientConnection *c) {
char idbuf[512] = {"\0"}; char idbuf[512] = {"\0"};
const std::string &sessionId = c->getSessionId(); const std::string &sessionId = c->getSessionId();
if (sessionId.empty()) { if (sessionId.empty()) {
snprintf(idbuf, sizeof(idbuf), " (%" PRId64 ")", c->m_suid); snprintf(idbuf, sizeof(idbuf), " (%lu)", c->m_suid);
} else { } else {
snprintf(idbuf, sizeof(idbuf), " (%" PRId64 ", %s)", c->m_suid, sessionId.c_str()); snprintf(idbuf, sizeof(idbuf), " (%lu, %s)", c->m_suid, sessionId.c_str());
} }
result = c->m_accountName; result = c->m_accountName;
@@ -59,7 +59,7 @@ public:
Client * getClient (); Client * getClient ();
void setClient (Client* client); void setClient (Client* client);
StationId getSUID () const; uint32 getSUID () const;
const bool getHasSelectedCharacter () const; const bool getHasSelectedCharacter () const;
bool getHasBeenSentToGameServer () const; bool getHasBeenSentToGameServer () const;
@@ -205,9 +205,9 @@ inline const StationId hashOldSoeSUID(std::string name) {
char brokenSuid[50]; char brokenSuid[50];
uint32_t hash; uint32_t hash;
if (name.size() > 15) { //if (name.size() > MAX_ACCOUNT_NAME_LENGTH) {
name.resize(15); // name.resize(MAX_ACCOUNT_NAME_LENGTH);
} //}
// use SOE's shitty method for generating unique id's // use SOE's shitty method for generating unique id's
hash = static_cast<uint32_t>(std::hash < std::string > {}(name.c_str())); hash = static_cast<uint32_t>(std::hash < std::string > {}(name.c_str()));
@@ -271,7 +271,7 @@ inline const std::string & ClientConnection::getTargetSecene() const
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
inline StationId ClientConnection::getSUID() const inline uint32 ClientConnection::getSUID() const
{ {
return m_suid; return m_suid;
} }
@@ -364,15 +364,27 @@ void ConnectionServer::dropClient(ClientConnection *conn, const std::string &des
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// void ConnectionServer::addPendingCharacter(uint32 suid, ClientConnection* conn)
// {
// if (pendingMap.find(suid) == pendingMap.end())
// pendingMap[suid] = conn;
// else
// {
// WARNING_STRICT_FATAL(true, ("Attepting to add duplicate pending chatacter"));
// pendingMap[suid] = conn;
// }
// }
void ConnectionServer::addConnectedClient(StationId suid, ClientConnection *conn) { //-----------------------------------------------------------------------
void ConnectionServer::addConnectedClient(uint32 suid, ClientConnection *conn) {
static ConnectionServer &cs = instance(); static ConnectionServer &cs = instance();
cs.addToConnectedMap(suid, conn); cs.addToConnectedMap(suid, conn);
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
ClientConnection *ConnectionServer::getClientConnection(const StationId suid) { ClientConnection *ConnectionServer::getClientConnection(const uint32 suid) {
static ConnectionServer &cs = instance(); static ConnectionServer &cs = instance();
ClientConnection *result = 0; ClientConnection *result = 0;
SuidMap::const_iterator i = cs.connectedMap.find(suid); SuidMap::const_iterator i = cs.connectedMap.find(suid);
@@ -1058,7 +1070,7 @@ void ConnectionServer::unsetupConnections() {
SuidMap::iterator i = instance().connectedMap.begin(); SuidMap::iterator i = instance().connectedMap.begin();
if (i != instance().connectedMap.end()) { if (i != instance().connectedMap.end()) {
ClientConnection *c = (*i).second; ClientConnection *c = (*i).second;
StationId suid = (*i).first; uint32 suid = (*i).first;
IGNORE_RETURN(instance().connectedMap.erase(suid)); IGNORE_RETURN(instance().connectedMap.erase(suid));
if (c) { if (c) {
ConnectionServer::dropClient(c, "ConnectionServer shutting down."); ConnectionServer::dropClient(c, "ConnectionServer shutting down.");
@@ -1245,7 +1257,7 @@ int ConnectionServer::getNumberOfGameServers() {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
void ConnectionServer::removeConnectedCharacter(StationId suid) { void ConnectionServer::removeConnectedCharacter(uint32 suid) {
static ConnectionServer &cs = instance(); static ConnectionServer &cs = instance();
cs.removeFromConnectedMap(suid); cs.removeFromConnectedMap(suid);
} }
@@ -1311,7 +1323,7 @@ void ConnectionServer::removeFromClientMap(const NetworkId &oid) {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
void ConnectionServer::addToConnectedMap(StationId suid, ClientConnection *cconn) { void ConnectionServer::addToConnectedMap(uint32 suid, ClientConnection *cconn) {
SuidMap::iterator i = connectedMap.find(suid); SuidMap::iterator i = connectedMap.find(suid);
if (i == connectedMap.end()) { if (i == connectedMap.end()) {
connectedMap[suid] = cconn; connectedMap[suid] = cconn;
@@ -1332,7 +1344,7 @@ void ConnectionServer::addToConnectedMap(StationId suid, ClientConnection *cconn
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
void ConnectionServer::removeFromConnectedMap(StationId suid) { void ConnectionServer::removeFromConnectedMap(uint32 suid) {
SuidMap::iterator i = connectedMap.find(suid); SuidMap::iterator i = connectedMap.find(suid);
if (i != connectedMap.end()) { if (i != connectedMap.end()) {
connectedMap.erase(i); connectedMap.erase(i);
@@ -42,11 +42,11 @@ class ConnectionServer : public MessageDispatch::Receiver
typedef std::unordered_map<uint32, GameConnection *> GameServerMap; typedef std::unordered_map<uint32, GameConnection *> GameServerMap;
typedef std::unordered_map<NetworkId, Client *,NetworkId::Hash> ClientMap; typedef std::unordered_map<NetworkId, Client *,NetworkId::Hash> ClientMap;
typedef std::unordered_map<StationId, ClientConnection *> SuidMap; typedef std::unordered_map<uint32, ClientConnection *> SuidMap;
typedef std::set<uint32> FreeTrialsSet; typedef std::set<uint32> FreeTrialsSet;
static void addNewClient(ClientConnection* cconn, const NetworkId &oid, GameConnection* gconn, const std::string &sceneName, bool sendToStarport ); static void addNewClient(ClientConnection* cconn, const NetworkId &oid, GameConnection* gconn, const std::string &sceneName, bool sendToStarport );
static void addConnectedClient(StationId suid, ClientConnection* conn); static void addConnectedClient(uint32 suid, ClientConnection* conn);
static void addGameConnection(unsigned long gameServerId, GameConnection* gc); static void addGameConnection(unsigned long gameServerId, GameConnection* gc);
static bool decryptToken(const KeyShare::Token & token, uint32 & stationUserId, bool & secure, std::string & accountName); static bool decryptToken(const KeyShare::Token & token, uint32 & stationUserId, bool & secure, std::string & accountName);
static bool decryptToken(const KeyShare::Token & token, char* sessionKey, StationId & stationId); static bool decryptToken(const KeyShare::Token & token, char* sessionKey, StationId & stationId);
@@ -59,7 +59,7 @@ class ConnectionServer : public MessageDispatch::Receiver
static const ClientMap & getClientMap(); static const ClientMap & getClientMap();
static Service * getClientServicePrivate (); static Service * getClientServicePrivate ();
static Service * getClientServicePublic (); static Service * getClientServicePublic ();
static ClientConnection* getClientConnection(StationId suid); static ClientConnection* getClientConnection(uint32 suid);
static uint16 getPingPort (); static uint16 getPingPort ();
static int getPingTrafficNumBytes(); static int getPingTrafficNumBytes();
static int getNumberOfClients(); static int getNumberOfClients();
@@ -74,7 +74,7 @@ class ConnectionServer : public MessageDispatch::Receiver
static KeyShare::Token makeToken(const unsigned char * newData, const uint32 dataLen); static KeyShare::Token makeToken(const unsigned char * newData, const uint32 dataLen);
static void pushKey(const KeyShare::Key & newKey); static void pushKey(const KeyShare::Key & newKey);
void receiveMessage(const MessageDispatch::Emitter & source, const MessageDispatch::MessageBase & message); void receiveMessage(const MessageDispatch::Emitter & source, const MessageDispatch::MessageBase & message);
static void removeConnectedCharacter(StationId suid); static void removeConnectedCharacter(uint32 suid);
static void run(void); static void run(void);
static void sendToCentralProcess(const GameNetworkMessage& msg); static void sendToCentralProcess(const GameNetworkMessage& msg);
static void addRecoveringClient(const NetworkId& networkId); static void addRecoveringClient(const NetworkId& networkId);
@@ -94,8 +94,8 @@ private:
void addToClientMap(const NetworkId &oid, ClientConnection* cconn); void addToClientMap(const NetworkId &oid, ClientConnection* cconn);
void removeFromClientMap(const NetworkId &oid); void removeFromClientMap(const NetworkId &oid);
void addToConnectedMap(StationId suid, ClientConnection* conn); void addToConnectedMap(uint32 suid, ClientConnection* conn);
void removeFromConnectedMap(StationId suid); void removeFromConnectedMap(uint32 suid);
void updatePopulationOnCentralServer(); void updatePopulationOnCentralServer();
@@ -81,9 +81,9 @@ inline const StationId hashOldSoeSUID(std::string name) {
char brokenSuid[50]; char brokenSuid[50];
uint32_t hash; uint32_t hash;
if (name.size() > 15) { //if (name.size() > MAX_ACCOUNT_NAME_LENGTH) {
name.resize(15); // name.resize(MAX_ACCOUNT_NAME_LENGTH);
} //}
// use SOE's shitty method for generating unique id's // use SOE's shitty method for generating unique id's
hash = static_cast<uint32_t>(std::hash < std::string > {}(name.c_str())); hash = static_cast<uint32_t>(std::hash < std::string > {}(name.c_str()));
@@ -1284,7 +1284,7 @@ LoginServer::onValidateClient(StationId suid, const std::string &username, Clien
} }
} else { } else {
// If we aren't validating sessions, pack username, security status, and username to connectionserver // If we aren't validating sessions, pack username, security status, and username to connectionserver
memcpy(keyBufferPointer, &suid, sizeof(StationId)); //lint !e64 !e119 !e534 (lint isn't resolving memcpy properly) memcpy(keyBufferPointer, &suid, sizeof(uint32)); //lint !e64 !e119 !e534 (lint isn't resolving memcpy properly)
keyBufferPointer += sizeof(uint32); keyBufferPointer += sizeof(uint32);
memcpy(keyBufferPointer, &isSecure, sizeof(bool)); //lint !e64 !e119 !e534 memcpy(keyBufferPointer, &isSecure, sizeof(bool)); //lint !e64 !e119 !e534
keyBufferPointer += sizeof(bool); keyBufferPointer += sizeof(bool);
@@ -1295,7 +1295,7 @@ LoginServer::onValidateClient(StationId suid, const std::string &username, Clien
Archive::ByteStream a; Archive::ByteStream a;
token.pack(a); token.pack(a);
const LoginClientToken k(a.getBuffer(), static_cast<unsigned char>(a.getSize()), static_cast<StationId>(suid), username); const LoginClientToken k(a.getBuffer(), static_cast<unsigned char>(a.getSize()), static_cast<uint32>(suid), username);
conn->send(k, true); conn->send(k, true);
delete[] keyBuffer; delete[] keyBuffer;
@@ -121,7 +121,7 @@ ConnectionKeyPush::~ConnectionKeyPush()
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
LoggedInMessage::LoggedInMessage(StationId accountNumber) : LoggedInMessage::LoggedInMessage(uint32 accountNumber) :
GameNetworkMessage("LoggedInMessage"), GameNetworkMessage("LoggedInMessage"),
m_accountNumber(accountNumber) m_accountNumber(accountNumber)
{ {
@@ -146,7 +146,7 @@ LoggedInMessage::~LoggedInMessage()
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
ConnEnumerateCharacterId::ConnEnumerateCharacterId(StationId newAccountNumber, const Unicode::String & newName, const std::string & newLocation, const std::string & newObjectTemplate) : ConnEnumerateCharacterId::ConnEnumerateCharacterId(uint32 newAccountNumber, const Unicode::String & newName, const std::string & newLocation, const std::string & newObjectTemplate) :
GameNetworkMessage("ConnEnumerateCharacterId"), GameNetworkMessage("ConnEnumerateCharacterId"),
accountNumber(newAccountNumber), accountNumber(newAccountNumber),
location(newLocation), location(newLocation),
@@ -182,7 +182,7 @@ ConnEnumerateCharacterId::~ConnEnumerateCharacterId()
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
ConnectionCreateCharacter::ConnectionCreateCharacter(const StationId newStationId, const Unicode::String & newCharacterName, const std::string & newTemplateName, float scaleFactor, const std::string & newStartingLocation, const std::string & newAppearanceData, const std::string & newHairTemplateName, const std::string & hairAppearanceData, const std::string & profession, bool jedi, const Unicode::String & biography, bool useNewbieTutorial, const std::string & skillTemplate, const std::string & workingSkill, bool noRateLimit, bool isForCharacterTransfer, StationId gameFeatures) : ConnectionCreateCharacter::ConnectionCreateCharacter(const uint32 newStationId, const Unicode::String & newCharacterName, const std::string & newTemplateName, float scaleFactor, const std::string & newStartingLocation, const std::string & newAppearanceData, const std::string & newHairTemplateName, const std::string & hairAppearanceData, const std::string & profession, bool jedi, const Unicode::String & biography, bool useNewbieTutorial, const std::string & skillTemplate, const std::string & workingSkill, bool noRateLimit, bool isForCharacterTransfer, uint32 gameFeatures) :
GameNetworkMessage("ConnectionCreateCharacter"), GameNetworkMessage("ConnectionCreateCharacter"),
m_appearanceData(newAppearanceData), m_appearanceData(newAppearanceData),
m_characterName(newCharacterName), m_characterName(newCharacterName),
@@ -278,7 +278,7 @@ const float ConnectionCreateCharacter::getScaleFactor () const
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
ConnectionCreateCharacterSuccess::ConnectionCreateCharacterSuccess(StationId suid, const NetworkId & networkId) : ConnectionCreateCharacterSuccess::ConnectionCreateCharacterSuccess(uint32 suid, const NetworkId & networkId) :
GameNetworkMessage("ConnectionCreateCharacterSuccess"), GameNetworkMessage("ConnectionCreateCharacterSuccess"),
stationId(suid), stationId(suid),
m_networkId (networkId) m_networkId (networkId)
@@ -307,7 +307,7 @@ ConnectionCreateCharacterSuccess::~ConnectionCreateCharacterSuccess()
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
ConnectionCreateCharacterFailed::ConnectionCreateCharacterFailed(StationId newStationId, const Unicode::String &name, const StringId &errorMessage, const std::string &optionalDetailedErrorMessage) : ConnectionCreateCharacterFailed::ConnectionCreateCharacterFailed(uint32 newStationId, const Unicode::String &name, const StringId &errorMessage, const std::string &optionalDetailedErrorMessage) :
GameNetworkMessage("ConnectionCreateCharacterFailed"), GameNetworkMessage("ConnectionCreateCharacterFailed"),
m_name(name), m_name(name),
m_errorMessage(errorMessage), m_errorMessage(errorMessage),
@@ -186,14 +186,14 @@ inline const KeyShare::Key & ConnectionKeyPush::getKey(void) const
class LoggedInMessage : public GameNetworkMessage class LoggedInMessage : public GameNetworkMessage
{ {
public: public:
LoggedInMessage (StationId accountNumber); LoggedInMessage (uint32 accountNumber);
LoggedInMessage (Archive::ReadIterator & source); LoggedInMessage (Archive::ReadIterator & source);
~LoggedInMessage (); ~LoggedInMessage ();
StationId getAccountNumber(void) const; uint32 getAccountNumber(void) const;
private: private:
Archive::AutoVariable<StationId> m_accountNumber; Archive::AutoVariable<uint32> m_accountNumber;
LoggedInMessage(); LoggedInMessage();
LoggedInMessage(const LoggedInMessage&); LoggedInMessage(const LoggedInMessage&);
@@ -202,7 +202,7 @@ class LoggedInMessage : public GameNetworkMessage
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
inline StationId LoggedInMessage::getAccountNumber(void) const inline uint32 LoggedInMessage::getAccountNumber(void) const
{ {
return m_accountNumber.get(); return m_accountNumber.get();
} }
@@ -212,18 +212,18 @@ inline StationId LoggedInMessage::getAccountNumber(void) const
class ConnEnumerateCharacterId : public GameNetworkMessage class ConnEnumerateCharacterId : public GameNetworkMessage
{ {
public: public:
ConnEnumerateCharacterId(StationId newAccountNumber, const Unicode::String & newName, const std::string & newLocation, const std::string & newObjectTemplate); ConnEnumerateCharacterId(uint32 newAccountNumber, const Unicode::String & newName, const std::string & newLocation, const std::string & newObjectTemplate);
explicit ConnEnumerateCharacterId(Archive::ReadIterator & source); explicit ConnEnumerateCharacterId(Archive::ReadIterator & source);
~ConnEnumerateCharacterId(); ~ConnEnumerateCharacterId();
const StationId getAccountNumber (void) const; const uint32 getAccountNumber (void) const;
const std::string & getLocation (void) const; const std::string & getLocation (void) const;
const Unicode::String & getName (void) const; const Unicode::String & getName (void) const;
const std::string & getObjectTemplate (void) const; const std::string & getObjectTemplate (void) const;
private: private:
Archive::AutoVariable<StationId> accountNumber; Archive::AutoVariable<uint32> accountNumber;
Archive::AutoVariable<std::string> location; Archive::AutoVariable<std::string> location;
Archive::AutoVariable<Unicode::String> name; Archive::AutoVariable<Unicode::String> name;
Archive::AutoVariable<std::string> objectTemplate; Archive::AutoVariable<std::string> objectTemplate;
@@ -235,7 +235,7 @@ private:
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
inline const StationId ConnEnumerateCharacterId::getAccountNumber(void) const inline const uint32 ConnEnumerateCharacterId::getAccountNumber(void) const
{ {
return accountNumber.get(); return accountNumber.get();
} }
@@ -266,7 +266,7 @@ inline const std::string & ConnEnumerateCharacterId::getObjectTemplate(void) con
class ConnectionCreateCharacter : public GameNetworkMessage class ConnectionCreateCharacter : public GameNetworkMessage
{ {
public: public:
ConnectionCreateCharacter(StationId stationId, const Unicode::String & characterName, const std::string & templateName, float scaleFactor, const std::string & startingLocation, const std::string & newAppeareanceData, const std::string & hairTemplateName, const std::string & hairAppearanceData, const std::string & profession, bool jedi, const Unicode::String & biography, bool useNewbieTutorial, const std::string & skillTemplate, const std::string & workingSkill, bool noRateLimit, bool isForCharacterTransfer, StationId gameFeatures); ConnectionCreateCharacter(uint32 stationId, const Unicode::String & characterName, const std::string & templateName, float scaleFactor, const std::string & startingLocation, const std::string & newAppeareanceData, const std::string & hairTemplateName, const std::string & hairAppearanceData, const std::string & profession, bool jedi, const Unicode::String & biography, bool useNewbieTutorial, const std::string & skillTemplate, const std::string & workingSkill, bool noRateLimit, bool isForCharacterTransfer, uint32 gameFeatures);
explicit ConnectionCreateCharacter(Archive::ReadIterator & source); explicit ConnectionCreateCharacter(Archive::ReadIterator & source);
~ConnectionCreateCharacter(); ~ConnectionCreateCharacter();
@@ -276,7 +276,7 @@ public:
const std::string & getHairTemplateName() const; const std::string & getHairTemplateName() const;
const std::string & getHairAppearanceData () const; const std::string & getHairAppearanceData () const;
const std::string & getStartingLocation() const; const std::string & getStartingLocation() const;
const StationId getStationId() const; const uint32 getStationId() const;
const std::string & getTemplateName() const; const std::string & getTemplateName() const;
const std::string & getProfession() const; const std::string & getProfession() const;
const bool getJedi() const; const bool getJedi() const;
@@ -286,7 +286,7 @@ public:
const std::string & getWorkingSkill() const; const std::string & getWorkingSkill() const;
const bool getNoRateLimit() const; const bool getNoRateLimit() const;
const bool getIsForCharacterTransfer() const; const bool getIsForCharacterTransfer() const;
const StationId getGameFeatures() const; const uint32 getGameFeatures() const;
private: private:
@@ -296,7 +296,7 @@ private:
Archive::AutoVariable<std::string> m_startingLocation; Archive::AutoVariable<std::string> m_startingLocation;
Archive::AutoVariable<std::string> m_hairTemplateName; Archive::AutoVariable<std::string> m_hairTemplateName;
Archive::AutoVariable<std::string> m_hairAppearanceData; Archive::AutoVariable<std::string> m_hairAppearanceData;
Archive::AutoVariable<StationId> m_stationId; Archive::AutoVariable<uint32> m_stationId;
Archive::AutoVariable<std::string> m_profession; Archive::AutoVariable<std::string> m_profession;
Archive::AutoVariable<bool> m_jedi; Archive::AutoVariable<bool> m_jedi;
Archive::AutoVariable<float> m_scaleFactor; Archive::AutoVariable<float> m_scaleFactor;
@@ -306,7 +306,7 @@ private:
Archive::AutoVariable<std::string> m_workingSkill; Archive::AutoVariable<std::string> m_workingSkill;
Archive::AutoVariable<bool> m_noRateLimit; Archive::AutoVariable<bool> m_noRateLimit;
Archive::AutoVariable<bool> m_isForCharacterTransfer; Archive::AutoVariable<bool> m_isForCharacterTransfer;
Archive::AutoVariable<StationId> m_gameFeatures; Archive::AutoVariable<uint32> m_gameFeatures;
ConnectionCreateCharacter(); ConnectionCreateCharacter();
ConnectionCreateCharacter(const ConnectionCreateCharacter&); ConnectionCreateCharacter(const ConnectionCreateCharacter&);
@@ -356,7 +356,7 @@ inline const std::string & ConnectionCreateCharacter::getStartingLocation(void)
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
inline const StationId ConnectionCreateCharacter::getStationId(void) const inline const uint32 ConnectionCreateCharacter::getStationId(void) const
{ {
return m_stationId.get(); return m_stationId.get();
} }
@@ -417,7 +417,7 @@ inline const bool ConnectionCreateCharacter::getNoRateLimit() const
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
inline const StationId ConnectionCreateCharacter::getGameFeatures() const inline const uint32 ConnectionCreateCharacter::getGameFeatures() const
{ {
return m_gameFeatures.get(); return m_gameFeatures.get();
} }
@@ -427,15 +427,15 @@ inline const StationId ConnectionCreateCharacter::getGameFeatures() const
class ConnectionCreateCharacterSuccess : public GameNetworkMessage class ConnectionCreateCharacterSuccess : public GameNetworkMessage
{ {
public: public:
ConnectionCreateCharacterSuccess (StationId stationId, const NetworkId & id); ConnectionCreateCharacterSuccess (uint32 stationId, const NetworkId & id);
explicit ConnectionCreateCharacterSuccess(Archive::ReadIterator & source); explicit ConnectionCreateCharacterSuccess(Archive::ReadIterator & source);
~ConnectionCreateCharacterSuccess(); ~ConnectionCreateCharacterSuccess();
StationId getStationId () const; uint32 getStationId () const;
const NetworkId & getNetworkId () const; const NetworkId & getNetworkId () const;
private: private:
Archive::AutoVariable<StationId> stationId; Archive::AutoVariable<uint32> stationId;
Archive::AutoVariable<NetworkId> m_networkId; Archive::AutoVariable<NetworkId> m_networkId;
ConnectionCreateCharacterSuccess(); ConnectionCreateCharacterSuccess();
@@ -444,7 +444,7 @@ private:
}; };
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
inline StationId ConnectionCreateCharacterSuccess::getStationId() const inline uint32 ConnectionCreateCharacterSuccess::getStationId() const
{ {
return stationId.get(); return stationId.get();
} }
@@ -461,21 +461,21 @@ inline const NetworkId & ConnectionCreateCharacterSuccess::getNetworkId () const
class ConnectionCreateCharacterFailed : public GameNetworkMessage class ConnectionCreateCharacterFailed : public GameNetworkMessage
{ {
public: public:
ConnectionCreateCharacterFailed(StationId stationId, const Unicode::String &name, const StringId &errorMessage, const std::string &optionalDetailedErrorMessage); ConnectionCreateCharacterFailed(uint32 stationId, const Unicode::String &name, const StringId &errorMessage, const std::string &optionalDetailedErrorMessage);
explicit ConnectionCreateCharacterFailed(Archive::ReadIterator & source); explicit ConnectionCreateCharacterFailed(Archive::ReadIterator & source);
~ConnectionCreateCharacterFailed(); ~ConnectionCreateCharacterFailed();
const Unicode::String &getName() const; const Unicode::String &getName() const;
const StringId &getErrorMessage() const; const StringId &getErrorMessage() const;
const std::string &getOptionalDetailedErrorMessage() const; const std::string &getOptionalDetailedErrorMessage() const;
StationId getStationId() const; uint32 getStationId() const;
private: private:
Archive::AutoVariable<Unicode::String> m_name; Archive::AutoVariable<Unicode::String> m_name;
Archive::AutoVariable<StringId> m_errorMessage; Archive::AutoVariable<StringId> m_errorMessage;
Archive::AutoVariable<std::string> m_optionalDetailedErrorMessage; Archive::AutoVariable<std::string> m_optionalDetailedErrorMessage;
Archive::AutoVariable<StationId> stationId; Archive::AutoVariable<uint32> stationId;
ConnectionCreateCharacterFailed(); ConnectionCreateCharacterFailed();
ConnectionCreateCharacterFailed(const ConnectionCreateCharacterFailed & source); ConnectionCreateCharacterFailed(const ConnectionCreateCharacterFailed & source);
@@ -505,7 +505,7 @@ inline const std::string &ConnectionCreateCharacterFailed::getOptionalDetailedEr
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
inline StationId ConnectionCreateCharacterFailed::getStationId() const inline uint32 ConnectionCreateCharacterFailed::getStationId() const
{ {
return stationId.get(); return stationId.get();
} }
@@ -515,14 +515,14 @@ inline StationId ConnectionCreateCharacterFailed::getStationId() const
class ConnectionRandomNameRequest: public GameNetworkMessage class ConnectionRandomNameRequest: public GameNetworkMessage
{ {
public: public:
explicit ConnectionRandomNameRequest(StationId stationId, const std::string &creatureTemplate); explicit ConnectionRandomNameRequest(uint32 stationId, const std::string &creatureTemplate);
explicit ConnectionRandomNameRequest(Archive::ReadIterator & source); explicit ConnectionRandomNameRequest(Archive::ReadIterator & source);
~ConnectionRandomNameRequest(); ~ConnectionRandomNameRequest();
const StationId getStationId() const; const uint32 getStationId() const;
const std::string &getCreatureTemplate() const; const std::string &getCreatureTemplate() const;
private: private:
Archive::AutoVariable<StationId> m_stationId; Archive::AutoVariable<uint32> m_stationId;
Archive::AutoVariable<std::string> m_creatureTemplate; Archive::AutoVariable<std::string> m_creatureTemplate;
ConnectionRandomNameRequest(const ConnectionRandomNameRequest & source); ConnectionRandomNameRequest(const ConnectionRandomNameRequest & source);
@@ -531,7 +531,7 @@ private:
//-------------------------------------------------------------------- //--------------------------------------------------------------------
inline const StationId ConnectionRandomNameRequest::getStationId() const inline const uint32 ConnectionRandomNameRequest::getStationId() const
{ {
return m_stationId.get(); return m_stationId.get();
} }
@@ -548,15 +548,15 @@ inline const std::string &ConnectionRandomNameRequest::getCreatureTemplate() con
class ConnectionRandomNameResponse: public GameNetworkMessage class ConnectionRandomNameResponse: public GameNetworkMessage
{ {
public: public:
explicit ConnectionRandomNameResponse(StationId stationId, const std::string &creatureTemplate, const Unicode::String &name); explicit ConnectionRandomNameResponse(uint32 stationId, const std::string &creatureTemplate, const Unicode::String &name);
explicit ConnectionRandomNameResponse(Archive::ReadIterator & source); explicit ConnectionRandomNameResponse(Archive::ReadIterator & source);
~ConnectionRandomNameResponse(); ~ConnectionRandomNameResponse();
const StationId getStationId() const; const uint32 getStationId() const;
const std::string &getCreatureTemplate() const; const std::string &getCreatureTemplate() const;
const Unicode::String &getName() const; const Unicode::String &getName() const;
private: private:
Archive::AutoVariable<StationId> m_stationId; Archive::AutoVariable<uint32> m_stationId;
Archive::AutoVariable<std::string> m_creatureTemplate; Archive::AutoVariable<std::string> m_creatureTemplate;
Archive::AutoVariable<Unicode::String> m_name; Archive::AutoVariable<Unicode::String> m_name;
@@ -566,7 +566,7 @@ private:
//-------------------------------------------------------------------- //--------------------------------------------------------------------
inline const StationId ConnectionRandomNameResponse::getStationId() const inline const uint32 ConnectionRandomNameResponse::getStationId() const
{ {
return m_stationId.get(); return m_stationId.get();
} }
@@ -65,7 +65,7 @@ const std::string & AdminAccountManager::getAdminTagName()
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// if they are in the iff and have a level set, return it // if they are in the iff and have a level set, return it
int AdminAccountManager::isAdminAccount(StationId suid, bool useOldSuid) int AdminAccountManager::isAdminAccount(uint32 suid, bool useOldSuid)
{ {
DEBUG_FATAL(!ms_installed, ("AdminAccountManager not installed")); DEBUG_FATAL(!ms_installed, ("AdminAccountManager not installed"));
@@ -5,8 +5,6 @@
#ifndef _AdminAccountManager_H #ifndef _AdminAccountManager_H
#define _AdminAccountManager_H #define _AdminAccountManager_H
#include "sharedFoundation/StationId.h"
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
class DataTable; class DataTable;
@@ -21,7 +19,7 @@ public:
static const char *getAdminCommandName(); static const char *getAdminCommandName();
static const std::string & getAdminTagName(); static const std::string & getAdminTagName();
static int isAdminAccount(StationId suid, bool useOldSuid = false); static int isAdminAccount(uint32 suid, bool useOldSuid = false);
static bool isAdminAccount(const std::string & account, int& level); static bool isAdminAccount(const std::string & account, int& level);
static bool isInternalIp(const std::string & addr); static bool isInternalIp(const std::string & addr);
static void reload(); static void reload();
@@ -50,7 +50,7 @@ LoginClientId::~LoginClientId()
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
LoginClientToken::LoginClientToken(const unsigned char * const newToken, const unsigned char newTokenSize, StationId suid, const std::string & username) : LoginClientToken::LoginClientToken(const unsigned char * const newToken, const unsigned char newTokenSize, uint32 suid, const std::string & username) :
GameNetworkMessage("LoginClientToken"), GameNetworkMessage("LoginClientToken"),
token (), token (),
tokenData (0), tokenData (0),
@@ -63,20 +63,20 @@ inline const std::string & LoginClientId::getVersion() const
class LoginClientToken : public GameNetworkMessage class LoginClientToken : public GameNetworkMessage
{ {
public: public:
LoginClientToken(const unsigned char * const newToken, const unsigned char newTokenSize, StationId suid, const std::string & username); LoginClientToken(const unsigned char * const newToken, const unsigned char newTokenSize, uint32 suid, const std::string & username);
LoginClientToken(Archive::ReadIterator & source); LoginClientToken(Archive::ReadIterator & source);
~LoginClientToken(); ~LoginClientToken();
const unsigned char * const getToken () const; const unsigned char * const getToken () const;
const unsigned char getTokenSize () const; const unsigned char getTokenSize () const;
const StationId getStationId () const; const uint32 getStationId () const;
const std::string & getUsername () const; const std::string & getUsername () const;
private: private:
Archive::AutoArray<unsigned char> token; Archive::AutoArray<unsigned char> token;
unsigned char * tokenData; unsigned char * tokenData;
Archive::AutoVariable<StationId> stationId; Archive::AutoVariable<uint32> stationId;
Archive::AutoVariable<std::string> m_username; Archive::AutoVariable<std::string> m_username;
LoginClientToken(); LoginClientToken();
@@ -100,7 +100,7 @@ inline const unsigned char LoginClientToken::getTokenSize() const
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
inline const StationId LoginClientToken::getStationId() const inline const uint32 LoginClientToken::getStationId() const
{ {
return stationId.get(); return stationId.get();
} }