Fix "PlayBink" kick on Console Command (#132)

When a custom script sends a video to a player's console with "PlayBink" the player will be systematically kicked out
This commit is contained in:
Rickoff
2025-10-10 04:16:29 +03:00
committed by GitHub
parent e999506fb7
commit 3e397a11ea
+8 -1
View File
@@ -1659,12 +1659,19 @@ eventHandler.OnVideoPlay = function(pid)
tes3mp.LogAppend(enumerations.log.INFO, "- packetOrigin was " ..
tableHelper.getIndexByValue(enumerations.packetOrigin, packetOrigin))
if logicHandler.IsPacketFromConsole(packetOrigin) and not logicHandler.IsPlayerAllowedConsole(pid) then
local consoleCommand = tes3mp.GetObjectListConsoleCommand()
local hasConsoleVideoQueued = tableHelper.containsValue(Players[pid].consoleVideosQueued, consoleCommand)
if logicHandler.IsPacketFromConsole(packetOrigin) and not logicHandler.IsPlayerAllowedConsole(pid) and not hasConsoleVideoQueued then
tes3mp.Kick(pid)
tes3mp.SendMessage(pid, logicHandler.GetChatName(pid) .. consoleKickMessage, true)
return
end
if hasConsoleVideoQueued then
Players[pid].consoleVideosQueued = {}
end
if config.shareVideos == true then
tes3mp.LogMessage(enumerations.log.INFO, "Sharing VideoPlay from " .. logicHandler.GetChatName(pid))