summaryrefslogtreecommitdiff
path: root/src/map/chrif.cpp
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-12-30 16:06:06 -0500
committergumi <git@gumi.ca>2018-12-30 16:32:51 -0500
commita56b3ea671e9cc74b3f9ea723bc149e83212b998 (patch)
treea595027339f278c83e4ca8c30454900bdff7f70a /src/map/chrif.cpp
parenta860cff760e39dc63de529991131fe295e03f543 (diff)
downloadtmwa-a56b3ea671e9cc74b3f9ea723bc149e83212b998.tar.gz
tmwa-a56b3ea671e9cc74b3f9ea723bc149e83212b998.tar.bz2
tmwa-a56b3ea671e9cc74b3f9ea723bc149e83212b998.tar.xz
tmwa-a56b3ea671e9cc74b3f9ea723bc149e83212b998.zip
pre-send the auth details to map servers instead of blindly trusting 0x0072
Diffstat (limited to 'src/map/chrif.cpp')
-rw-r--r--src/map/chrif.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp
index 42a13cf..9361c2e 100644
--- a/src/map/chrif.cpp
+++ b/src/map/chrif.cpp
@@ -340,6 +340,30 @@ int chrif_charselectreq(dumb_ptr<map_session_data> sd)
return 0;
}
+void chrif_parse_preauth(Session *s, const Packet_Fixed<0x3829>& fixed)
+{
+ if (auth_fifo_iter == auth_fifo.end())
+ auth_fifo_iter = auth_fifo.begin();
+ auth_fifo_iter->account_id = fixed.account_id;
+ auth_fifo_iter->char_id = fixed.char_id;
+ auth_fifo_iter->login_id1 = fixed.login_id1;
+ auth_fifo_iter->login_id2 = fixed.login_id2;
+ auth_fifo_iter->ip = fixed.ip;
+ auth_fifo_iter->delflag = 0;
+ auth_fifo_iter++;
+
+ // tell char server we accepted the auth details
+ Packet_Fixed<0x3830> fixed_3830;
+ fixed_3830.account_id = fixed.account_id;
+ fixed_3830.char_id = fixed.char_id;
+ fixed_3830.login_id1 = fixed.login_id1;
+ fixed_3830.login_id2 = fixed.login_id2;
+ fixed_3830.ip = fixed.ip;
+ send_fpacket<0x3830, 22>(s, fixed_3830);
+
+ MAP_LOG_AND_ECHO("Received pre-auth details for account %d [%s], replying to char server\n"_fmt, fixed.account_id, fixed.ip);
+}
+
/*==========================================
* Change Email
*------------------------------------------