Thread Tools Display Modes
05-17-14, 10:14 PM   #1
Riveth
A Kobold Labourer
Join Date: May 2014
Posts: 1
Character "Lock"

About five years ago, someone posted a request for a way to "lock" characters: http://www.wowinterface.com/forums/s...ad.php?t=20805

Some kind soul created an addon: http://www.wowinterface.com/download...acterLock.html

Unfortunately that addon hasn't been updated in years. I'm in a similar situation. I have a kid who likes to get on and just fly around. I only want him on one character. I would love to find an addon that required a password/PIN to be entered after the player enters the world. If the code is not entered within a short period of time, then it would logout.

I realize you could just disable this via the addon selector or by using another computer without the addon, but that is more than my munchkin can figure out right now.

Anyone seen a similar current addon?
  Reply With Quote
05-18-14, 01:16 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
I would first check out what the Blizzard parental contols for wow might give you in terms of who can do what in-game and chat filtering.

Second, if it's what you want, I would see if the addon you mentioned still works. It might mean enabling Out of Date Addons under the AddOn button at the charater selections screen or even an edit of the .TOC file to replace the
## Interface: ...
line with
## Interface: 50400
to automaticaly make it MoP current (asuming the code still works as an "Out of Date AddOn") ... Not really recommended but if it works for you...

But if your munchkin can get around these, you might just want to introduce them to the game .
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-18-14 at 01:30 AM.
  Reply With Quote
05-18-14, 01:36 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Parental controls don't let you limit which characters can be played.

I also peeked at the linked addon's code, and it's pretty messy. It also seems a little overcomplicated for what it needs to do. Here's a simpler version; rather than in-game slash commands you can just edit the file in Notepad to change the password and add/remove characters that don't require a password.

Code:
local PASSWORD = "YourPasswordHere"

local ALLOWED_CHARACTERS = {
	["Server Name - Charactername"] = true,
}

------------------------------------------------------------------------
-- End of configuration
------------------------------------------------------------------------

local logout, total = 0, 0
local f = CreateFrame("Frame", "CharLockFrame", WorldFrame)
local t3 = f:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")

f:Hide()
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", function(self)
	self:UnregisterAllEvents()
	if ALLOWED_CHARACTERS[format("%s - %s", GetRealmName(), (UnitName("player")))] then return end

	self:SetAllPoints(true)
	self:SetFrameStrata("FULLSCREEN_DIALOG")

	local tx = self:CreateTexture(nil, "ARTWORK")
	tx:SetAllPoints(true)
	tx:SetTexture(0, 0, 0, 1)

	local t1 = self:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
	t1:SetPoint("BOTTOM", self, "CENTER", 0, 10)
	t1:SetText("Enter your password to unlock this character.")
	
	local t2 = self:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")

	local eb = CreateFrame("EditBox", "$parentEditBox", self, "InputBoxTemplate")
	eb:SetPoint("TOP", self, "CENTER", 0, -10)
	eb:SetSize(160, 24)
	eb:SetAltArrowKeyMode(false)
	eb:SetScript("OnEnterPressed", function(this)
		if this:GetText() == PASSWORD then
			self:Hide()
		else
			t2:Show()
		end
	end)
	
	t2:SetPoint("TOP", eb, "BOTTOM")
	t2:SetText("|T"..STATICPOPUP_TEXTURE_ALERT..":0|t |cffff6666Wrong password!|r")
	t2:Hide()

	t3:SetPoint("TOP", t2, "BOTTOM", 0, -10)
	t3.format = "You will be logged out in %d seconds."

	total = 30
	logout = IsResting() and 10 or 30
	
	self:Show()
end)

f:SetScript("OnUpdate", function(self, elapsed)
	total = total - elapsed
	t3:SetFormattedText(t3.format, total)

	if logout then
		logout = logout - elapsed
		if logout < 0 then
			Logout()
		end
		logout = nil
	end
end)
If you need help turning the above code into an addon, copy and paste it into this page:
http://addon.bool.no/
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 05-18-14 at 05:36 AM.
  Reply With Quote
05-18-14, 04:29 AM   #4
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
I would add a Force Quit is there's a wait time on logout personally.
__________________
Tweets YouTube Website
  Reply With Quote
05-18-14, 05:21 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Yeah, that's accounted for. If you're resting it starts the actual logout only after 30 seconds, otherwise it starts the logout after 10 seconds, so either way you're logged out after 30 seconds if the correct password isn't entered.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-19-14, 05:42 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by Phanx View Post
Originally Posted by 10leej View Post
I would add a Force Quit is there's a wait time on logout personally.
Yeah, that's accounted for. If you're resting it starts the actual logout only after 30 seconds, otherwise it starts the logout after 10 seconds, so either way you're logged out after 30 seconds if the correct password isn't entered.
I think the point was if the player wasn't in a rested area, they can click cancel on the logout timer and that would bypass the addon code completely.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
05-20-14, 01:57 AM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by SDPhantom View Post
I think the point was if the player wasn't in a rested area, they can click cancel on the logout timer and that would bypass the addon code completely.
The password prompt covers the entire screen, including the logout dialog.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Character "Lock"


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off