mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#CLIENTMENU
This commit is contained in:
parent
f071c674d0
commit
bbf793febe
@ -396,7 +396,7 @@ end
|
|||||||
CLIENTMENUMANAGER = {
|
CLIENTMENUMANAGER = {
|
||||||
ClassName = "CLIENTMENUMANAGER",
|
ClassName = "CLIENTMENUMANAGER",
|
||||||
lid = "",
|
lid = "",
|
||||||
version = "0.1.3",
|
version = "0.1.4",
|
||||||
name = nil,
|
name = nil,
|
||||||
clientset = nil,
|
clientset = nil,
|
||||||
menutree = {},
|
menutree = {},
|
||||||
@ -439,18 +439,18 @@ function CLIENTMENUMANAGER:_EventHandler(EventData)
|
|||||||
--self:I(self.lid.."_EventHandler: "..tostring(EventData.IniPlayerName))
|
--self:I(self.lid.."_EventHandler: "..tostring(EventData.IniPlayerName))
|
||||||
if EventData.id == EVENTS.PlayerLeaveUnit or EventData.id == EVENTS.Ejection or EventData.id == EVENTS.Crash or EventData.id == EVENTS.PilotDead then
|
if EventData.id == EVENTS.PlayerLeaveUnit or EventData.id == EVENTS.Ejection or EventData.id == EVENTS.Crash or EventData.id == EVENTS.PilotDead then
|
||||||
self:T(self.lid.."Leave event for player: "..tostring(EventData.IniPlayerName))
|
self:T(self.lid.."Leave event for player: "..tostring(EventData.IniPlayerName))
|
||||||
local Client = _DATABASE:FindClient( EventData.IniPlayerName )
|
local Client = _DATABASE:FindClient( EventData.IniUnitName )
|
||||||
if Client then
|
if Client then
|
||||||
self:ResetMenu(Client)
|
self:ResetMenu(Client)
|
||||||
end
|
end
|
||||||
elseif (EventData.id == EVENTS.PlayerEnterAircraft) and EventData.IniCoalition == self.Coalition then
|
elseif (EventData.id == EVENTS.PlayerEnterAircraft) and EventData.IniCoalition == self.Coalition then
|
||||||
if EventData.IniPlayerName and EventData.IniGroup then
|
if EventData.IniPlayerName and EventData.IniGroup then
|
||||||
if (not self.clientset:IsIncludeObject(_DATABASE:FindClient( EventData.IniPlayerName ))) then
|
if (not self.clientset:IsIncludeObject(_DATABASE:FindClient( EventData.IniUnitName ))) then
|
||||||
self:T(self.lid.."Client not in SET: "..EventData.IniPlayerName)
|
self:T(self.lid.."Client not in SET: "..EventData.IniPlayerName)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
--self:I(self.lid.."Join event for player: "..EventData.IniPlayerName)
|
--self:I(self.lid.."Join event for player: "..EventData.IniPlayerName)
|
||||||
local player = _DATABASE:FindClient( EventData.IniPlayerName )
|
local player = _DATABASE:FindClient( EventData.IniUnitName )
|
||||||
self:Propagate(player)
|
self:Propagate(player)
|
||||||
end
|
end
|
||||||
elseif EventData.id == EVENTS.PlayerEnterUnit then
|
elseif EventData.id == EVENTS.PlayerEnterUnit then
|
||||||
@ -668,7 +668,7 @@ function CLIENTMENUMANAGER:Propagate(Client)
|
|||||||
for _,_client in pairs(Set) do
|
for _,_client in pairs(Set) do
|
||||||
local client = _client -- Wrapper.Client#CLIENT
|
local client = _client -- Wrapper.Client#CLIENT
|
||||||
if client and client:IsAlive() then
|
if client and client:IsAlive() then
|
||||||
local playername = client:GetPlayerName()
|
local playername = client:GetPlayerName() or "none"
|
||||||
if not self.playertree[playername] then
|
if not self.playertree[playername] then
|
||||||
self.playertree[playername] = {}
|
self.playertree[playername] = {}
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user