Add Platform.Users to handle users per-platform

This commit is contained in:
Wojtek Figat
2021-11-07 20:46:56 +01:00
parent 21e6e8bc7b
commit b3eb17f61e
17 changed files with 203 additions and 94 deletions

View File

@@ -9,6 +9,7 @@
#include "Engine/Platform/WindowsManager.h"
#include "Engine/Platform/MemoryStats.h"
#include "Engine/Platform/BatteryInfo.h"
#include "Engine/Platform/Base/PlatformUtils.h"
#include "Engine/Engine/Globals.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Collections/Dictionary.h"
@@ -55,9 +56,9 @@ void DbgHelpUnlock()
namespace
{
String UserLocale, ComputerName, UserName, WindowsName;
String UserLocale, ComputerName, WindowsName;
HANDLE EngineMutex = nullptr;
Rectangle VirtualScreenBounds = Rectangle(0.0f, 0.0f, 0.0f, 0.0f);
Rectangle VirtualScreenBounds(0.0f, 0.0f, 0.0f, 0.0f);
int32 VersionMajor = 0;
int32 VersionMinor = 0;
int32 VersionBuild = 0;
@@ -647,10 +648,12 @@ bool WindowsPlatform::Init()
}
// Get user name string
String userName;
if (GetUserNameW(buffer, &tmp))
{
UserName = String(buffer);
userName = String(buffer);
}
OnPlatformUserAdd(New<User>(userName));
WindowsInput::Init();
@@ -794,11 +797,6 @@ String WindowsPlatform::GetComputerName()
return ComputerName;
}
String WindowsPlatform::GetUserName()
{
return UserName;
}
bool WindowsPlatform::GetHasFocus()
{
DWORD foregroundProcess;