diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-02 12:03:22 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-02 12:03:22 +0000 |
commit | 379c0e936e090a19d295d8514cf94b4fb367eae6 (patch) | |
tree | 3297be7e5a53ed55c5db92bc80e0e65db2ee7bb3 /src/dalstorage.cpp | |
parent | 1140de4450b3840340df6459eb6d13cc02496e46 (diff) | |
download | manaserv-379c0e936e090a19d295d8514cf94b4fb367eae6.tar.gz manaserv-379c0e936e090a19d295d8514cf94b4fb367eae6.tar.bz2 manaserv-379c0e936e090a19d295d8514cf94b4fb367eae6.tar.xz manaserv-379c0e936e090a19d295d8514cf94b4fb367eae6.zip |
Decorrelated moving object IDs from character database IDs. Switched to short IDs instead.
Diffstat (limited to 'src/dalstorage.cpp')
-rw-r--r-- | src/dalstorage.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dalstorage.cpp b/src/dalstorage.cpp index 5fabfce6..b1c4fc0c 100644 --- a/src/dalstorage.cpp +++ b/src/dalstorage.cpp @@ -629,7 +629,7 @@ void DALStorage::flush(AccountPtr const &account) it_end = characters.end(); it != it_end; ++it) { std::ostringstream sql3; - if ((*it)->getID() < 0) { + if ((*it)->getDatabaseID() < 0) { // insert the character sql3 << "insert into " << CHARACTERS_TBL_NAME << " (user_id, name, gender, hair_style, hair_color, level, money," @@ -657,12 +657,13 @@ void DALStorage::flush(AccountPtr const &account) << " where name = \"" << (*it)->getName() << "\";"; RecordSet const &charInfo = mDb->execSql(sql2.str()); if (charInfo.isEmpty()) { - (*it)->setID(1); + // FIXME: this does not make any sense to me -- silene + (*it)->setDatabaseID(1); } else { string_to<unsigned int> toUint; - (*it)->setID(toUint(charInfo(0, 0))); + (*it)->setDatabaseID(toUint(charInfo(0, 0))); } } else { sql3 << "update " << CHARACTERS_TBL_NAME @@ -685,7 +686,7 @@ void DALStorage::flush(AccountPtr const &account) #endif << " dex = " << (*it)->getRawStat(STAT_DEX) << ", " << " luck = " << (*it)->getRawStat(STAT_LUK) - << " where id = " << (*it)->getID() << ";"; + << " where id = " << (*it)->getDatabaseID() << ";"; } mDb->execSql(sql3.str()); |