summaryrefslogtreecommitdiff
path: root/src/pso
diff options
context:
space:
mode:
Diffstat (limited to 'src/pso')
-rw-r--r--src/pso/TProtocol.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/pso/TProtocol.cpp b/src/pso/TProtocol.cpp
index 1a992e3..3b7cbd3 100644
--- a/src/pso/TProtocol.cpp
+++ b/src/pso/TProtocol.cpp
@@ -24,6 +24,35 @@ void copy_packet(struct packet *pkt) {
}
+void TProtocol::send_chara_data_v2(TPlyCharData &char_data, TPlyChallenge &challenge, TPlyChoiceSearchConfig &choice_search_config, TBlockedSenders &blocked_senders, TPlyText<512> &auto_reply, char *info_board) {
+ if (m_connected) {
+ char_data.m_disp_data.m_disp_part2.is_valid();
+ m_character_data = char_data;
+ TPlyJoinData tmp;
+ memset(&tmp, 0, sizeof(tmp));
+
+
+ tmp.header.command = 0x61;
+ tmp.header.flags = 3;
+ tmp.header.size = sizeof(tmp);
+ tmp.char_data = m_character_data;
+ tmp.challenge = challenge;
+ tmp.choice_search_config = choice_search_config;
+ strncpy(tmp.info_board, info_board, sizeof(tmp.info_board));
+ for (int i = 0; i < blocked_senders.header.flags; ++i) {
+ tmp.blocked_senders[i] = blocked_senders.blocked_senders[i];
+ }
+ tmp.auto_reply_enabled = auto_reply.header.flags;
+ strncpy(tmp.auto_reply, auto_reply.text, sizeof(tmp.auto_reply)-1);
+ const int packet_size = strlen(tmp.auto_reply) + offsetof(TPlyJoinData, auto_reply) + sizeof(packet_header);
+
+ tmp.header.size = packet_size & ~3;
+ tmp.char_data.some_stub();
+ tmp.bswap();
+ send(as(u8 *, &tmp), packet_size & ~3);
+ }
+}
+
void TProtocol::send_text_list() {
if (m_connected) {
packet_header tmp;