summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
Diffstat (limited to 'src/login')
-rw-r--r--src/login/HPMlogin.c18
-rw-r--r--src/login/HPMlogin.h2
-rw-r--r--src/login/login.c25
3 files changed, 27 insertions, 18 deletions
diff --git a/src/login/HPMlogin.c b/src/login/HPMlogin.c
index 895cbad16..b900f28fe 100644
--- a/src/login/HPMlogin.c
+++ b/src/login/HPMlogin.c
@@ -32,13 +32,19 @@
// HPMDataCheck comes after all the other includes
#include "common/HPMDataCheck.h"
-bool HPM_login_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) {
- /* record address */
- switch( type ) {
+/**
+ * HPM plugin data store validator sub-handler (login-server)
+ *
+ * @see HPM_interface::data_store_validate
+ */
+bool HPM_login_data_store_validate(enum HPluginDataTypes type, struct hplugin_data_store **storeptr, bool initialize)
+{
+ switch (type) {
+ // No supported types at the moment
default:
- return false;
+ break;
}
- return true;
+ return false;
}
void HPM_login_plugin_load_sub(struct hplugin *plugin) {
@@ -46,6 +52,8 @@ void HPM_login_plugin_load_sub(struct hplugin *plugin) {
}
void HPM_login_do_init(void) {
+ HPM->load_sub = HPM_login_plugin_load_sub;
+ HPM->data_store_validate_sub = HPM_login_data_store_validate;
HPM->datacheck_init(HPMDataCheck, HPMDataCheckLen, HPMDataCheckVer);
HPM_shared_symbols(SERVER_TYPE_LOGIN);
}
diff --git a/src/login/HPMlogin.h b/src/login/HPMlogin.h
index 2a4d5c538..35d4bd01c 100644
--- a/src/login/HPMlogin.h
+++ b/src/login/HPMlogin.h
@@ -13,7 +13,7 @@
struct hplugin;
-bool HPM_login_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr);
+bool HPM_login_data_store_validate(enum HPluginDataTypes type, struct hplugin_data_store **storeptr, bool initialize);
void HPM_login_plugin_load_sub(struct hplugin *plugin);
diff --git a/src/login/login.c b/src/login/login.c
index 572bd594f..1d8ef489a 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -768,7 +768,7 @@ void login_fromchar_parse_accinfo(int fd)
//--------------------------------
int login_parse_fromchar(int fd)
{
- int j, id;
+ int id;
uint32 ipl;
char ip[16];
@@ -795,11 +795,12 @@ int login_parse_fromchar(int fd)
while( RFIFOREST(fd) >= 2 ) {
uint16 command = RFIFOW(fd,0);
- if( HPM->packetsc[hpParse_FromChar] ) {
- if( (j = HPM->parse_packets(fd,hpParse_FromChar)) ) {
- if( j == 1 ) continue;
- if( j == 2 ) return 0;
- }
+ if (VECTOR_LENGTH(HPM->packets[hpParse_FromChar]) > 0) {
+ int result = HPM->parse_packets(fd,hpParse_FromChar);
+ if (result == 1)
+ continue;
+ if (result == 2)
+ return 0;
}
switch( command ) {
@@ -1574,7 +1575,6 @@ void login_parse_request_connection(int fd, struct login_session_data* sd, const
int login_parse_login(int fd)
{
struct login_session_data* sd = (struct login_session_data*)sockt->session[fd]->session_data;
- int result;
char ip[16];
uint32 ipl = sockt->session[fd]->client_addr;
@@ -1608,11 +1608,12 @@ int login_parse_login(int fd)
while( RFIFOREST(fd) >= 2 ) {
uint16 command = RFIFOW(fd,0);
- if( HPM->packetsc[hpParse_Login] ) {
- if( (result = HPM->parse_packets(fd,hpParse_Login)) ) {
- if( result == 1 ) continue;
- if( result == 2 ) return 0;
- }
+ if (VECTOR_LENGTH(HPM->packets[hpParse_Login]) > 0) {
+ int result = HPM->parse_packets(fd,hpParse_Login);
+ if (result == 1)
+ continue;
+ if (result == 2)
+ return 0;
}
switch( command ) {