summaryrefslogtreecommitdiffstats
path: root/src/account-server
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-04-27 21:42:58 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-04-27 21:42:58 +0200
commitd4f3105d9a879f27baad6e43b8b3cb6fe2f0ef50 (patch)
tree474ec7369f0d367d7780f73901d38d1daec4d2eb /src/account-server
parent2c14cd30ecbacbd5a808cb2641d40f6d568ec294 (diff)
downloadmanaserv-d4f3105d9a879f27baad6e43b8b3cb6fe2f0ef50.tar.gz
manaserv-d4f3105d9a879f27baad6e43b8b3cb6fe2f0ef50.tar.xz
manaserv-d4f3105d9a879f27baad6e43b8b3cb6fe2f0ef50.zip
Use nullptr instead of NULL everywhere
Diffstat (limited to 'src/account-server')
-rw-r--r--src/account-server/accountclient.cpp4
-rw-r--r--src/account-server/accounthandler.cpp2
-rw-r--r--src/account-server/character.cpp2
-rw-r--r--src/account-server/main-account.cpp6
-rw-r--r--src/account-server/serverhandler.cpp6
-rw-r--r--src/account-server/storage.cpp6
6 files changed, 13 insertions, 13 deletions
diff --git a/src/account-server/accountclient.cpp b/src/account-server/accountclient.cpp
index f8134ba..814f2ab 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 76a427e..b9397fe 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 eafae1c..61e59b4 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 db69fe6..ee5fcaf 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 9ed317e..dbf74d0 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 dd8cf9a..1560547 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) << ")";