GizmoEclipse

Sub_Server.lsl

Oct 1st, 2019
506
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list convert_keys_to_name(list keys){
  2.     list names;
  3.     integer x;
  4.     integer s = llGetListLength(keys);
  5.     for(;x<s;++x){
  6.         names += llKey2Name(llList2Key(keys,x));
  7.     }return names;
  8. }
  9.  
  10. integer isInteger(string data){
  11.      return ((llParseString2List(data, ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], []) == []) && (data != ""));
  12. }
  13.  
  14.  
  15. send_email(string address,string subject,string message){
  16.     current_node = (current_node+1)%total_nodes;
  17.     llMessageLinked(-1,current_node,subject+"###email###"+message,address);
  18. }
  19. send_im(key i,string message){
  20.     if(i == NULL_KEY)return;
  21.     current_node = (current_node+1)%total_nodes;
  22.     llMessageLinked(-1,current_node,message+"###im",i);
  23. }
  24. key to_recieve;
  25. integer t;
  26. vector target_pos;
  27. agent_func(string P0,string P1,string P2){
  28.     t = 0;
  29.     if(P0 == "eject")t=1;
  30.     if(P0 == "mass.ban")t=2;
  31.     if(P0 == "unsit")t=3;
  32.     if(P0 == "ban")t=4;
  33.     if(P0 == "teleport")t=5;
  34.     if(P0 == "mass.add")t=6;
  35.     if(P0 == "mass.unsit")t=7;
  36.     if(P0 == "mass.eject")t=8;
  37.     if(P0 == "mass.teleport")t=9;
  38.     if(P0 == "unban")t = 10;
  39.     if(P0 == "mass.unban")t = 11;
  40.         if(llSubStringIndex(P0,"mass.exp")==0){
  41.         string sub = llGetSubString(P0,9,-1);
  42.         if(sub == "teleport"){
  43.             if(llSubStringIndex(llStringTrim(P2,STRING_TRIM),"<")==0){
  44.                 target_pos = (vector)P2;
  45.             }else{
  46.                 list det = llGetObjectDetails(to_recieve,[OBJECT_POS,OBJECT_ROT]);
  47.                 target_pos = llList2Vector(det,0)+<1,0,0>*llList2Rot(det,1);
  48.             }
  49.             t = 12;
  50.         }
  51.     }
  52.     if(P0 == "mass.remove")t = 13;
  53.     if(P0 == "remove")t = 14;
  54.     if(P0 == "mass.add.reset"){
  55.         send_im(to_recieve,"Resetting all allowed access lists on network.");
  56.         send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_ALLOW_RESET");
  57.     }
  58.     if(P0 == "mass.ban.reset"){
  59.         send_im(to_recieve,"Resetting all allowed access lists on network.");
  60.         send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_BAN_RESET");
  61.     }
  62.     if(t == 0)return;
  63.     list agents = llGetAgentList(AGENT_LIST_REGION,[]);
  64.     list agent_names = convert_keys_to_name(agents);
  65.     integer x = 0;
  66.     integer s = llGetListLength(agent_names);
  67.     integer all;
  68.     integer f=0;
  69.     if(t < 0)return;
  70.     if(P1 == "all"){
  71.         all = 1;
  72.     }
  73.     if(P1 == "self")P1 = llToLower(llKey2Name(owner));
  74.     for(;x<s;++x){
  75.         cid = llList2Key(agents,x);
  76.         if(llSubStringIndex(llToLower(llList2String(agent_names,x)),P1) == 0 || all){
  77.             f=1;
  78.             if(t == 0){
  79.                 send_im(to_recieve,"Input error.");
  80.                 jump out;
  81.                 return;
  82.             }
  83.             if(t == 1){
  84.                 send_im(to_recieve,"Ejecting: "+llKey2Name(cid));
  85.                 llEjectFromLand(cid);
  86.                 //say(llKey2Name(cid)+"'s size is "+(string)llGetAgentSize(cid));
  87.             }
  88.             if(t == 2){
  89.                 send_im(to_recieve,"Network banning: "+llKey2Name(cid));
  90.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_BAN");
  91.                 llAddToLandBanList(cid,0);
  92.             }
  93.             if(t == 3){
  94.                 send_im(to_recieve,"Unsitting: "+llKey2Name(cid));
  95.                 llUnSit(cid);
  96.             }
  97.             if(t == 4){
  98.                 send_im(to_recieve,"Banning: "+llKey2Name(cid));
  99.                 llAddToLandBanList(cid,0);
  100.             }
  101.             if(t == 4){
  102.                 send_im(to_recieve,"Banning: "+llKey2Name(cid));
  103.                 llAddToLandBanList(cid,0);
  104.             }
  105.             if(t == 5){
  106.                 send_im(to_recieve,"Teleporting: "+llKey2Name(cid));
  107.                 llTeleportAgentHome(cid);
  108.             }
  109.             if(t == 6){
  110.                 send_im(to_recieve,"Network allowing: "+llKey2Name(cid));
  111.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_ALLOW");
  112.                 llAddToLandPassList(cid,0);
  113.             }
  114.             if(t == 7){
  115.                 send_im(to_recieve,"Network unsitting: "+llKey2Name(cid));
  116.                 //send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_UNSIT");
  117.                 llUnSit(cid);
  118.             }
  119.             if(t == 8){
  120.                 send_im(to_recieve,"Network ejecting: "+llKey2Name(cid));
  121.                 //send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_EJECT");
  122.                 llEjectFromLand(cid);
  123.             }
  124.             if(t == 9){
  125.                 send_im(to_recieve,"Network teleport: "+llKey2Name(cid));
  126.                 //send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_TELEPORT");
  127.                 llTeleportAgentHome(cid);
  128.             }
  129.             if(t == 10){
  130.                 send_im(to_recieve,"Unbanning: "+llKey2Name(cid));
  131.                 llRemoveFromLandBanList(cid);
  132.             }
  133.             if(t == 11){
  134.                 send_im(to_recieve,"Network unbanning: "+llKey2Name(cid));
  135.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_UNBAN");
  136.                 llRemoveFromLandBanList(cid);
  137.             }
  138.             if(t == 12){
  139.                 send_im(to_recieve,"Network experience teleporting: "+llKey2Name(cid));
  140.                 llRequestExperiencePermissions(cid,"");
  141.             }
  142.             if(t == 13){
  143.                 send_im(to_recieve,"Network Removing: "+llKey2Name(cid));
  144.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_REMOVE");
  145.                 llRemoveFromLandPassList(cid);
  146.             }
  147.             if(t == 14){
  148.                 send_im(to_recieve,"Removing: "+llKey2Name(cid));
  149.                 llRemoveFromLandBanList(cid);
  150.             }
  151.         }
  152.     }
  153.     if(!f){
  154.         if(t == 2 || t == 6 || t == 7 || t == 8 || t == 9 || t == 11 || t == 12 || t == 13){
  155.             name_key_query = llRequestUserKey(P1+" "+P2);
  156.         }else{
  157.             send_im(to_recieve,"Target not found.");
  158.         }
  159.     }
  160.     @out;
  161. }
  162. list admins;
  163.  
  164. //list commands = ["eject","mass.ban","unsit","ban","check.plots","teleport","mass.add","mass.unsit","mass.eject","mass.add.reset","mass.ban.reset","mass.teleport","mass.unban"];
  165.  
  166. integer line;
  167. integer max;
  168. integer prims;
  169. integer percent;
  170. integer current_node;
  171. integer total_nodes;
  172.  
  173.  
  174. string pd;
  175. string cNote;
  176. string server;
  177.  
  178.  
  179. string MAIN_SERVER = "16c508d8-7e67-5439-3ee6-e0cb4997db1f@lsl.secondlife.com";
  180.  
  181.  
  182. key cid;
  183. key owner;
  184. key name_key_query;
  185. default{
  186.     on_rez(integer r){
  187.         llResetScript();
  188.     }
  189.     changed(integer c){
  190.         if(c & CHANGED_INVENTORY){
  191.             total_nodes = llGetInventoryNumber(10)-2;
  192.         }
  193.     }
  194.     state_entry(){
  195.         llSetText("Setting up...",<1,1,1>,1);
  196.         llSleep(.125);
  197.         owner = llGetOwner();
  198.         total_nodes = llGetInventoryNumber(10)-2;
  199.         pd =(string) llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_ID]);
  200.         llGetNotecardLine((cNote="Admins"),(line=0));
  201.     }dataserver(key quid,string data){
  202.         if(name_key_query == quid){
  203.             key cid = (key)data;
  204.             if(data == NULL_KEY){
  205.                 send_im(to_recieve,"Target Not Found - ERROR_001: NULL_KEY RETURNED");
  206.                 return;
  207.             }
  208.             if(t == 2){
  209.                 send_im(to_recieve,"Network banning: "+(string)cid);
  210.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_BAN");
  211.                 llAddToLandBanList(cid,0);
  212.             }
  213.             if(t == 6){
  214.                 send_im(to_recieve,"Network allowing: "+(string)cid);
  215.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_ALLOW");
  216.                 llAddToLandPassList(cid,0);
  217.             }
  218.             if(t == 7){
  219.                 send_im(to_recieve,"Network unsitting: "+(string)cid);
  220.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_UNSIT");
  221.                 llUnSit(cid);
  222.             }
  223.             if(t == 8){
  224.                 send_im(to_recieve,"Network ejecting: "+(string)cid);
  225.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_EJECT");
  226.                 llEjectFromLand(cid);
  227.             }
  228.             if(t == 9){
  229.                 send_im(to_recieve,"Network teleport: "+llKey2Name(cid));
  230.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_TELEPORT");
  231.                 llTeleportAgentHome(cid);
  232.             }
  233.             if(t == 11){
  234.                 send_im(to_recieve,"Network teleport: "+llKey2Name(cid));
  235.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_UNBAN");
  236.                 llRemoveFromLandBanList(cid);
  237.             }
  238.             if(t == 12){
  239.                 send_im(to_recieve,"Network Experience Teleporting: "+llKey2Name(cid));
  240.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_EXP_TELEPORT");
  241.                 llRequestExperiencePermissions(cid,"");
  242.             }
  243.             if(t == 13){
  244.                 send_im(to_recieve,"Network Removing: "+llKey2Name(cid));
  245.                 send_email(MAIN_SERVER,"ACTION","Target-Id:"+(string)cid+"Target-Action:MASS_REMOVE");
  246.                 llRemoveFromLandPassList(cid);
  247.             }
  248.         }else{
  249.             if(data == EOF){
  250.                 if(cNote == "Admins"){
  251.                     admins=llCSV2List(llToLower(llDumpList2String(admins,",")));
  252.                     llSetText("Updated Access List",<1,1,1>,1);
  253.                     llSetText("",<1,1,1>,1);
  254.                     llSetText("Connecting to core...",<1,1,1>,1);
  255.                     send_email(MAIN_SERVER,"CONNECT","Parcel-Id:"+pd);
  256.                     llSetTimerEvent(1.0);
  257.                     llSetText("",<1,1,1>,1);
  258.                     llListen(0,"","","");
  259.                     llListen(-525,"","","");
  260.                     llSay(0,(string)llGetFreeMemory()+"mb free.");
  261.                 }
  262.                 return;
  263.             }
  264.             else{
  265.                 if(cNote == "Admins"){
  266.                     if(llListFindList(admins,[data]) == -1){
  267.                         admins=(admins=[])+admins+data;
  268.                         llSetText("Last Added: "+data,<1,1,1>,1);
  269.                     }
  270.                     llGetNotecardLine(cNote,(++line));
  271.                 }
  272.             }
  273.         }
  274.     }
  275.     touch_start(integer ts){
  276.         string n = llDetectedName(0);
  277.         if(llListFindList(admins,[llToLower(n)])==-1 && llListFindList(admins,[llToLower(llKey2Name(llGetOwnerKey(llDetectedKey(0))))])==-1)return;
  278.         if(llDetectedLinkNumber(0) & 8){
  279.             integer x = 0;
  280.             integer s = llGetInventoryNumber(10);
  281.             string mn = llGetScriptName();
  282.             string cn;
  283.             for(;x<s;++x){
  284.                 cn = llGetInventoryName(10,x);
  285.                 if(cn!=mn)llResetOtherScript(cn);
  286.             }
  287.             llResetScript();
  288.         }
  289.                
  290.     }
  291.     listen(integer c,string n,key i,string m){
  292.         if(llListFindList(admins,[llToLower(n)])==-1 && llListFindList(admins,[llToLower(llKey2Name(llGetOwnerKey(i)))])==-1)return;
  293.         list p = llParseString2List(m,[" "],[]);
  294.         if(m == "check.plots"){
  295.             send_im(llGetOwnerKey(i),"Checking plots.");
  296.             send_email(MAIN_SERVER,"PARCEL_DETAILS","Target-Id: "+(string)llGetOwnerKey(i)+"Target-Action: PARCEL_DETAILS");
  297.             return;
  298.         }
  299.         if(m == "check.agents"){
  300.             send_im(llGetOwnerKey(i),"Checking agents.");
  301.             send_email(MAIN_SERVER,"AGENTS","Target-Id: "+(string)llGetOwnerKey(i)+"Target-Action: AGENTS");
  302.             return;
  303.         }
  304.         if(c == -525 && m == "server_key?"){
  305.             llRegionSay(-525,"relay_active:"+(string)i+":simulate_"+(string)llGetKey());
  306.         }
  307.         //if(llListFindList(commands,[llToLower(llList2String(p,0))]) == -1)return;
  308.         to_recieve = llGetOwnerKey(i);
  309.         cid = llGetOwnerKey(i);
  310.         agent_func(llList2String(p,0),llList2String(p,1),llDumpList2String(llDeleteSubList(p,0,1)," "));
  311.     }
  312.     experience_permissions(key id) {
  313.         if(t == 12){
  314.             llTeleportAgent(id,"",target_pos,target_pos);
  315.         }
  316.     }
  317.     experience_permissions_denied(key id, integer reason){
  318.         if(t == 12){
  319.             llTeleportAgentHome(id);
  320.         }
  321.     }
  322.     timer(){
  323.         llGetNextEmail("","");
  324.         if(llGetTime() > 21600){
  325.             send_email(MAIN_SERVER,"CONNECT","Parcel-Id:"+pd);
  326.             llResetTime();
  327.         }
  328.     }
  329.     email(string time,string a,string s,string m,integer r){
  330.         if(s == "RESPOND"){
  331.             llSay(0,"Successfully connected to host server.");
  332.             MAIN_SERVER = a;
  333.             llResetTime();
  334.         }
  335.         if(s == "AGENTS"){
  336.             integer x = 0;
  337.             list agents = llGetAgentList(AGENT_LIST_PARCEL,[]);
  338.             integer s = llGetListLength(agents);
  339.             list d = llParseString2List(m,["Object-Name: ","Region: ","Local-Position: ","Target-Id: ","Target-Action: "],[]);
  340.             string toSEND = "Target-Id: "+llStringTrim(llList2String(d,3),STRING_TRIM)+"Agents: ";
  341.             for(;x<s;++x){
  342.                 toSEND += llKey2Name((key)llList2String(agents,x))+"\n";
  343.             }
  344.             send_email(MAIN_SERVER,"AGENT_DUMP",toSEND);
  345.         }
  346.         //exp teleport to me **God drag basically.
  347.         if(s == "PARCEL_DETAILS"){
  348.             //llSay(0,"PARCEL DETAILS MESSAGE IN");
  349.             list d = llParseString2List(m,["Object-Name: ","Region: ","Local-Position: ","Target-Id: ","Target-Action:"],[]);
  350.             if(llStringTrim(llList2String(d,4),STRING_TRIM) == "PARCEL_DETAILS"){
  351.                 //llSay(0,"CLEARED"+llList2String(d,3));
  352.                 list details = llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_NAME,PARCEL_DETAILS_OWNER,PARCEL_DETAILS_GROUP,PARCEL_DETAILS_AREA,PARCEL_DETAILS_DESC]);
  353.                 string toSEND = "Target-Id: "+llStringTrim(llList2String(d,3),STRING_TRIM);
  354.                 percent=(prims=llGetParcelPrimCount(llGetPos(), 0, 1))*100/(max=llGetParcelMaxPrims(llGetPos(),1));
  355.                 toSEND += "Parcel-Name: "+llList2String(details,0);
  356.                 toSEND += "Parcel-Owner: "+llList2String(details,1);
  357.                 toSEND += "Parcel-Group: "+llList2String(details,2);
  358.                 toSEND += "Prim-Percent-Used: "+(string)percent+"% Prims Used: "+(string)prims+"/"+(string)max;
  359.                 toSEND += "Parcel-Size: "+llList2String(details,3)+"sqm ";
  360.                 toSEND += "Parcel-Desc: "+llList2String(details,4);
  361.                 //llSay(0,"Final process");
  362.                 send_email(MAIN_SERVER,"PARCEL_INFO",toSEND);
  363.             }
  364.         }
  365.         if(s == "ACTION"){
  366.             if(a != MAIN_SERVER){
  367.                 llSay(0,"Unauthorized Access Attempted.");
  368.             }else{
  369.                 list d = llParseString2List(m,["Object-Name: ","Region: ","Local-Position: ","Target-Id:","Target-Action:"],[]);
  370.                 if(llList2String(d,4) == "MASS_ALLOW_RESET"){
  371.                     llResetLandPassList();
  372.                 }
  373.                 if(llList2String(d,4) == "MASS_BAN_RESET"){
  374.                     llResetLandBanList();
  375.                 }
  376.                 if(llList2String(d,4) == "MASS_BAN"){
  377.                     llAddToLandBanList((key)llList2String(d,3),0);
  378.                 }
  379.                 if(llList2String(d,4) == "MASS_ALLOW"){
  380.                     llAddToLandPassList((key)llList2String(d,3),0);
  381.                 }
  382.                 if(llList2String(d,4) == "MASS_UNSIT"){
  383.                     llUnSit((key)llList2String(d,3));
  384.                 }
  385.                 if(llList2String(d,4) == "MASS_TELEPORT"){
  386.                     llTeleportAgentHome((key)llList2String(d,3));
  387.                 }
  388.                 if(llList2String(d,4) == "MASS_UNBAN"){
  389.                     llRemoveFromLandBanList((key)llList2String(d,3));
  390.                 }
  391.                 if(llList2String(d,4) == "MASS_EXP_TELEPORT"){
  392.                     t = 12;
  393.                     llRequestExperiencePermissions((key)llList2String(d,3),"");
  394.                 }
  395.                 if(llList2String(d,4) == "MASS_REMOVE"){
  396.                     llRemoveFromLandPassList((key)llList2String(d,3));
  397.                 }
  398.             }
  399.         }
  400.     }
  401. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×