Commit 44af66b2 authored by nanahira's avatar nanahira

fix

parent 90724ada
...@@ -459,19 +459,5 @@ size_t NetServer::CreateChatPacket(unsigned char* src, int src_size, unsigned ch ...@@ -459,19 +459,5 @@ size_t NetServer::CreateChatPacket(unsigned char* src, int src_size, unsigned ch
buffer_write_block(pdst, src_msg, src_size); buffer_write_block(pdst, src_msg, src_size);
return sizeof(dst_player_type) + src_size; return sizeof(dst_player_type) + src_size;
} }
size_t NetServer::CreateChatPacket(unsigned char* src, int src_size, unsigned char* dst, uint16_t dst_player_type) {
if (!check_msg_size(src_size))
return 0;
uint16_t src_msg[LEN_CHAT_MSG];
std::memcpy(src_msg, src, src_size);
const int src_len = src_size / sizeof(uint16_t);
if (src_msg[src_len - 1] != 0)
return 0;
// STOC_Chat packet
auto pdst = dst;
buffer_write<uint16_t>(pdst, dst_player_type);
buffer_write_block(pdst, src_msg, src_size);
return sizeof(dst_player_type) + src_size;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment