From a8779e452912cf3db5dc32e48f7b268781a8b5ab Mon Sep 17 00:00:00 2001 From: Joon Park Date: Mon, 9 Mar 2020 09:08:39 -0400 Subject: [PATCH] . --- Source/xgmsv/crossgate/mmo_server.cpp | 2 +- Source/xgmsv/crossgate/xg_packet.cpp | 6 ++++++ Source/xgmsv/crossgate/xg_packet.h | 6 ++++++ Source/xgmsv/crossgate/xg_session.cpp | 31 +++++++++++++++++++++------ Source/xgmsv/crossgate/xg_session.h | 11 +++++----- 5 files changed, 44 insertions(+), 12 deletions(-) diff --git a/Source/xgmsv/crossgate/mmo_server.cpp b/Source/xgmsv/crossgate/mmo_server.cpp index ff93240..1648319 100644 --- a/Source/xgmsv/crossgate/mmo_server.cpp +++ b/Source/xgmsv/crossgate/mmo_server.cpp @@ -114,7 +114,7 @@ namespace mmo_server exit(0); //*/ - //* + /* char packet[] = R"(IP 127.0.0.1 )"; core::byte_buffer buf(4096); buf.write(packet, sizeof(packet)); diff --git a/Source/xgmsv/crossgate/xg_packet.cpp b/Source/xgmsv/crossgate/xg_packet.cpp index 8adb52f..78b427f 100644 --- a/Source/xgmsv/crossgate/xg_packet.cpp +++ b/Source/xgmsv/crossgate/xg_packet.cpp @@ -13,8 +13,14 @@ namespace server add_opcode_entry(XG_ECHO, "Echo", &xg_session::handle_echo), add_opcode_entry(XG_CLIENT_LOGIN, "ClientLogin", &xg_session::handle_client_login), add_opcode_entry(XG_CHAR_LIST, "CharList", &xg_session::handle_char_list), + add_opcode_entry(XG_CHAR_CREATE, "CreateNewChar", &xg_session::handle_char_create), + add_opcode_entry(XG_CHAR_DELETE, "CharDelete", &xg_session::handle_char_delete), add_opcode_entry(XG_CHAR_LOGIN, "CharLogin", &xg_session::handle_char_login), add_opcode_entry(XG_CHAR_LOGOUT, "CharLogout", &xg_session::handle_char_logout), + + add_opcode_entry(XG_CHAR_WALK, "W", &xg_session::handle_char_walk), + add_opcode_entry(XG_CHAR_INTERACT, "PI", &xg_session::handle_char_interact), + }; void xg_dispatch_packet(xg_session* session, core::packet&& packet) diff --git a/Source/xgmsv/crossgate/xg_packet.h b/Source/xgmsv/crossgate/xg_packet.h index 61a5caf..ee5c423 100644 --- a/Source/xgmsv/crossgate/xg_packet.h +++ b/Source/xgmsv/crossgate/xg_packet.h @@ -29,8 +29,14 @@ namespace server XG_ECHO, XG_CLIENT_LOGIN, XG_CHAR_LIST, + XG_CHAR_CREATE, + XG_CHAR_DELETE, XG_CHAR_LOGIN, XG_CHAR_LOGOUT, + + XG_CHAR_WALK, + XG_CHAR_INTERACT, + XG_OPCODE_COUNT }; diff --git a/Source/xgmsv/crossgate/xg_session.cpp b/Source/xgmsv/crossgate/xg_session.cpp index 27601e6..d12b2c8 100644 --- a/Source/xgmsv/crossgate/xg_session.cpp +++ b/Source/xgmsv/crossgate/xg_session.cpp @@ -148,6 +148,19 @@ namespace server printf("handle_char_list!\n"); } + void xg_session::handle_char_create(xg_packet* packet) + { + //"CreateNewChar 1 稀有芝士 rDW 10ZE 0 0 0 f f 0 0 5 5 " + //"CreateNewChar successful 3" + } + + void xg_session::handle_char_delete(xg_packet* packet) + { + //"CharDelete 2 " left + //"CharDelete 3 " right + //"CharDelete successful 3" ? not sure + } + void xg_session::handle_char_login(xg_packet* packet) { send_raw(R"(EJQ35XO0sXyvF5j6Y2HPBZM)"); @@ -189,8 +202,8 @@ namespace server //send_msg(R"(ABG ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| )"); - send_raw(R"(PBt-ztsrSCXizpHiNuKPg5AuyS6PzdstfC7blf3rb-Dbo7tf5NhhQ-+Pg4--7kE6qjGnMfl6th1N20udvQ)"); - //send_msg(R"(C 1|3H9|12|6|0|106002|1|0|jason|\\z\\z|0|0|0|见习传教士|0 )"); + //send_raw(R"(PBt-ztsrSCXizpHiNuKPg5AuyS6PzdstfC7blf3rb-Dbo7tf5NhhQ-+Pg4--7kE6qjGnMfl6th1N20udvQ)"); + send_msg(R"(C 1|3H9|12|6|0|106003|1|0|jason|\\z\\z|0|0|0|见习传教士|0 )"); send_msg(R"(C 2|1tq|10|5|4|14088|1|0|伯舒医师|\\z\\z|0|0|0||0 37|1ty|10|17|4|14088|1|0|姆涅医师|\\z\\z|0|0|0||0 2|1ti|12|5|4|14090|1|0|实习药剂师吉可|\\z\\z|0|0|0||0 29|1xH|16|9|6|14151|1|0|实习生蜜雅|\\z\\z|0|0|0||0 )"); @@ -203,10 +216,6 @@ namespace server send_msg(R"(TK -1 P|欢迎来到芝士的魔力宝贝服务器~ 4 0 )"); send_msg(R"(CA 3H9|12|6|0|0 )"); - core::async_after(1s, - [this]() - { - }); /* send_raw(R"(TK -1 P|感谢购买大灰狼魔力。wow335.taobao.com 4 0 )"); send_raw(R"(TK -1 P|[版本申明]GMSV\SAvaritia\SFeb\S\S1\S2014\S共享版 4 0 )"); @@ -230,5 +239,15 @@ namespace server //marked_for_delete = true; } + void xg_session::handle_char_walk(xg_packet* packet) + { + + } + + void xg_session::handle_char_interact(xg_packet* packet) + { + + } + } } diff --git a/Source/xgmsv/crossgate/xg_session.h b/Source/xgmsv/crossgate/xg_session.h index b90f78e..746c06b 100644 --- a/Source/xgmsv/crossgate/xg_session.h +++ b/Source/xgmsv/crossgate/xg_session.h @@ -74,16 +74,17 @@ namespace server #define send_raw(str) enqueue_response((uint8*)str "\n", sizeof(str), true) void handle_echo(xg_packet* packet); - void handle_fc(xg_packet* packet); - void handle_client_login(xg_packet* packet); - void handle_char_list(xg_packet* packet); - + void handle_char_create(xg_packet* packet); + void handle_char_delete(xg_packet* packet); void handle_char_login(xg_packet* packet); - void handle_char_logout(xg_packet* packet); + + void handle_char_walk(xg_packet* packet); + void handle_char_interact(xg_packet* packet); + }; struct xg_session_pool : std::vector