Skip to content
On this page

๐Ÿ“ฑ Device Information Object API

In LSE, the "device information object" is used to manipulate and obtain information about the game device used by a player.

Get a Device Info Object

Acquired by the Player

Get the device information object corresponding to a player through the .getDevice member function of the player object See Player Object API

Note: Do not save a device information object long-term. When the player corresponding to the device exits the game, the corresponding object will become invalid. Therefore, if there is a need to operate an object for a long time, please obtain the real-time device information object through the above methods.

Device Information Object - Properties

Each device information object contains some fixed object properties. for a specific entity object dv, has the following properties:

AttributesMeaningData Types
dv.ipThe IP address of the player's deviceString
dv.avgPingAverage network latency for players (ms)Integer
dv.avgPacketLossPlayer's average network packet loss rate (%)Float
dv.lastPingNetwork latency for players (ms)Integer
dv.lastPacketLossPlayer's network packet loss rate (%)Float
dv.osThe OS type of the player's deviceString
dv.inputModePlayer's input modeInteger
dv.serverAddressThe player's connection addressString
dv.clientIdID of the player clientString

These object properties are read-only and cannot be modified

Among them, the operating system type attribute returns a string that records the operating system of the player's device. The possible return values โ€‹โ€‹are as follows:

dv.osDevice Operating System
GoogleGoogle Android (Mobile phone)
IOSApple iOS (Mobile phone) or iPadOS
OsxApple macOS (Computer)
AmazonAmazon FireOS
GearVRDeprecatedSamsung GearVR (deprecated)
UwpDeprecatedMicrosoft Windows, UWP (Computer, deprecated)
Win32Microsoft Windows (Computer)
DedicatedDedicated server
TvOSDeprecatedApple tvOS (deprecated)
SonySony PlayStation Host
NintendoNintendo Switch Host
XboxMicrosoft Xbox Host
WindowsPhoneDeprecatedWindows Mobile (deprecated)
LinuxLinux
UnknownUnknown System
Input mode ENUM
InputMode.Mouse
InputMode.Touch
InputMode.GamePad
InputMode.MotionController