Skip to content
Permalink
Browse files

Broadcast channel password check (#373)

* Check for password

* Let me change the function Travis

* IntelliJ if I press tab it's to add a tab not 4 spaces ffs
  • Loading branch information
Solanya committed Dec 11, 2019
1 parent b928f3f commit 83b7341f1c935dbc0972ced00d3587f30038d311
Showing with 16 additions and 1 deletion.
  1. +1 −1 .luacheckrc
  2. +15 −0 totalRP3/core/impl/communication_protocol_broadcast.lua
@@ -34,6 +34,7 @@ globals = {
-- Blizzard Overrides
"GetColoredName",
"ItemRefTooltip",
"SetChannelPassword",
"SlashCmdList",
"StaticPopupDialogs",

@@ -9856,7 +9857,6 @@ stds.wow = {
"SetButtonPulse",
"SetCemeteryPreference",
"SetChannelOwner",
"SetChannelPassword",
"SetChatColorNameByClass",
"SetChatMouseOverDelay",
"SetChatUnitColor",
@@ -121,6 +121,17 @@ function Comm.broadcast.registerCommand(command, callback)
tinsert(PREFIX_REGISTRATION[command], callback);
end

local SetChannelPasswordOld = SetChannelPassword;
SetChannelPassword = function(data, password)
if data ~= config_BroadcastChannel() or password == "" then
SetChannelPasswordOld(data, password);
else
-- We totally changed it :fatcat:
local message = loc.BROADCAST_PASSWORD:format(data);
Utils.message.displayMessage(message);
end
end

--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-- Peer to peer part
--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
@@ -341,6 +352,10 @@ Comm.broadcast.init = function()
if mode == "PASSWORD_CHANGED" and channel == config_BroadcastChannel() then
Utils.message.displayMessage(loc.BROADCAST_PASSWORDED:format(user, channel));
end
-- We can't do this yet, will see in 9.0 if addons don't get restricted from using channels.
--if mode == "OWNER_CHANGED" and user == TRP3_API.globals.player_id and channel == config_BroadcastChannel() then
-- SetChannelPassword(config_BroadcastChannel(), "");
--end
end);

-- When you are already in 10 channel

0 comments on commit 83b7341

Please sign in to comment.
You can’t perform that action at this time.