|
@@ -55,6 +55,7 @@ typedef struct user_info {
|
|
|
int hitpoints;
|
|
|
int armorpoints;
|
|
|
int shieldpoints;
|
|
|
+ int shieldsup;
|
|
|
char nick[256];
|
|
|
char real[256];
|
|
|
} user_inf;
|
|
@@ -158,7 +159,9 @@ void db_test() {
|
|
|
sqlite3_column_name(stmt, 10),
|
|
|
sqlite3_column_int(stmt, 10),
|
|
|
sqlite3_column_name(stmt, 11),
|
|
|
- sqlite3_column_int(stmt, 11)
|
|
|
+ sqlite3_column_int(stmt, 11),
|
|
|
+ sqlite3_column_name(stmt, 12),
|
|
|
+ sqlite3_column_int(stmt, 12)
|
|
|
);
|
|
|
}
|
|
|
sqlite3_finalize(stmt);
|
|
@@ -310,6 +313,7 @@ user_inf load_player(int uuid) {
|
|
|
result.armorpoints = sqlite3_column_int(stmt, 9);
|
|
|
result.shieldpoints = sqlite3_column_int(stmt, 10);
|
|
|
result.hitpoints = sqlite3_column_int(stmt, 11);
|
|
|
+ result.shieldsup = sqlite3_column_int(stmt, 12);
|
|
|
} else {
|
|
|
dolog("E: Unable to locate user with id=%d", uuid);
|
|
|
sqlite3_finalize(stmt);
|
|
@@ -335,7 +339,7 @@ void update_player(user_inf data) {
|
|
|
|
|
|
|
|
|
|
|
|
- strcpy(sqlbuffer, "UPDATE user SET nick=?, experience=?, metal=?, fuel=?, guns=?, armors=?, shields=?, armorpoints=?, shieldpoints=?, hitpoints=? WHERE uid=?;");
|
|
|
+ strcpy(sqlbuffer, "UPDATE user SET nick=?, experience=?, metal=?, fuel=?, guns=?, armors=?, shields=?, armorpoints=?, shieldpoints=?, hitpoints=?, shieldsup=? WHERE uid=?;");
|
|
|
sqlite3_prepare_v2(db, sqlbuffer, strlen(sqlbuffer) + 1, &stmt, NULL);
|
|
|
|
|
|
sqlite3_bind_text(stmt, 1, data.nick, strlen(data.nick), SQLITE_STATIC);
|
|
@@ -348,7 +352,8 @@ void update_player(user_inf data) {
|
|
|
sqlite3_bind_int(stmt, 8, data.armorpoints);
|
|
|
sqlite3_bind_int(stmt, 9, data.shieldpoints);
|
|
|
sqlite3_bind_int(stmt, 10, data.hitpoints);
|
|
|
- sqlite3_bind_int(stmt, 11, data.uid);
|
|
|
+ sqlite3_bind_int(stmt, 11, data.shieldsup);
|
|
|
+ sqlite3_bind_int(stmt, 12, data.uid);
|
|
|
|
|
|
rc = sqlite3_step(stmt);
|
|
|
if(rc != SQLITE_DONE) {
|
|
@@ -479,9 +484,8 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
|
|
|
|
- user_inf ply = load_player(locate_player(mdcontrol.user_firstname, mdcontrol.user_lastname));
|
|
|
- ply.experience += 10;
|
|
|
- update_player(ply);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
if (inuse == 0) {
|