diff options
Diffstat (limited to 'src/account-server')
-rw-r--r-- | src/account-server/accountclient.cpp | 4 | ||||
-rw-r--r-- | src/account-server/accounthandler.cpp | 2 | ||||
-rw-r--r-- | src/account-server/character.cpp | 2 | ||||
-rw-r--r-- | src/account-server/main-account.cpp | 6 | ||||
-rw-r--r-- | src/account-server/serverhandler.cpp | 6 | ||||
-rw-r--r-- | src/account-server/storage.cpp | 6 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/account-server/accountclient.cpp b/src/account-server/accountclient.cpp index f8134ba2..814f2aba 100644 --- a/src/account-server/accountclient.cpp +++ b/src/account-server/accountclient.cpp @@ -23,7 +23,7 @@ AccountClient::AccountClient(ENetPeer *peer): NetComputer(peer), status(CLIENT_LOGIN), - mAccount(NULL) + mAccount(nullptr) { } @@ -41,5 +41,5 @@ void AccountClient::setAccount(Account *acc) void AccountClient::unsetAccount() { delete mAccount; - mAccount = NULL; + mAccount = nullptr; } diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index 41b2c034..70984cc1 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -346,7 +346,7 @@ void AccountHandler::handleLoginMessage(AccountClient &client, MessageIn &msg) // Check whether the last login attempt for this IP is still too fresh const int address = client.getIP(); - const time_t now = time(NULL); + const time_t now = time(nullptr); IPsToTime::const_iterator it = mLastLoginAttemptForIP.find(address); if (it != mLastLoginAttemptForIP.end()) { diff --git a/src/account-server/character.cpp b/src/account-server/character.cpp index eafae1c9..61e59b42 100644 --- a/src/account-server/character.cpp +++ b/src/account-server/character.cpp @@ -27,7 +27,7 @@ CharacterData::CharacterData(const std::string &name, int id): mDatabaseID(id), mCharacterSlot(0), mAccountID(-1), - mAccount(NULL), + mAccount(nullptr), mMapId(0), mGender(0), mHairStyle(0), diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp index db69fe69..ee5fcaf3 100644 --- a/src/account-server/main-account.cpp +++ b/src/account-server/main-account.cpp @@ -148,7 +148,7 @@ static void initialize() utils::processor::init(); // Seed the random number generator - std::srand( time(NULL) ); + std::srand( time(nullptr) ); } @@ -258,7 +258,7 @@ static void parseOptions(int argc, char *argv[], CommandLineOptions &options) while (optind < argc) { - int result = getopt_long(argc, argv, optString, longOptions, NULL); + int result = getopt_long(argc, argv, optString, longOptions, nullptr); if (result == -1) break; @@ -371,7 +371,7 @@ int main(int argc, char *argv[]) // Write startup time to database as system world state variable std::stringstream timestamp; - timestamp << time(NULL); + timestamp << time(nullptr); storage->setWorldStateVar("accountserver_startup", timestamp.str(), Storage::SystemMap); diff --git a/src/account-server/serverhandler.cpp b/src/account-server/serverhandler.cpp index 9ed317eb..dbf74d03 100644 --- a/src/account-server/serverhandler.cpp +++ b/src/account-server/serverhandler.cpp @@ -139,7 +139,7 @@ static GameServer *getGameServerFromMap(int mapId) if (it == server->maps.end()) continue; return server; } - return NULL; + return nullptr; } bool GameServerHandler::getGameServerFromMap(int mapId, @@ -432,7 +432,7 @@ void ServerHandler::processMessage(NetComputer *comp, MessageIn &msg) int level = msg.readInt16(); // get the character so we can get the account id - CharacterData *c = storage->getCharacter(id, NULL); + CharacterData *c = storage->getCharacter(id, nullptr); if (c) { storage->setAccountLevel(c->getAccountID(), level); @@ -528,7 +528,7 @@ void ServerHandler::processMessage(NetComputer *comp, MessageIn &msg) result.writeInt32(senderId); // get their characters - CharacterData *sender = storage->getCharacter(senderId, NULL); + CharacterData *sender = storage->getCharacter(senderId, nullptr); CharacterData *receiver = storage->getCharacter(receiverName); if (!sender || !receiver) { diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp index dd8cf9ac..1560547f 100644 --- a/src/account-server/storage.cpp +++ b/src/account-server/storage.cpp @@ -56,7 +56,7 @@ static const char *DB_VERSION_PARAMETER = "database_version"; * SQLite3 specificities: * - any column (but only one for each table) with the exact type of * 'INTEGER PRIMARY KEY' is taken as auto-increment. - * - the supported data types are: NULL, INTEGER, REAL, TEXT and BLOB + * - the supported data types are: nullptr, INTEGER, REAL, TEXT and BLOB * (http://www.sqlite.org/datatype3.html) * - the size of TEXT cannot be set, it is just ignored by the engine. * - IMPORTANT: foreign key constraints are not yet supported @@ -1912,7 +1912,7 @@ void Storage::storeLetter(Letter *letter) { // The letter was never saved before sql << "INSERT INTO " << POST_TBL_NAME << " VALUES ( " - << "NULL, " + << "nullptr, " << letter->getSender()->getDatabaseID() << ", " << letter->getReceiver()->getDatabaseID() << ", " << letter->getExpiry() << ", " @@ -2207,7 +2207,7 @@ void Storage::addTransaction(const Transaction &trans) { std::stringstream sql; sql << "INSERT INTO " << TRANSACTION_TBL_NAME - << " VALUES (NULL, " << trans.mCharacterId << ", " + << " VALUES (nullptr, " << trans.mCharacterId << ", " << trans.mAction << ", " << "?, " << time(0) << ")"; |