07.05.2017, 09:52
I have found a weird bug and I wonder if this is possible to be fixed using YSF.
Basically here's what happens when someone connects to my server:
- OnPlayerRequestClass = Calls SpawnPlayer native
- OnPlayerSpawn = check if logged (show DIALOG_LOGIN)
- OnPlayerAttemptLogin = if signed in using password, call LoadCharacterData
- LoadCharacterData = attach objects to the player (keep in mind, player is already spawned).
- LoadCharacterDataItems = call SetPlayerSpawnInfoEx
- SetPlayerSpawnInfoEx = SetPlayerSpawnInfo w/ SetPlayerTeam, virtual world, interiorid + call SpawnPlayer which forces player to call OnPlayerSpawn again
- OnPlayerSpawn = player spawns successfully but no objects are attached to him which were done in LoadCharacterData.
I have a workaround (SetPlayerPos instead of forcing player to spawn again) but I wonder if it's possible to fix internally by YSF.
In short: when you spawn player, attach objects to him and spawn him again - no objects are attached.
Basically here's what happens when someone connects to my server:
- OnPlayerRequestClass = Calls SpawnPlayer native
- OnPlayerSpawn = check if logged (show DIALOG_LOGIN)
- OnPlayerAttemptLogin = if signed in using password, call LoadCharacterData
- LoadCharacterData = attach objects to the player (keep in mind, player is already spawned).
- LoadCharacterDataItems = call SetPlayerSpawnInfoEx
- SetPlayerSpawnInfoEx = SetPlayerSpawnInfo w/ SetPlayerTeam, virtual world, interiorid + call SpawnPlayer which forces player to call OnPlayerSpawn again
- OnPlayerSpawn = player spawns successfully but no objects are attached to him which were done in LoadCharacterData.
I have a workaround (SetPlayerPos instead of forcing player to spawn again) but I wonder if it's possible to fix internally by YSF.
In short: when you spawn player, attach objects to him and spawn him again - no objects are attached.
