A game about forced loneliness, made by TACStudios
1using System; 2using System.Runtime.InteropServices; 3using UnityEngine.InputSystem.Utilities; 4 5////TODO: remove this one; superseded by QueryPairedUserAccountCommand 6 7namespace UnityEngine.InputSystem.LowLevel 8{ 9 [StructLayout(LayoutKind.Explicit, Size = kSize)] 10 internal unsafe struct QueryUserIdCommand : IInputDeviceCommandInfo 11 { 12 public static FourCC Type { get { return new FourCC('U', 'S', 'E', 'R'); } } 13 14 public const int kMaxIdLength = 256; 15 internal const int kSize = InputDeviceCommand.kBaseCommandSize + kMaxIdLength * 2; 16 17 [FieldOffset(0)] 18 public InputDeviceCommand baseCommand; 19 20 [FieldOffset(InputDeviceCommand.kBaseCommandSize)] 21 public fixed byte idBuffer[kMaxIdLength * 2]; 22 23 public string ReadId() 24 { 25 fixed(QueryUserIdCommand * thisPtr = &this) 26 { 27 return StringHelpers.ReadStringFromBuffer(new IntPtr(thisPtr->idBuffer), kMaxIdLength); 28 } 29 } 30 31 public FourCC typeStatic 32 { 33 get { return Type; } 34 } 35 36 public static QueryUserIdCommand Create() 37 { 38 return new QueryUserIdCommand 39 { 40 baseCommand = new InputDeviceCommand(Type, kSize), 41 }; 42 } 43 } 44}