Windows Store support for NetHack 3.6.

This commit is contained in:
Bart House
2019-10-29 21:28:39 -07:00
parent 9258cb99e6
commit 43ef5ef7fa
66 changed files with 963 additions and 136 deletions

View File

@@ -188,15 +188,21 @@ get_username(lan_username_size)
int *lan_username_size;
{
static TCHAR username_buffer[BUFSZ];
unsigned int status;
DWORD i = BUFSZ - 1;
/* i gets updated with actual size */
status = GetUserName(username_buffer, &i);
if (status)
username_buffer[i] = '\0';
else
Strcpy(username_buffer, "NetHack");
Strcpy(username_buffer, "NetHack");
/* Our privacy policy for the windows store version of nethack makes
* a promise about not collecting any personally identifiable information.
* Do not allow getting user name if we being run from windows store
* version of nethack. In 3.7, we should remove use of username.
*/
if (!is_desktop_bridge_application()) {
/* i gets updated with actual size */
if (GetUserName(username_buffer, &i))
username_buffer[i] = '\0';
}
if (lan_username_size)
*lan_username_size = strlen(username_buffer);
return username_buffer;