ExMod-Team / EXILED

A high-level plugin framework for SCP: Secret Laboratory servers (scpsl). It offers an event system for developers to hook in order to manipulate or change game code, or implement their own functions.
https://docs.exiled-team.net/
Other
68 stars 49 forks source link

[BUG] Lockers are not prepared when OnWaitingForPlayers is called. #137

Open SrLicht opened 1 month ago

SrLicht commented 1 month ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Try to use a locker when OnWaitingForPlayers is called.
  2. Either the list is empty, there are only a few lockers or NullReference can occur.

Expected behavior All the lockers generated in OnMapGenerated should be ready when OnWaitingForPlayers is called, since it is an event that occurs after

Server logs N/A

EXILED Version ("latest" is not a version): 8.12.2

Results of pluginmanager show command in console:

[2024-10-21 14:01:45.927 -03:00] Total number of plugins: 12
                                 Enabled plugins: 11
                                 Disabled plugins: 1

                                 Exiled.Events:
                                        - Author: Exiled Official
                                        - Version: 8.12.2.0
                                        - Required Exiled Version: 8.12.2.0
                                        - Prefix: exiled_events
                                        - Priority: Highest
                                 SCP-012:
                                        - Disabled
                                        - Author: Smusi Jarvis & Parrot
                                        - Version: 1.1.0
                                        - Required Exiled Version: 8.9.6
                                        - Prefix: s_c_p012
                                        - Priority: Medium
                                 Exiled.CustomRoles:
                                        - Author: Exiled Official
                                        - Version: 8.12.2.0
                                        - Required Exiled Version: 8.12.2.0
                                        - Prefix: exiled_custom_roles
                                        - Priority: Medium
                                 BetterHelpCommand:
                                        - Author: yamato
                                        - Version: 0.0.0.0
                                        - Required Exiled Version: 8.12.2.0
                                        - Prefix: better_help_command
                                        - Priority: Medium
                                 ScpProximityChat:
                                        - Author: Jesus-QC
                                        - Version: 2.0.0.0
                                        - Required Exiled Version: 8.7.0
                                        - Prefix: ScpProximityChat
                                        - Priority: Medium
                                 Exiled.CreditTags:
                                        - Author: Babyboucher20 & iRebbok & Exiled Team
                                        - Version: 8.12.2.0
                                        - Required Exiled Version: 8.12.2.0
                                        - Prefix: exiled_credits
                                        - Priority: Medium
                                 Exiled.CustomItems:
                                        - Author: Exiled Official
                                        - Version: 8.12.2.0
                                        - Required Exiled Version: 8.12.2.0
                                        - Prefix: exiled_custom_items
                                        - Priority: Medium
                                 AutoEvent:
                                        - Author: Created by a large community of programmers, map builders and just ordinary people, under the leadership of RisottoMan.
                                        - Version: 9.8.1
                                        - Required Exiled Version: 8.9.6
                                        - Prefix: auto_event
                                        - Priority: Medium
                                 MapEditorReborn:
                                        - Author: Michal78900
                                        - Version: 3.2.0
                                        - Required Exiled Version: 8.9.5
                                        - Prefix: map_editor_reborn
                                        - Priority: Medium
                                 Exiled.Permissions:
                                        - Author: Exiled Official
                                        - Version: 8.12.2.0
                                        - Required Exiled Version: 8.12.2.0
                                        - Prefix: exiled_permissions
                                        - Priority: Medium
                                 Cerberus.Tweaks:
                                        - Author: SrLicht
                                        - Version: 4.0.0
                                        - Required Exiled Version: 8.0.0
                                        - Prefix: cerberus_tweaks
                                        - Priority: Lowest
                                 AdvancedMERTools:
                                        - Author: 
                                        - Version: 1.0.0.0
                                        - Required Exiled Version: 8.12.2.0
                                        - Prefix: advanced_m_e_r_tools
                                        - Priority: Lowest
VALERA771 commented 1 month ago

Iirc this is a game thing or idk. Lockers are spawning when room with them is opened first time. You can check it with noclip. Anyway I'll try to find time to investigate this issue

VALERA771 commented 1 month ago
[24-10-2024 18:56] [WARN] [Exiled.Events] Scp018PedestalStructure Variant(Clone)
                   Scp207PedestalStructure Variant(Clone)
                   Scp244PedestalStructure Variant(Clone)
                   Scp268PedestalStructure Variant(Clone)
                   LargeGunLockerStructure(Clone)
                   RifleRackStructure(Clone)
                   MiscLocker(Clone)
                   MiscLocker(Clone)
                   RegularMedkitStructure(Clone)
                   RegularMedkitStructure(Clone)
                   AdrenalineMedkitStructure(Clone)
                   Scp500PedestalStructure Variant(Clone)
                   Scp1853PedestalStructure Variant(Clone)
                   Scp2176PedestalStructure Variant(Clone)
                   Scp1576PedestalStructure Variant(Clone)
                   AdrenalineMedkitStructure(Clone)
                   MiscLocker(Clone)
                   MiscLocker(Clone)
                   MiscLocker(Clone)
                   Scp207PedestalStructure Variant(Clone)
                   AdrenalineMedkitStructure(Clone)
                   MiscLocker(Clone)
                   AdrenalineMedkitStructure(Clone) - Locker::List
[24-10-2024 18:56] [WARN] [Exiled.Events] 31 - Object.FindObjectsOfType<Locker>().Lenght

List seems to be not really but correct. Is this that you meant?

SrLicht commented 1 month ago
[24-10-2024 18:56] [WARN] [Exiled.Events] Scp018PedestalStructure Variant(Clone)
                   Scp207PedestalStructure Variant(Clone)
                   Scp244PedestalStructure Variant(Clone)
                   Scp268PedestalStructure Variant(Clone)
                   LargeGunLockerStructure(Clone)
                   RifleRackStructure(Clone)
                   MiscLocker(Clone)
                   MiscLocker(Clone)
                   RegularMedkitStructure(Clone)
                   RegularMedkitStructure(Clone)
                   AdrenalineMedkitStructure(Clone)
                   Scp500PedestalStructure Variant(Clone)
                   Scp1853PedestalStructure Variant(Clone)
                   Scp2176PedestalStructure Variant(Clone)
                   Scp1576PedestalStructure Variant(Clone)
                   AdrenalineMedkitStructure(Clone)
                   MiscLocker(Clone)
                   MiscLocker(Clone)
                   MiscLocker(Clone)
                   Scp207PedestalStructure Variant(Clone)
                   AdrenalineMedkitStructure(Clone)
                   MiscLocker(Clone)
                   AdrenalineMedkitStructure(Clone) - Locker::List
[24-10-2024 18:56] [WARN] [Exiled.Events] 31 - Object.FindObjectsOfType<Locker>().Lenght

List seems to be not really but correct. Is this that you meant?

https://github.com/ExMod-Team/EXILED/pull/110#issuecomment-2423580329

VALERA771 commented 1 month ago

Idk really. What is the exact problem with lockers on WaitingForPlayers event? Seems that list is pretty big