summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-01-17 01:31:35 +0300
committerAndrei Karas <akaras@inbox.ru>2018-02-09 18:34:44 +0300
commit917b208edb37bcde0ad9085311bef54fc436b54f (patch)
tree31f6bd76c83c5eee59e9f820e24dff7745546fbf /src/login
parent6813c20bb80ccbb390b320539b2d186aeb989f33 (diff)
downloadhercules-917b208edb37bcde0ad9085311bef54fc436b54f.tar.gz
hercules-917b208edb37bcde0ad9085311bef54fc436b54f.tar.bz2
hercules-917b208edb37bcde0ad9085311bef54fc436b54f.tar.xz
hercules-917b208edb37bcde0ad9085311bef54fc436b54f.zip
Add account_ prefix to all functions in account.c
Diffstat (limited to 'src/login')
-rw-r--r--src/login/account.c21
-rw-r--r--src/login/account.h4
-rw-r--r--src/login/login.c4
3 files changed, 15 insertions, 14 deletions
diff --git a/src/login/account.c b/src/login/account.c
index 66ede6cfa..7e8fa5f30 100644
--- a/src/login/account.c
+++ b/src/login/account.c
@@ -85,8 +85,8 @@ static AccountDBIterator* account_db_sql_iterator(AccountDB* self);
static void account_db_sql_iter_destroy(AccountDBIterator* self);
static bool account_db_sql_iter_next(AccountDBIterator* self, struct mmo_account* acc);
-static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int account_id);
-static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, bool is_new);
+static bool account_mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int account_id);
+static bool account_mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, bool is_new);
/// public constructor
AccountDB* account_db_sql(void)
@@ -381,7 +381,7 @@ static bool account_db_sql_create(AccountDB* self, struct mmo_account* acc)
// insert the data into the database
acc->account_id = account_id;
- return mmo_auth_tosql(db, acc, true);
+ return account_mmo_auth_tosql(db, acc, true);
}
/// delete an existing account entry + its regs
@@ -411,14 +411,14 @@ static bool account_db_sql_remove(AccountDB* self, const int account_id)
static bool account_db_sql_save(AccountDB* self, const struct mmo_account* acc)
{
AccountDB_SQL* db = (AccountDB_SQL*)self;
- return mmo_auth_tosql(db, acc, false);
+ return account_mmo_auth_tosql(db, acc, false);
}
/// retrieve data from db and store it in the provided data structure
static bool account_db_sql_load_num(AccountDB* self, struct mmo_account* acc, const int account_id)
{
AccountDB_SQL* db = (AccountDB_SQL*)self;
- return mmo_auth_fromsql(db, acc, account_id);
+ return account_mmo_auth_fromsql(db, acc, account_id);
}
/// retrieve data from db and store it in the provided data structure
@@ -516,7 +516,7 @@ static bool account_db_sql_iter_next(AccountDBIterator* self, struct mmo_account
{// get account data
int account_id;
account_id = atoi(data);
- if( mmo_auth_fromsql(db, acc, account_id) )
+ if( account_mmo_auth_fromsql(db, acc, account_id) )
{
iter->last_account_id = account_id;
SQL->FreeResult(sql_handle);
@@ -528,7 +528,7 @@ static bool account_db_sql_iter_next(AccountDBIterator* self, struct mmo_account
}
-static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int account_id)
+static bool account_mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int account_id)
{
struct Sql *sql_handle;
char* data;
@@ -573,7 +573,7 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
return true;
}
-static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, bool is_new)
+static bool account_mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, bool is_new)
{
struct Sql *sql_handle;
struct SqlStmt *stmt;
@@ -673,7 +673,8 @@ struct Sql *account_db_sql_up(AccountDB* self)
AccountDB_SQL* db = (AccountDB_SQL*)self;
return db ? db->accounts : NULL;
}
-void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id)
+
+void account_mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id)
{
struct Sql *sql_handle;
AccountDB_SQL* db = (AccountDB_SQL*)self;
@@ -725,7 +726,7 @@ void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id)
}
}
-void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id)
+void account_mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id)
{
struct Sql *sql_handle;
AccountDB_SQL* db = (AccountDB_SQL*)self;
diff --git a/src/login/account.h b/src/login/account.h
index 9bb07fda3..3d47e8c56 100644
--- a/src/login/account.h
+++ b/src/login/account.h
@@ -164,8 +164,8 @@ struct AccountDB
#ifdef HERCULES_CORE
struct Sql *account_db_sql_up(AccountDB* self);
-void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id);
-void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id);
+void account_mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id);
+void account_mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id);
#endif // HERCULES_CORE
#endif /* LOGIN_ACCOUNT_H */
diff --git a/src/login/login.c b/src/login/login.c
index a78276051..0b540d95a 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -624,7 +624,7 @@ void login_fromchar_parse_account_reg2(int fd, int id, const char *const ip)
if( !accounts->load_num(accounts, &acc, account_id) )
ShowStatus("Char-server '%s': receiving (from the char-server) of account_reg2 (account: %d not found, ip: %s).\n", server[id].name, account_id, ip);
else {
- mmo_save_accreg2(accounts,fd,account_id,RFIFOL(fd, 8));
+ account_mmo_save_accreg2(accounts,fd,account_id,RFIFOL(fd, 8));
}
RFIFOSKIP(fd,RFIFOW(fd,2));
}
@@ -684,7 +684,7 @@ void login_fromchar_parse_request_account_reg2(int fd)
int char_id = RFIFOL(fd,6);
RFIFOSKIP(fd,10);
- mmo_send_accreg2(accounts,fd,account_id,char_id);
+ account_mmo_send_accreg2(accounts,fd,account_id,char_id);
}
void login_fromchar_parse_update_wan_ip(int fd, int id)