removed useless _ folders

This commit is contained in:
Fred Beckhusen
2015-08-09 16:54:31 -05:00
parent fde850293c
commit 948a44dfba
5204 changed files with 2425579 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
<Solution name="Dance_Server_System">
<Project name="Dance_Server_System" path="Dance_Server_System\Dance_Server_System.prj" active="true"/>
</Solution>

View File

@@ -0,0 +1,8 @@
<Project name="Dance_Server_System" guid="D8AFDB05-6C00-1014-B904-200204C60A89">
<Object name="Object" guid="D8AFDC1B-6C00-1014-B904-200204C60A89">
<Script name="Dance_Server_System_1.lsl" guid="D8B020DE-6C00-1014-B904-200204C60A89">
</Script>
<Script name="Dance_Server_System_2.lsl" guid="D8B03E6C-6C00-1014-B904-200204C60A89">
</Script>
</Object>
</Project>

View File

@@ -0,0 +1,214 @@
// :CATEGORY:Dance
// :NAME:Dance_Server_System
// :AUTHOR:Holy Gavenkrantz
// :CREATED:2011-07-05 15:58:40.700
// :EDITED:2013-10-14 12:01:10
// :ID:212
// :NUM:286
// :REV:1.0
// :WORLD:Second Life
// :DESCRIPTION:
// Dance Srver for multiple people and dnaces
// :CODE:
// I have had a lot of people asking about dance server scripts or needing help modifying scripts and they were always by or modeled after the SOLOP server script by Evil Fool. It worked well enough but seemed to be tough on SIM resources in my opinion so I made up my own based on the same idea. The problem I found was that all the scripts would fire their link_message event every time someone touched the dance prim and the more dancers there were the slower the response because each script passes the link_message on to the next script until the filter matched. This causes an onslaught of message_linked events because even though a script may not do anything with the message its event still must fire. Additionally, there were the scanners to detect if the avatar was still around. Add to that again any menus or other features people were requesting to be added to the scripts.// // In my example below all the dance scripts are set to NOT running. The only scripts running are the main server script and any dancer script associated with each avatar. There is only one 30 second timer running checking for the presence of each avatar via llGetAgentSize. The only other running timers only occur while someone has a menu open and those will stop if a selection is made or they time out. It works well for me but I haven't been able to stress test it because well, I don't have enough friends. (I've had 50 dance scripts and 250 dance animations in the server and it worked well but again I didn't have many dancers) Anyway, follow the instructions below and let me know what you think or if you see ways of improving it.// // To Start://
// 1. Create a folder in your inventory - call it Dance Server or what ever you want.
//
// 2. Create a new script in this folder called "!Holy Server" ( the name isn't important but you will help my ego by leaving it this)
//
// 3. Copy and paste the script from below of the same name into this new script. Save and close it.
//
// 4. Create another script in this folder and call it "!Dancer" ( name not important again)
//
// 5. Copy and paste the script from below of the same name into this new script. Save and close it.
//
// 6. Create your prim that will hold all the animations and scripts.
//
// 7. Drag a copy of the "!Holy Server" script into the prims inventory.
//
// 8. Drag as many copies of the "!Dancer" script as you think you will need into the prims inventory. You will see the names of this script change automatically as a number is added to the script name. This is fine as well as required to identify each script later on.
//
// 9. Drag all your dance animations into the Prim.
//
// 10. If you have more than 200 animations plus dancer scripts then, while you have the edit box open, go to Tools at the top of your viewer and select Recompile Scripts in Selection > MONO. This is to prevent stack heap errors. Otherwise you should be able to recompile in LSL. If at all possible run the dance server in LSL mode - its just that much less memory used.
//
// 11. Close the edit box and touch the prim and select "Reset" from the menu when it comes up.
//
// 12. Dance!
// !Holy Server
// mods by DonJr SpeigelBlatt and Ferd Frederix
//Created Oct 2010 by Holy Gavenkrantz
//This work uses content from the Second Life® LSL Script library.
//Copyright © 2007-2009 Linden Research, Inc. Licensed under the
//Creative Commons Attribution-Share Alike 3.0 License
// Insert this script in your prim
// If you sell this I have hidden code in here that will delete your head
list gAvKeyList; //store all the keys and associated dance script numbers here
list gDanceList; //store all the dance animations in the prims inventory here
integer gActive = FALSE; //part of the dance script reset function
updatetext()//this keeps the users updated as to dance server status
{
llSetText(llGetObjectName() + "-" + (string)llGetListLength(gDanceList) + " Dances"
+ "\nClick to start dancing!\nCurrently Dancing: " + (string)(llGetListLength(gAvKeyList) / 2)
+ " of " + (string)(llGetInventoryNumber(INVENTORY_SCRIPT) - 1)
+ " possible slots.", <llFrand(1.0),llFrand(1.0),llFrand(1.0)>, 1);
}
reset_scripts()//this function resets all the individula dance scripts
{
llSetText(llGetObjectName() +"\nResetting Dance Scripts...", <llFrand(1.0),llFrand(1.0),llFrand(1.0)>, 1);
gActive = TRUE;
integer num = llGetInventoryNumber(INVENTORY_SCRIPT);//get the number of scripts
integer i;
while ( i < num )
{
string script_name = llGetInventoryName(INVENTORY_SCRIPT, i);//store the script name temporarily
if ( script_name != llGetScriptName() )//don't reset this script... just yet
{
llSetScriptState(script_name, TRUE);//turn on the dance script
llResetOtherScript(script_name);//reset it so it loads the data it needs to store ( it will shut itself back off)
}
++i;//get the next script
}
llSleep(1); //this isn't required if you have 10 or more dance scripts
updatetext();
}
default
{
state_entry()
{
llSetText(llGetObjectName() +"\nLoading animations...", <llFrand(1.0),llFrand(1.0),llFrand(1.0)>, 1);
integer num = llGetInventoryNumber(INVENTORY_ANIMATION);
integer i;
while ( i < num )//build the list of animations
{
gDanceList += llGetInventoryName(INVENTORY_ANIMATION, i);
++i;
}
updatetext();
//llOwnerSay((string)llGetFreeMemory());
}
touch_start(integer total_number)
{
if ( ! gActive ) //if gActive is false then reset all the scripts
{
reset_scripts();
}
integer i;
for (i = 0; i < total_number; ++i)
{
key current_key = llDetectedKey(i);
integer search = llListFindList(gAvKeyList,[current_key] ); // missing current_key
if ( ~search ) //if the detected key is found they already have a dance script assigned
{
llMessageLinked(LINK_THIS, llList2Integer(gAvKeyList, search + 1),
llDumpList2String(gDanceList, ","), current_key);
}
else
{
gAvKeyList += current_key;//else add their key to the list
if ( llGetListLength(gAvKeyList) / 2 > llGetInventoryNumber(INVENTORY_SCRIPT) - 1 )
{//check to see if there are any positions left
//- if not remove their key from the list and let them know they must wait
llInstantMessage(current_key, "Sorry but there are no dance positions left");
gAvKeyList = llDeleteSubList(gAvKeyList, -1, -1);
}
else//there is an opening - find a non running script to assign to them
{
integer num = llGetInventoryNumber(INVENTORY_SCRIPT);
integer j;
while ( j < num )
{
string script_name = llGetInventoryName(INVENTORY_SCRIPT, j);
if ( llGetScriptState(script_name) )//if the script name = this script goto the next one
{
++j;
}
else
{
j = num;//stop the loop
llSetScriptState(script_name, TRUE);//start the dance script
integer name_search = llSubStringIndex(script_name, " ");//parse the script number from its name
integer script_num = (integer)llGetSubString(script_name, name_search + 1, -1);
gAvKeyList += script_num;//add the number to the key list
//send a message to the appropriate script containg the list of animation and the users key
llMessageLinked(LINK_THIS, script_num, llDumpList2String(gDanceList, ","), current_key);
}
}
}
}
}
}
link_message(integer sender_num, integer num, string msg, key id)
{
if ( num == -5555 )//only do stuff if a message was sent to this number
{
if ( msg == "cancel" )//if the message was cancel then delete the users key and script number from the key list
{
integer search = llListFindList(gAvKeyList, [id]); // missing id
if ( ~search )
{
gAvKeyList = llDeleteSubList(gAvKeyList, search, search + 1);
}
}
else if ( msg == "color" )//this means a dance was selected - start a timer ( explained in the timer function)
{
llSetTimerEvent(30);
}
else if ( msg == "reset" )//reset the system - only the owner as this capability
{
reset_scripts();
llResetScript();
}
updatetext();
}
}
timer()
{
if ( gAvKeyList )//as long as there is a key in the keylist keep checking that each user is still in the sim
{
integer len = llGetListLength(gAvKeyList);
integer i;
while ( i < len )
{
if ( llGetAgentSize(llList2Key(gAvKeyList, i)) )//if a valid size is returned then they are still here
{
i += 2;//check the next key
}
else//nope, they're gone remove them from the list and check the next key
{
llMessageLinked(LINK_THIS, llList2Integer(gAvKeyList, i + 1), "", "");
gAvKeyList = llDeleteSubList(gAvKeyList, i, i + 1);
len = llGetListLength(gAvKeyList);
}
}
updatetext();
}
else
{
llSetTimerEvent(0);//the key list is empty - stop checking
}
}
changed(integer change)
{
if ( change & CHANGED_REGION_START )
{
reset_scripts();
llResetScript();
}
}
on_rez(integer rez)
{
llResetScript();//gets the ball rolling
}
}

