A high-level plugin framework for SCP: Secret Laboratory servers. It offers an event system for developers to hook in order to manipulate or change game code, or implement their own functions.
Describe the bug
When a player leaves the server, an error is thrown in the console. This does not result in any other issues and has no gameplay impact, but it's an error in the console nonetheless.
To Reproduce
Steps to reproduce the behavior:
Join the server
Leave the server
Check the console
Expected behavior
No error in log. lol
Server logs
[2023-01-13 13:09:06.722 -06:00] Player tpd1864blake (76561198081841934@steam) (2) connected with the IP: 127.0.0.1
[2023-01-13 13:09:15.919 -06:00] New round has been started.
[2023-01-13 13:13:37.636 -06:00] Refreshed public key of central server - key hash not changed.
[2023-01-13 15:04:13.602 -06:00] Player tpd1864blake disconnected
[2023-01-13 15:04:13.633 -06:00] Server has entered the idle mode.
[2023-01-13 15:04:28.607 -06:00] [ERROR] [Exiled.API] Scale error: System.NullReferenceException
at (wrapper managed-to-native) UnityEngine.Component.get_transform(UnityEngine.Component)
at Exiled.API.Features.Player.set_Scale (UnityEngine.Vector3 value) [0x00006] in <643047ceaa2d4678ad61a6d9003e4e13>:0
EXILED Version ("latest" is not a version):
6.0.0-beta.21
Additional context
I have a plugin that changes the scale of players through different methods. To revert these changes on dying, respawning, etc. I have it automatically set your scale to 1,1,1 when the OnSpawned event is called. I believe that the game changes your role to Spectator, then changes it again to None when a player leaves the server, based on some Log.Info() outputs I've observed. Keep in mind that my plugin tries to detect when the player has left through Player == null, but somehow it still slips by. I believe that when I attempt to modify the scale of the player as they are leaving the server, Exiled fails to realize that the player has left and attempts to go through with it, and something with some delay or whatever results in Exiled attempting to change the scale of the player after the player object has been removed.
Add a SpawnReason == SpawnReason.Destroying check, do not change their scale if so. Player object still exists but their gameobject does not exist anymore (nw moment)
Describe the bug When a player leaves the server, an error is thrown in the console. This does not result in any other issues and has no gameplay impact, but it's an error in the console nonetheless.
To Reproduce Steps to reproduce the behavior:
Expected behavior No error in log. lol
Server logs
EXILED Version ("latest" is not a version): 6.0.0-beta.21
Results of
show plugins
command in console:Additional context I have a plugin that changes the scale of players through different methods. To revert these changes on dying, respawning, etc. I have it automatically set your scale to 1,1,1 when the OnSpawned event is called. I believe that the game changes your role to Spectator, then changes it again to None when a player leaves the server, based on some Log.Info() outputs I've observed. Keep in mind that my plugin tries to detect when the player has left through
Player == null
, but somehow it still slips by. I believe that when I attempt to modify the scale of the player as they are leaving the server, Exiled fails to realize that the player has left and attempts to go through with it, and something with some delay or whatever results in Exiled attempting to change the scale of the player after the player object has been removed.