Increase username sizes to fix long usernames being cut off.
This commit is contained in:
parent
53e19a604f
commit
51572fef98
|
@ -32,8 +32,8 @@ char* room = "GroundZero#Reception";
|
||||||
char* dimension = "dimension-1";
|
char* dimension = "dimension-1";
|
||||||
uint16_t roomID = 1;
|
uint16_t roomID = 1;
|
||||||
|
|
||||||
char login_username[16];
|
char login_username[32];
|
||||||
char login_password[16];
|
char login_password[32];
|
||||||
|
|
||||||
uint16_t xPos = 0;
|
uint16_t xPos = 0;
|
||||||
uint16_t yPos = 0;
|
uint16_t yPos = 0;
|
||||||
|
|
22
src/main.cpp
22
src/main.cpp
|
@ -129,7 +129,7 @@ int main(int argc, char const* argv[]) {
|
||||||
if (aRecv_t.joinable()) aRecv_t.detach();
|
if (aRecv_t.joinable()) aRecv_t.detach();
|
||||||
wsend(autosock, new unsigned char[] {0x03, 0x01, CMD_SESSEXIT}, 0);
|
wsend(autosock, new unsigned char[] {0x03, 0x01, CMD_SESSEXIT}, 0);
|
||||||
} else if (strcmp(cmd, "login") == 0) {
|
} else if (strcmp(cmd, "login") == 0) {
|
||||||
char username[16] = {0}; j = 0;
|
char username[32] = {0}; j = 0;
|
||||||
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x20) {
|
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x20) {
|
||||||
username[j++] = s;
|
username[j++] = s;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ int main(int argc, char const* argv[]) {
|
||||||
subcmd[j++] = 0;
|
subcmd[j++] = 0;
|
||||||
|
|
||||||
if (strcmp(subcmd, "add") == 0) {
|
if (strcmp(subcmd, "add") == 0) {
|
||||||
char *username = new char[16]; j = 0;
|
char *username = new char[32]; j = 0;
|
||||||
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x00) {
|
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x00) {
|
||||||
username[j++] = s;
|
username[j++] = s;
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ int main(int argc, char const* argv[]) {
|
||||||
wprintw(wlog, "\n*%s is already your friend!", username);
|
wprintw(wlog, "\n*%s is already your friend!", username);
|
||||||
}
|
}
|
||||||
} else if (strcmp(subcmd, "del") == 0) {
|
} else if (strcmp(subcmd, "del") == 0) {
|
||||||
char *username = new char[16]; j = 0;
|
char *username = new char[32]; j = 0;
|
||||||
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x00) {
|
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x00) {
|
||||||
username[j++] = s;
|
username[j++] = s;
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ int main(int argc, char const* argv[]) {
|
||||||
subcmd[j++] = 0;
|
subcmd[j++] = 0;
|
||||||
|
|
||||||
if (strcmp(subcmd, "add") == 0) {
|
if (strcmp(subcmd, "add") == 0) {
|
||||||
char *username = new char[16]; j = 0;
|
char *username = new char[32]; j = 0;
|
||||||
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x00) {
|
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x00) {
|
||||||
username[j++] = s;
|
username[j++] = s;
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ int main(int argc, char const* argv[]) {
|
||||||
wprintw(wlog, "\n*%s is already muted.", username);
|
wprintw(wlog, "\n*%s is already muted.", username);
|
||||||
}
|
}
|
||||||
} else if (strcmp(subcmd, "del") == 0) {
|
} else if (strcmp(subcmd, "del") == 0) {
|
||||||
char *username = new char[16]; j = 0;
|
char *username = new char[32]; j = 0;
|
||||||
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x00) {
|
while (msgoff < msglen && (s = inmsg[msgoff++]) != 0x00) {
|
||||||
username[j++] = s;
|
username[j++] = s;
|
||||||
}
|
}
|
||||||
|
@ -491,7 +491,7 @@ void reciever(int sock_fd, bool autoserver = false) {
|
||||||
readPropertyList(bufin);
|
readPropertyList(bufin);
|
||||||
} else if (bufin[p+2] == CMD_CHATMSG && bufin[p+1] == 0x01) {
|
} else if (bufin[p+2] == CMD_CHATMSG && bufin[p+1] == 0x01) {
|
||||||
bool muted = false;
|
bool muted = false;
|
||||||
char *username = new char[16];
|
char *username = new char[32];
|
||||||
char *message = new char[250];
|
char *message = new char[250];
|
||||||
int offs = p+3;
|
int offs = p+3;
|
||||||
offs++; // Ignore empty byte
|
offs++; // Ignore empty byte
|
||||||
|
@ -511,7 +511,7 @@ void reciever(int sock_fd, bool autoserver = false) {
|
||||||
}
|
}
|
||||||
} else if (bufin[p+2] == CMD_WHISPER && bufin[p+1] == 0x01) {
|
} else if (bufin[p+2] == CMD_WHISPER && bufin[p+1] == 0x01) {
|
||||||
int muted = false;
|
int muted = false;
|
||||||
char *username = new char[16];
|
char *username = new char[32];
|
||||||
char *message;
|
char *message;
|
||||||
int offs = p+3;
|
int offs = p+3;
|
||||||
offs++; // Ignore empty byte
|
offs++; // Ignore empty byte
|
||||||
|
@ -537,7 +537,7 @@ void reciever(int sock_fd, bool autoserver = false) {
|
||||||
userEnter(bufin[p+t]);
|
userEnter(bufin[p+t]);
|
||||||
}
|
}
|
||||||
} else if (bufin[p+2] == CMD_REGOBJID && bufin[p+1] == 0xff) {
|
} else if (bufin[p+2] == CMD_REGOBJID && bufin[p+1] == 0xff) {
|
||||||
char *longID = new char[16];
|
char *longID = new char[32];
|
||||||
int shortID;
|
int shortID;
|
||||||
int offs = p+3;
|
int offs = p+3;
|
||||||
int long_len = bufin[offs++];
|
int long_len = bufin[offs++];
|
||||||
|
@ -553,8 +553,8 @@ void reciever(int sock_fd, bool autoserver = false) {
|
||||||
close(sock_fd);
|
close(sock_fd);
|
||||||
if (autoserver) {
|
if (autoserver) {
|
||||||
wprintw(wlog, "\n*Logged out of %s.", login_username);
|
wprintw(wlog, "\n*Logged out of %s.", login_username);
|
||||||
login_username[0] = 0;
|
memset(&(login_password[0]), 0, sizeof(login_password));
|
||||||
|
|
||||||
// Clear
|
// Clear
|
||||||
properties.erase(properties.begin(), properties.end());
|
properties.erase(properties.begin(), properties.end());
|
||||||
objects.erase(objects.begin(), objects.end());
|
objects.erase(objects.begin(), objects.end());
|
||||||
|
@ -635,7 +635,7 @@ void reciever(int sock_fd, bool autoserver = false) {
|
||||||
}
|
}
|
||||||
teleport(sock_fd, xPos, yPos, zPos, rot);
|
teleport(sock_fd, xPos, yPos, zPos, rot);
|
||||||
} else if (bufin[p+2] == CMD_BUDDYNTF && bufin[p+1] == 0x01) {
|
} else if (bufin[p+2] == CMD_BUDDYNTF && bufin[p+1] == 0x01) {
|
||||||
char* username = new char[24];
|
char* username = new char[32];
|
||||||
int offs = p+3;
|
int offs = p+3;
|
||||||
int username_len = bufin[offs++];
|
int username_len = bufin[offs++];
|
||||||
memcpy(username, &bufin[offs], username_len);
|
memcpy(username, &bufin[offs], username_len);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user