Refactpr whosniffer a lil
This commit is contained in:
@@ -309,9 +309,10 @@ aura_env.NotifyGone = function(player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- CHANNEL fuckery
|
-- CHANNEL fuckery
|
||||||
local channel = aura_env.config.channelName or "foobar"
|
local channel = aura_env.config.channel or "foobar"
|
||||||
local password = aura_env.config.channelPassword
|
local password = aura_env.config.channelPassword
|
||||||
|
|
||||||
|
local function FindOrJoinChannel(channelName, password)
|
||||||
local function GetChannelId(channelName)
|
local function GetChannelId(channelName)
|
||||||
local channels = {GetChannelList()}
|
local channels = {GetChannelList()}
|
||||||
for i = 1, #channels, 2 do
|
for i = 1, #channels, 2 do
|
||||||
@@ -323,17 +324,19 @@ local function GetChannelId(channelName)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
channelId = GetChannelId(channel)
|
channelId = GetChannelId(channelName)
|
||||||
if not channelId then
|
if not channelId then
|
||||||
print(string.format("channel %s not found, joining", channel))
|
print(string.format("channel %s not found, joining", channelName))
|
||||||
if password then
|
if password then
|
||||||
JoinPermanentChannel(channel, password)
|
JoinPermanentChannel(channelName, password)
|
||||||
else
|
else
|
||||||
JoinPermanentChannel(channel)
|
JoinPermanentChannel(channelName)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
channelId = GetChannelId(channel)
|
channelId = GetChannelId(channelName)
|
||||||
aura_env.channelId = channelId
|
return channelId
|
||||||
|
end
|
||||||
|
aura_env.channelId = FindOrJoinChannel(channel, password)
|
||||||
print(string.format("channel %s resolved to id %d", channel, channelId))
|
print(string.format("channel %s resolved to id %d", channel, channelId))
|
||||||
|
|
||||||
---@param player Player
|
---@param player Player
|
||||||
|
Reference in New Issue
Block a user