The server is building, but still needs work

There is some missing character creation/unloading code, and there are a
few other issues highlighted by TODO tags, see below.

In general, 'mapIndex' has been renamed to 'roomIndex'. Multiple rooms
have not been fully implemented yet, but I'm working on it.

Other issues:

* FileFormat needs to be changed to MapLoader
* Server's character movement is still slaved to the clients

The client does not build.
This commit is contained in:
Kayne Ruse
2014-06-07 02:12:40 +10:00
parent cac273da5e
commit 63be0ee70d
10 changed files with 85 additions and 56 deletions
+3 -3
View File
@@ -33,7 +33,7 @@ static const char* CREATE_CHARACTER = "INSERT INTO Characters (owner, handle, av
static const char* LOAD_CHARACTER = "SELECT * FROM Characters WHERE handle = ?;";
static const char* SAVE_CHARACTER = "UPDATE OR FAIL Characters SET "
"mapIndex = ?2,"
"roomIndex = ?2,"
"originX = ?3,"
"originY = ?4,"
"level = ?5,"
@@ -148,7 +148,7 @@ int CharacterManager::LoadCharacter(int owner, std::string handle, std::string a
//Don't cache the birth
//world origin
newChar.mapIndex = sqlite3_column_int(statement, 5);
newChar.roomIndex = sqlite3_column_int(statement, 5);
newChar.origin.x = (double)sqlite3_column_int(statement, 6);
newChar.origin.y = (double)sqlite3_column_int(statement, 7);
@@ -208,7 +208,7 @@ int CharacterManager::SaveCharacter(int uid) {
//parameters
bool ret = false;
ret |= sqlite3_bind_int(statement, 1, uid) != SQLITE_OK;
ret |= sqlite3_bind_int(statement, 2, character.mapIndex) != SQLITE_OK;
ret |= sqlite3_bind_int(statement, 2, character.roomIndex) != SQLITE_OK;
ret |= sqlite3_bind_int(statement, 3, (int)character.origin.x) != SQLITE_OK;
ret |= sqlite3_bind_int(statement, 4, (int)character.origin.y) != SQLITE_OK;