Fix some sizes on join request strings.

This commit is contained in:
Chris Marsh 2017-11-03 13:26:25 -07:00
parent 3bdb88d918
commit a7808a20ed
2 changed files with 9 additions and 3 deletions

View File

@ -33,9 +33,15 @@ struct QueuedMessage {
}; };
struct JoinRequest { struct JoinRequest {
char userId[24]; // snowflake (64bit int), turned into a ascii decimal string, at most 20 chars +1 null
char username[48]; // terminator = 21
char avatar[128]; char userId[22];
// 32 unicode glyphs is max name size => 4 bytes per glyph in the worst case, +1 for null
// terminator = 129
char username[130];
// optional 'a_' + md5 hex digest (32 bytes) + null terminator = 35
char avatar[36];
// +1 on each because: it's even / I'm paranoid
}; };
static RpcConnection* Connection{nullptr}; static RpcConnection* Connection{nullptr};