mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 15:55:39 +02:00
Changes trying to get player disconnect event hanlder to work
This commit is contained in:
@@ -665,11 +665,15 @@ Perun.onSimulationStop = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
Perun.onPlayerDisconnect = function(id, err_code)
|
Perun.onPlayerDisconnect = function(id, err_code)
|
||||||
-- Player disconnected - TBD DCS Bug, this is not triggered at this point of time
|
-- Player disconnected
|
||||||
if err_code == nil then
|
Perun.LogEvent("disconnect", "Player " .. id .. " disconnected.",nil,nil);
|
||||||
err_code = "-1"
|
return
|
||||||
end
|
end
|
||||||
Perun.LogEvent("disconnect", "Player " .. net.get_player_info(id, "name") .. " disconnected; " .. err_code,net.get_player_info(id, "name"),err_code);
|
|
||||||
|
Perun.onPlayerStop = function (id)
|
||||||
|
-- Player left the simulation (happens right before a disconnect, if player exited by desire)
|
||||||
|
Perun.LogEvent("quit", "Player " .. id .. " quit the server.",nil,nil);
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
Perun.onSimulationFrame = function()
|
Perun.onSimulationFrame = function()
|
||||||
@@ -815,7 +819,7 @@ Perun.onGameEvent = function (eventName,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
|
|||||||
elseif eventName == "disconnect" then
|
elseif eventName == "disconnect" then
|
||||||
--"disconnect", playerID, name, playerSide, reason_code
|
--"disconnect", playerID, name, playerSide, reason_code
|
||||||
Perun.LogStats(arg1);
|
Perun.LogStats(arg1);
|
||||||
Perun.LogEvent(eventName, Perun.SideID2Name(arg3) .. " player " ..net.get_player_info(arg1, "name") .. " disconnected",nil,nil);
|
Perun.LogEvent(eventName,"Player " .. arg1 .. " disconnected!",nil,nil);
|
||||||
|
|
||||||
elseif eventName == "crash" then
|
elseif eventName == "crash" then
|
||||||
--"crash", playerID, unit_missionID
|
--"crash", playerID, unit_missionID
|
||||||
|
|||||||
Reference in New Issue
Block a user