diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/client.cpp | 8 | ||||
-rw-r--r-- | src/dal/dataprovider.cpp | 14 | ||||
-rw-r--r-- | src/dal/dataprovider.h | 7 | ||||
-rw-r--r-- | src/dal/mysqldataprovider.cpp | 3 | ||||
-rw-r--r-- | src/dal/pqdataprovider.cpp | 3 | ||||
-rw-r--r-- | src/dal/sqlitedataprovider.cpp | 3 | ||||
-rw-r--r-- | src/main.cpp | 6 |
8 files changed, 44 insertions, 7 deletions
@@ -0,0 +1,7 @@ +2005-10-23 Yohann Ferreira <Bertram@cegetel.net> + + * src/dal/dataprovider.h, src/dal/dataprovider.cpp, + src/dal/sqlitedataprovider.cpp, src/dal/mysqldataprovider.cpp, + src/dal/pqdataprovider.cpp, src/main.cpp, src/client.cpp: + Grammar corrections, and a little bit of work on getting the name + of the Db. 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(); |