View File

@@ -0,0 +1,271 @@
// :CATEGORY:Dance
// :NAME:Dance_Server_System
// :AUTHOR:Holy Gavenkrantz
// :CREATED:2011-07-05 15:58:40.700
// :EDITED:2013-10-14 12:01:10
// :ID:212
// :NUM:287
// :REV:1.0
// :WORLD:Second Life
// :DESCRIPTION:
// Dancer Slave
// :CODE:
// mods by DonJr SpeigelBlatt and Ferd Frederix
//This work uses content from the Second Life LSL Script library. Copyright © 2007-2009 Linden Research, Inc. Licensed under the Creative Commons Attribution-Share Alike 3.0 License
// !Dancer
//
//Created Oct 2010 by Holy Gavenkrantz
// Insert as many copies of this script in your prim that you think you will need to match the number of dancers
// If you sell this I have hidden code in here that will delete your head
integer gDialogCH; //channel the menu will use
integer gListener; //open a listen so the script will hear menu choices
integer gIndex = 0; //used in the menu system to track NEXT and PREV functions
integer gScriptNum; //store the script number taken from the script name here
key gAvKey; //store the avatar key here
list gDanceList; //store the list of dance animations here
string gDance; //store the current dance here
integer gCount_limit = 9 ; // number of menu items
menu( list button_list )//le menu
{
integer items = llGetListLength(button_list);
string dialog_text = "\nSelect a Dance";
list button;
integer count = 0;
string check_item = "foo";
while ( check_item != "" )//compile buttons and descriptions
{
check_item = llList2String(button_list, gIndex + count);
if ( check_item != "" )
{
if ( count < gCount_limit )
{
++ count;
string count_item = (string)( count + gIndex) + ".";
dialog_text += "\n" + count_item + " " + check_item;
button += (string)( count + gIndex); }
else
{
check_item = "";
}
}
}
integer dumb_button;//fill in the spaces with "-"
integer i;
if ( count > 3 && count < 6 )
{
dumb_button = 6 - count;
}
if ( count > 6 && count < 9 )
{
dumb_button = 9 - count;
}
if ( count > 10 && count < 12 )
{
dumb_button = 12 - count;
}
for ( i = 0; i < dumb_button; ++ i )
{
button += "-";
}
button = llList2List(button, -3, -1) + llList2List(button, -6, -4)
+ llList2List(button, -9, -7) + llList2List(button, -12, -10);//flip the list
if ( gIndex + gCount_limit < items )//add the next, previous and cancel buttons
{
button = "Next >>" + button;
}
else if ( gIndex + gCount_limit >= items && items > gCount_limit )//wrap back to start of list
{
button = "Start >>" + button;
}
else
{
button = "-" + button;
}
button = "Cancel" + button;
if ( gAvKey == llGetOwner() ) button = "Reset" + button;
if ( gIndex > 0 )
{
button = "<< Prev." + button;
}
else if ( gIndex == 0 && items > gCount_limit )//wrap to the end of list
{
button = "<< End" + button;
}
else
{
button = "-" + button;
}
llSetTimerEvent(60);
llListenRemove(gListener);
gListener = llListen(gDialogCH, "", gAvKey, "");
llDialog(gAvKey, dialog_text, button, gDialogCH);//send the menu
}
default
{
changed(integer change)
{//this probably isn't required because the natural operation of the script resets it anyway
if ( change & CHANGED_OWNER )
{
llResetScript();
}
}
state_entry()
{
//create a negative integer using the scripts key
//assign a script number using the number at teh end of the script name
//shut the script off
gDialogCH = (integer)("0x"+llGetSubString(llGetInventoryKey(llGetScriptName()),0,6)) * -1;
integer name_search = llSubStringIndex(llGetScriptName(), " ");
gScriptNum = (integer)llGetSubString(llGetScriptName(), name_search + 1, -1);
llSetScriptState(llGetScriptName(), FALSE);
llSleep(.5);
}
link_message(integer sender_num,integer num,string str,key id)
{
if ( num == gScriptNum )
{
if ( id )//if id is a valid key means the main server has passed someone touch request
{
gAvKey = id;
gDanceList = llParseString2List(str, [","], []);//store the list of animations
if ( gAvKey == llGetOwner() )
gCount_limit = 8;
else
gCount_limit = 9;
menu(gDanceList);
}
else
{
llResetScript();//any other message from the server requires a reset
}
}
}
listen(integer channel, string name, key id, string message)
{
if ( channel == gDialogCH )
{
llSetTimerEvent(0);
llListenRemove(gListener);
if ( message == "Cancel" || message == "-" )
{
if ( llGetPermissionsKey() )//if already dancing just close the menu
{
gIndex = 0;
}
else //avatar changed mind. clear the avatar key and reset script
{
llMessageLinked(LINK_THIS, -5555, "cancel", gAvKey);
llResetScript();
}
}
else if ( message == "<< Prev." )
{
gIndex -= gCount_limit;
menu ( gDanceList );
}
else if ( message == "Next >>" )
{
gIndex += gCount_limit;
menu ( gDanceList );
}
else if ( message == "Start >>" )
{
gIndex = 0;
menu ( gDanceList );
}
else if ( message == "<< End" )//go to the last page
{
if ( llGetListLength(gDanceList) % gCount_limit )
{
gIndex = llGetListLength(gDanceList) - (llGetListLength(gDanceList) % gCount_limit);
}
else
{
gIndex = (llGetListLength(gDanceList) - (llGetListLength(gDanceList) % gCount_limit)) - gCount_limit;
}
menu ( gDanceList );
}
else if ( message == "Dance" )
{
menu ( gDanceList );
}
else if ( message == "Stop" )
{
llMessageLinked(LINK_THIS, -5555, "cancel", gAvKey);//clear avatar key
if ( llGetPermissionsKey() )//only stop the dance if they are actually dancing
{
llStopAnimation(gDance);
llInstantMessage(gAvKey, "Thanks for dancing " + llKey2Name(gAvKey) + ".");
}
llResetScript();
}
else if ( message == "Reset" )//reset everything
{
llMessageLinked(LINK_THIS, -5555, "reset", gAvKey);
llResetScript();
}
else if ( (integer)message > 0 )//dance was selected
{
string old_dance = gDance; //store the current dance
gDance = llList2String(gDanceList,(integer)message -1);//load the next dance
if ( llGetPermissions() & PERMISSION_TRIGGER_ANIMATION )//if already dancing
{
llMessageLinked(LINK_THIS, -5555, "color", gAvKey);
llStopAnimation(old_dance);
llStartAnimation(gDance);
}
else //else get permission
{
llSetTimerEvent(30);//safety net in case they never accept or deny permissions
llRequestPermissions(gAvKey, PERMISSION_TRIGGER_ANIMATION);
}
}
}
}
run_time_permissions(integer perms)
{
if ( perms & PERMISSION_TRIGGER_ANIMATION )//have permission - start dancing
{
llSetTimerEvent(0);
llMessageLinked(LINK_THIS, -5555, "color", gAvKey);
llStartAnimation(gDance);
}
else //cancel everything
{
llMessageLinked(LINK_THIS, -5555, "cancel", gAvKey);
llResetScript();
}
}
timer()
{// if we're here something went wrong
llSetTimerEvent(0);
llListenRemove(gListener);
if( llGetAgentSize(gAvKey) )//still on the sim
{
if ( llGetPermissionsKey() == NULL_KEY )//they're just standing there - reset
{
llMessageLinked(LINK_THIS, -5555, "cancel", gAvKey);
llInstantMessage(gAvKey, "The menu has timed out.");
llResetScript();
}
else//they're dancing - just really slow decision makers
{
llInstantMessage(gAvKey, "The menu has timed out.");
}
}
else//they're gone - just reset
{
llMessageLinked(LINK_THIS, -5555, "cancel", gAvKey);
llResetScript();
}
}
}
// End Of code