'Bob Doe' is already authorized to use the microphone. When he talks, the microphone relays the message to the speakers.
'Jane Doe' is not authorized. When she talks, the microphone will not relay the message. She then uses the built-in authorization system to become whitelisted. She talks and the microphone relays the message.
So, here's my problem. I keep the whitelisted users in keys, so objects with the same name can't interfere, but I've hit a snag; the list doesn't seem to be able to update.
-
list microphone_whitelist = [];
string whitelist_search;
vector white = <1.0,1.0,1.0>;
default
{
state_entry()
{
llSetText("Microphone", <1.0,1.0,1.0>, 1.0);
llListen(0, "", NULL_KEY, ""

}
listen(integer channel, string name, key id, string message)
{
whitelist_search = id;
integer whitelist_validate = llListFindList(microphone_whitelist, [whitelist_search]);
if (whitelist_validate == -1)
{
llOwnerSay("Unwhitelisted Avatar/Object is trying to use microphone"

}
else
{
llRegionSay(100, "


}
}
link_message(integer sender_num, integer num, string str, key id)
{
//For recording purposes, get name of person trying to authorize
string SendIDName = llKey2Name(id);
whitelist_search = id;
integer whitelist_validate = llListFindList(microphone_whitelist, [whitelist_search]);
if (whitelist_validate == -1)
{
//Code if unauthorized
llOwnerSay(SendIDName+" has been authorized to use the microphone."

llInstantMessage(id, "You have been authorized to use the microphone."

microphone_whitelist += microphone_whitelist + [id];
}
else
{
//Code if authorized
llOwnerSay(SendIDName+" is already authorized to use the microphone."

llInstantMessage(id, "You are already authorized to use the microphone."

}
}
}
-
In the command 'microphone_whitelist += microphone_whitelist + [id];', it does not update the list. If 'Jane Doe' were to get the 'Successful authorization' message, she would still be treated as an unwhitelisted agent.
Any ideas on how to get the list to successfully update? I appreciate any help.
(For the ID in link_message, the other script inside the microphone sends the proper ID- I can get the right name out of that.)