During login and while you play, Sentinel sends some Lua code to your client using the addon message channel. It's not clear to me how this code is executed once it arrives to the client or why is it being sent using addon messages. Some of these scripts add UI features while others try to catch cheaters.
I am publishing this as a technical curiosity more than anything else. Excuse the format, I know how much blogspot sucks for posting snippets.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Relays the event MACRO_ACTION_FORBIDDEN to all subscribed frames whenever the protected function ClearTarget() is used by tainted code.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LogoutFrame:RegisterEvent("PLAYER_LOGOUT")
LogoutFrame:SetScript("OnEvent",function()
SendAddonMessage('(redacted)','(redacted)','WHISPER','(redacted)')
end)
Sends back a message whenever the player logs out or reloads the interface.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
return
end
local soloqueueFrame=CreateFrame("Frame")
soloqueueFrame:RegisterEvent("UPDATE_BATTLEFIELD_STATUS")
soloqueueFrame:SetScript("OnEvent",function()
local a,b,c,d,e=GetBattlefieldStatus(1)
if (e==0xFF) then
SOLOQUEUE_AVOID_TEAMMATE="Avoid as Teammate"
UnitPopupButtons["PVP_REPORT_AFK"].text=SOLOQUEUE_AVOID_TEAMMATE
else
UnitPopupButtons["PVP_REPORT_AFK"].text=PVP_REPORT_AFK
end
end)
soloqueueFrame:GetScript('OnEvent')()
This is the code that adds the "Avoid as Teammate" option in soloq games.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UIDropDownMenu_Initialize(dropDown,XPRMDD,"MENU")
MainMenuExpBar:SetScript("OnMouseDown",function(self,button)
if button=="RightButton" then
ToggleDropDownMenu(1,nil,dropDown,"cursor",3,-3)
end
end)
UIDropDownMenu_Initialize(dropDown,function(self,level,menuList)
local info=UIDropDownMenu_CreateInfo()
local title=info
title.text=EXPERIENCE_COLON
title.isTitle=1
UIDropDownMenu_AddButton(title,level)
info=UIDropDownMenu_CreateInfo()
info.func=self.SetValue
for i=1,#XPRates do
local currate=XPRates[i]
info.text,info.arg1,info.checked="x"..currate,currate,currate == XPRate
UIDropDownMenu_AddButton(info,level)
end
end)
function dropDown:SetValue(xp)
XPRate=xp
SendAddonMessage('(redacted)',xp,'WHISPER','(redacted)')
CloseDropDownMenus()
end
This is the dropdown that allows you to choose an experience multiplier by right-clicking the experience bar.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is the code that allows you to toggle mercenary mode in the battleground button dropdown.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SendAddonMessage('(redacted)','(redacted 1)','WHISPER','(redacted)')
else
SendAddonMessage('(redacted)','(redacted 2)','WHISPER','(redacted)')
end
This one is sent periodically. It will send different addon messages depending on whether you interfered with the modifications done by the first script or not.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This checks if there is a cvar called "SCRIPT_HANDLER_LOAD" and if so it sends its length back to the server as an addon message.
There's a very similar one that checks for the existence of a function called "unlock". If detected an addon message is sent also.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FirstFrame:UnregisterAllEvents()
FirstFrame:SetScript("OnUpdate",nil)
FirstFrame.(redacted)=0
FirstFrame.(redacted)=0
FirstFrame=nil
end
if(OriginalClearTarget)then
ClearTarget=OriginalClearTarget
OriginalClearTarget=nil
end
Not sure about this one at all. Seems to undo some of the previous things, although I see no reference to FirstFrame in any of the other scripts (perhaps an older script that is no longer in use?).