summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAaron Marks <nymacro@gmail.com>2005-05-29 12:06:58 +0000
committerAaron Marks <nymacro@gmail.com>2005-05-29 12:06:58 +0000
commit7a8b2b11e989e474dceb30330852174d877b1601 (patch)
treedc0e63111c2633bcd9a787f359eb4222fc806225 /src/main.cpp
parent6d34ea19c35627c1705b81f4c89d8557e13bf4da (diff)
downloadmanaserv-7a8b2b11e989e474dceb30330852174d877b1601.tar.gz
manaserv-7a8b2b11e989e474dceb30330852174d877b1601.tar.xz
manaserv-7a8b2b11e989e474dceb30330852174d877b1601.zip
Added getAccount & getCharacter to storage class. Cleaned up storage code.
Added test in main.cpp.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 13d310b..b67fa4d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -198,6 +198,28 @@ int main(int argc, char *argv[])
std::cout << "Number of accounts on server: " << store.accountCount() << std::endl;
+ // Test the database retrieval code
+ std::cout << "Attempting to retrieve account with username 'nym'" << std::endl;
+ Account* acc = store.getAccount("nym");
+ if (acc)
+ {
+ std::cout << "Account name: " << acc->getName() << std::endl
+ << "Account email: " << acc->getEmail() << std::endl;
+
+ std::cout << "Attempting to get character of 'nym'" << std::endl;
+ Being* character = store.getCharacter("nym");
+ if (character)
+ {
+ std::cout << "Character name: " << character->getName() << std::endl;
+ } else
+ {
+ std::cout << "No characters found" << std::endl;
+ }
+ } else
+ {
+ std::cout << "Account 'nym' not found" << std::endl;
+ }
+
SDL_Event event;
while (running)
@@ -211,7 +233,7 @@ int main(int argc, char *argv[])
// Print world time at 10 second intervals to show we're alive
if (worldTime % 100 == 0) {
- printf("World time: %d\n", worldTime);
+ //printf("World time: %d\n", worldTime);
logger->log("World time: %d", worldTime);
}