summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-10-23 18:33:07 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-10-23 18:33:07 +0000
commit18b932ae7b11a75c3d68141789c42a20bb27396c (patch)
tree921b87db1865a467541a2320b7e7d55b4f0e700a /src
parent92bd17b9aef29611798372b8b0afad65c4221bb5 (diff)
downloadmanaserv-18b932ae7b11a75c3d68141789c42a20bb27396c.tar.gz
manaserv-18b932ae7b11a75c3d68141789c42a20bb27396c.tar.bz2
manaserv-18b932ae7b11a75c3d68141789c42a20bb27396c.tar.xz
manaserv-18b932ae7b11a75c3d68141789c42a20bb27396c.zip
Grammar Corrections, and a little bit of work on getting the name of the Db.
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp8
-rw-r--r--src/dal/dataprovider.cpp14
-rw-r--r--src/dal/dataprovider.h7
-rw-r--r--src/dal/mysqldataprovider.cpp3
-rw-r--r--src/dal/pqdataprovider.cpp3
-rw-r--r--src/dal/sqlitedataprovider.cpp3
-rw-r--r--src/main.cpp6
7 files changed, 37 insertions, 7 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 2b8b3204..7669b112 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -41,7 +41,7 @@ int main(int argc, char *argv[])
exit(2);
}
- printf("Succesfully connected!\n");
+ printf("Successfully connected!\n");
int answer = 1;
char line[256] = "";
@@ -56,8 +56,8 @@ int main(int argc, char *argv[])
printf ("2) Login\n");
printf ("3) Chat\n");
printf ("4) Create character\n");
- printf ("5) Character selecion\n");
- printf ("Insert your option: ");
+ printf ("5) Character selection\n");
+ printf ("Choose your option: ");
std::cin >> answer;
switch (answer) {
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
{
// Select character
msg.writeShort(CMSG_CHAR_SELECT);
- printf("\nCharacrer ID: ");
+ printf("\nCharacter ID: ");
std::cin >> line;
msg.writeByte(atoi(line));
} break;
diff --git a/src/dal/dataprovider.cpp b/src/dal/dataprovider.cpp
index dbfab728..29e0e6cc 100644
--- a/src/dal/dataprovider.cpp
+++ b/src/dal/dataprovider.cpp
@@ -62,6 +62,20 @@ DataProvider::isConnected(void) const
return mIsConnected;
}
+/**
+ * Get the DataBase Name
+ */
+std::string
+DataProvider::getDbName(void)
+{
+ if (!isConnected())
+ {
+ return "";
+ }
+
+ return mDbName;
+}
+
} // namespace dal
} // namespace tmwserv
diff --git a/src/dal/dataprovider.h b/src/dal/dataprovider.h
index 2789571a..6687a749 100644
--- a/src/dal/dataprovider.h
+++ b/src/dal/dataprovider.h
@@ -137,6 +137,13 @@ class DataProvider
virtual void
disconnect(void) = 0;
+ /**
+ * Get the Database Name.
+ */
+ std::string
+ getDbName(void);
+
+
protected:
std::string mDbName; /**< the database name */
diff --git a/src/dal/mysqldataprovider.cpp b/src/dal/mysqldataprovider.cpp
index ca01577f..d397253c 100644
--- a/src/dal/mysqldataprovider.cpp
+++ b/src/dal/mysqldataprovider.cpp
@@ -110,6 +110,9 @@ MySqlDataProvider::connect(const std::string& dbName,
throw DbConnectionFailure(msg);
}
+ // Save the Db Name.
+ mDbName = dbName;
+
mIsConnected = true;
}
diff --git a/src/dal/pqdataprovider.cpp b/src/dal/pqdataprovider.cpp
index dd91f276..2a30ef9e 100644
--- a/src/dal/pqdataprovider.cpp
+++ b/src/dal/pqdataprovider.cpp
@@ -89,6 +89,9 @@ PqDataProvider::connect(const std::string& dbName,
throw DbConnectionFailure(error);
}
+ // Save the Db Name.
+ mDbName = dbName;
+
mIsConnected = true;
}
diff --git a/src/dal/sqlitedataprovider.cpp b/src/dal/sqlitedataprovider.cpp
index 1663dddd..2af82fcd 100644
--- a/src/dal/sqlitedataprovider.cpp
+++ b/src/dal/sqlitedataprovider.cpp
@@ -98,6 +98,9 @@ SqLiteDataProvider::connect(const std::string& dbName,
throw DbConnectionFailure(msg);
}
+ // Save the Db Name.
+ mDbName = dbName;
+
mIsConnected = true;
}
diff --git a/src/main.cpp b/src/main.cpp
index 30b547f7..d9d627e8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -62,7 +62,7 @@ std::string scriptLanguage = "squirrel";
#endif // SCRIPT_SUPPORT
#define LOG_FILE "tmwserv.log"
-
+#define SERVER_VERSION "Pre-Milestone1"
#define TMW_WORLD_TICK SDL_USEREVENT
#define SERVER_PORT 9601
@@ -214,7 +214,7 @@ int main(int argc, char *argv[])
connectionHandler->registerHandler(CMSG_USE_ITEM, gameHandler); // NOTE: this is probably redundant (CMSG_USE_OBJECT)
connectionHandler->registerHandler(CMSG_EQUIP, gameHandler);
- //LOG_INFO("The Mana World Server v" << PACKAGE_VERSION) PACKAGE_VERSION undeclared
+ LOG_INFO("The Mana World Server v" << SERVER_VERSION)
session->startListen(connectionHandler.get(), SERVER_PORT);
LOG_INFO("Listening on port " << SERVER_PORT << "...")
@@ -259,7 +259,7 @@ int main(int argc, char *argv[])
SDL_Delay(100);
}
- LOG_INFO("Recieved Quit signal, closing down...")
+ LOG_INFO("Received: Quit signal, closing down...")
session->stopListen(SERVER_PORT);
deinitialize();