Commit 882d8a33 authored by mercury233's avatar mercury233

comment

parent e60bdd08
...@@ -123,9 +123,9 @@ void DuelClient::ClientEvent(bufferevent* bev, short events, void* ctx) { ...@@ -123,9 +123,9 @@ void DuelClient::ClientEvent(bufferevent* bev, short events, void* ctx) {
auto hostname_len = BufferIO::CopyCharArray(mainGame->ebJoinHost->getText(), hostname_buf); auto hostname_len = BufferIO::CopyCharArray(mainGame->ebJoinHost->getText(), hostname_buf);
auto hostname_msglen = (hostname_len + 1) * sizeof(uint16_t); auto hostname_msglen = (hostname_len + 1) * sizeof(uint16_t);
char buf[LEN_HOSTNAME * sizeof(int16_t) + sizeof(uint32_t)]; char buf[LEN_HOSTNAME * sizeof(int16_t) + sizeof(uint32_t)];
memset(buf, 0, sizeof(uint32_t)); memset(buf, 0, sizeof(uint32_t)); // real_ip
memcpy(buf + sizeof(uint32_t), hostname_buf, hostname_msglen); memcpy(buf + sizeof(uint32_t), hostname_buf, hostname_msglen);
DuelClient::SendBufferToServer(CTOS_EXTERNAL_ADDRESS, buf, hostname_msglen + sizeof(uint32_t)); SendBufferToServer(CTOS_EXTERNAL_ADDRESS, buf, hostname_msglen + sizeof(uint32_t));
} }
CTOS_PlayerInfo cspi; CTOS_PlayerInfo cspi;
BufferIO::CopyCharArray(mainGame->ebNickName->getText(), cspi.name); BufferIO::CopyCharArray(mainGame->ebNickName->getText(), cspi.name);
......
...@@ -105,7 +105,7 @@ static_assert(sizeof(CTOS_Kick) == 1, "size mismatch: CTOS_Kick"); ...@@ -105,7 +105,7 @@ static_assert(sizeof(CTOS_Kick) == 1, "size mismatch: CTOS_Kick");
/* /*
* CTOS_ExternalAddress * CTOS_ExternalAddress
* uint32_t real_ip; (IPv4 address, BE) * uint32_t real_ip; (IPv4 address, BE, alway 0 in normal client)
* uint16_t hostname[256]; (UTF-16 string) * uint16_t hostname[256]; (UTF-16 string)
*/ */
......
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