Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <acctserver.h>
Public Member Functions | |
AccountServer () | |
~AccountServer () | |
void | startMsg () |
void | start () |
void | save () |
void | recvMsg (SOCKETALT sock) |
void | sendAuthorized (SOCKETALT sock, Account *acct) |
void | sendUnauthorized (SOCKETALT sock, Account *acct) |
void | sendAlreadyConnected (SOCKETALT sock, Account *acct) |
void | sendServerData (SOCKETALT sock, Account *acct) |
void | writeSave (const char *buffer, unsigned int bufferlen) |
void | removeDeadSockets () |
Class that manages player accounts
Definition at line 26 of file acctserver.h.
AccountServer::AccountServer | ( | ) |
Definition at line 23 of file acctserver.cpp.
References getNewTime(), POSH_GetArchString(), serial_seed, and UpdateTime().
AccountServer::~AccountServer | ( | ) |
Definition at line 41 of file acctserver.cpp.
void AccountServer::recvMsg | ( | SOCKETALT | sock) |
Definition at line 135 of file acctserver.cpp.
References VSFileSystem::AccountFile, addAcct(), VSFileSystem::VSFile::Close(), CMD_LOGIN, CMD_LOGOUT, CMD_NEWSUBSCRIBE, CMD_RESYNCACCOUNTS, CMD_SAVEACCOUNTS, Account::compareName(), COUT, f, getAcctNoReload(), getAcctTemplate(), Packet::getCommand(), Packet::getData(), Packet::getDataLength(), Packet::getSerial(), i, Account::isConnected(), j, LOGIN_DATA, LOGIN_ERROR, MAXBUFFER, VSFileSystem::Ok, VSFileSystem::VSFile::OpenCreateWrite(), VSFileSystem::VSFile::OpenReadOnly(), Account::passwd, VSFileSystem::VSFile::ReadLine(), SOCKETALT::recvbuf(), Account::retryConnectedCount(), Packet::send(), sendAlreadyConnected(), sendAuthorized(), SENDRELIABLE, sendServerData(), sendUnauthorized(), Account::setConnected(), strtoupper(), VSExit(), VSFileSystem::VSFile::WriteLine(), and writeSave().
Referenced by start().
void AccountServer::removeDeadSockets | ( | ) |
Definition at line 501 of file acctserver.cpp.
References COUT, getAcctAddress(), j, and Account::setConnected().
Referenced by start().
void AccountServer::save | ( | ) |
Definition at line 490 of file acctserver.cpp.
Definition at line 471 of file acctserver.cpp.
References Account::callsign, Packet::getData(), Packet::getDataLength(), Account::getSerial(), LOGIN_ALREADY, Account::passwd, Packet::send(), and SENDRELIABLE.
Referenced by recvMsg().
Definition at line 357 of file acctserver.cpp.
References VSFileSystem::AccountFile, NetBuffer::addString(), Account::callsign, VSFileSystem::VSFile::Close(), COMPRESSED, f, NetBuffer::getData(), Packet::getData(), Packet::getDataLength(), NetBuffer::getDataLength(), Account::isNew(), LOGIN_ACCEPT, LOGIN_NEW, VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), Account::passwd, VSFileSystem::VSFile::ReadFull(), Packet::send(), SENDRELIABLE, Account::serverip, Account::serverport, Account::setSerial(), Account::setSocket(), VSFileSystem::VSFile::Size(), and VSExit().
Referenced by recvMsg().
Definition at line 479 of file acctserver.cpp.
References NetBuffer::addString(), Account::callsign, NetBuffer::getData(), NetBuffer::getDataLength(), LOGIN_DATA, Account::passwd, Packet::send(), SENDRELIABLE, Account::serverip, and Account::serverport.
Referenced by recvMsg().
Definition at line 464 of file acctserver.cpp.
References Account::callsign, Packet::getData(), Packet::getDataLength(), LOGIN_ERROR, Account::passwd, Packet::send(), and SENDRELIABLE.
Referenced by recvMsg().
void AccountServer::start | ( | void | ) |
Definition at line 58 of file acctserver.cpp.
References ACCT_PORT, acctdir, CONFIGFILE, COUT, NetUITCP::createServerSocket(), VSFileSystem::datadir, getNewTime(), VegaConfig::getVariable(), i, vs_options::init(), VSFileSystem::InitPaths(), InitTime(), SOCKETALT::isActive(), LoadAccounts(), recvMsg(), removeDeadSockets(), VSThread::start(), startMsg(), UpdateTime(), SOCKETALT::valid(), vs_config, VSExit(), and SocketSet::wait().
Referenced by main().
void AccountServer::startMsg | ( | ) |
Definition at line 52 of file acctserver.cpp.
Referenced by start().
void AccountServer::writeSave | ( | const char * | buffer, |
unsigned int | bufferlen | ||
) |
Definition at line 529 of file acctserver.cpp.
References Account::callsign, getAcctSerial(), FileUtil::GetSaveFromBuffer(), Packet::getSerial(), and FileUtil::WriteSaveFiles().
Referenced by recvMsg().