Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Secure Skript
#1
Das ist ein Skript welches Leute nach Namen rauswirft.
Diese Namensliste wird in einer Notecard namens "bannedlist" Zeilenweise geschrieben.
Der/Die gelisteten Leute werden von der Region geworfen.
Der vorteil ist das nicht nach dem Ursprung also Grid geschaut wird sondern nur nach Namen.

bannedlist Beispiel:
Max Mustermann
John Doe
etc.

OSSL Secure Skript(kein php):
PHP-Code:
// Secure Stick
//free to use, modify, copy or transfer
//Create a notecard with the name blacklist.
//Enter the unwanted people line by line.
//------------------------------------

key second NULL_KEY// fill in a second key if you want

string active "active";
float range 256.0// Bereich, in dem wir nach Personen suchen, um zu überprüfen, ob sie auf der bannedlist stehen
float rate 1.0// Wie oft ein sensor-no_sensor in die Warteschlange gestellt wird.

key nrofnamesoncard// Some variables used to collect all the data from the notecard
integer nrofnames;
list 
names;
list 
keynameoncard;
string nameoncard;
string storedname;
integer listener;

default 
// We use the default state to read the notecard.
{
    
state_entry()
    {
          
llOwnerSay("Startup state reading bannedlist notecard");
          
nrofnamesoncard llGetNumberOfNotecardLines("bannedlist"); // Triggers the notecard reading by getting the numer of lines in the notecard
    
}

    
on_rez (integer param)
    {
        
llResetScript();
    }

    
dataserver (key queryidstring data){
        if (
queryid == nrofnamesoncard)
        {
            
// When we receive the number of lines in the notecard we do llGetNotecardLine for each line to get the contents
            
nrofnames = (integer) data;
            
llOwnerSay("Found "+(string)nrofnames" names in bannedlist.");

            
integer i;
            for (
i=0;nrofnames;i++){
               
keynameoncard += llGetNotecardLine("bannedlist"i);
            }
        } else
        {
            
integer listlength;
            
listlength llGetListLength(keynameoncard);
            
integer j;
            for(
j=0;j<listlength;j++) {
                if (
queryid == (keyllList2String(keynameoncard,j))
                { 
// after checking if this really was an answer to one of our llGetNotecardLines calls (checking the keys we stored earlier)
                  // We add the name to our names list. Which we will use in a later state.
                    
llOwnerSay("Name added to bannedlist: "+data);
                    
names += data;
                }
            }
        }

        if (
llGetListLength(names) == nrofnames)
        {
            
// If we have read all the names (just as many names as there where notecard lines). We switch to our next state "start"
            // This state will do the actual work
            
llOwnerSay ("Done with reading notecard. Starting script now");
            
state start;
        }
    }
}
state start
{
    
state_entry ()
    {
        
// This is where we enter our state. We start 2 listeneres. One for our owner and one for our second owner..
        
llListen(9""llGetOwner(), "");
        
llListen(9""second"");
        
llSensorRepeat(""NULL_KEYAGENTrangePIrate); // We also start scanning for people in it's vincinity. This scan scans for AGENS (avatars), in a range we determinded above (first few lines). And PI means a full circle around us. In theory you could just scan parts of it.
    
}

    
on_rez(integer param)
    {
        
llResetScript();
    }

    
listen(integer channelstring namekey idstring message)
    { 
// This is our listen event. Here we receive all commands to control the orbs behaviour.
        
if (message == "activate"// Starts the orb
        
{
            
active "active";
            
llOwnerSay("Activated");
        }
        if (
message == "deactivate"// Stops the orb
        
{
            
active "deactive";
            
llOwnerSay("Deactivated");
        }
        if (
message == "reset"// Resets the script
        
{
            
llResetScript();
        }
        if (
llGetSubString(message,0,4) == "range"){ // If the command was range. We extract the new range from the command. Stop the sensor and start it again with the new range.
            
range = (float) llGetSubString(message,6,-1);
            
llSensorRemove();
            
llSensorRepeat(""NULL_KEYAGENTrangePIrate);
            
llOwnerSay("Changed range to: "+(string) range);
        }
    }
    
sensor(integer nr)
    {
    
// Here is where all people found in its vincinity are returned.

        
if (active == "active"// first we make sure the orb is active before we continue
        
{
            
integer i;
            for (
0nri++) //Here we start to loop throug all persons we found. We do this one by one.
            
{
                
string found "yes";
                
string nametotest llDetectedName(i);
                
integer j;
                for (
0llGetListLength(names); j++) // We scan through the list of names to see if this person is whitelisted
                
{
                    if (
llList2String(namesj) == nametotest){
                    
found "no"// When found we set found to true.
                    
}
                }
                if (
found == "no" && llOverMyLand(llDetectedKey(i)) && (llDetectedKey(i) != llGetOwner())) // ifperson has not been found, check if this person is on our land. we will never kick the owner ;)
                
{
                    if (
llOverMyLand(llDetectedKey(i))) // Ok let's see if he has left.
                    
{
                        
// kicked off the land
                        
llTeleportAgentHome(llDetectedKey(i));
                    }

                    if (
llOverMyLand(llDetectedKey(i))) // Is it still there?
                    
{
                        
// kicked off the land
                        
llEjectFromLand(llDetectedKey(i));
                    }
                }
            }
        }
    }


Ein Metaversum sind viele kleine Räume, die nahtlos aneinander passen,
sowie direkt sichtbar und begehbar sind, als wäre es aus einem Guss.



[-] The following 3 users say Thank You to Manfred Aabye for this post:
  • , Anachron, Dorena Verne
Zitieren
#2
Warum nutzt du nicht einfach die Ban funktion in der Parcel?
[-] The following 1 user says Thank You to Gubbly for this post:
  •
Zitieren
#3
Weil das nicht geht.
Versuche mal Max Mustermann zu bannen der sich imerwieder in neuen Grids Registriert.
Bei dem Skript reicht der Name.
Ein Metaversum sind viele kleine Räume, die nahtlos aneinander passen,
sowie direkt sichtbar und begehbar sind, als wäre es aus einem Guss.



Zitieren
#4
(25.04.2022, 09:41)Manfred Aabye schrieb: Weil das nicht geht.
Versuche mal Max Mustermann zu bannen der sich imerwieder in neuen Grids Registriert.
Bei dem Skript reicht der Name.

Was Gubbly meinte ist, warum verwendest du nicht LlAddToLandBanList statt llTeleportAgentHome bzw. llEjectFromLand ? Wenn er dann aus dem gleichen Grid wiederkommt wird er schon beim Eintritt rausgeworfen und nicht erst wenn dein Sensor-Event ihn entdeckt.
Wer nicht weiss wohin er will, der kommt leicht woanders hin.
[-] The following 2 users say Thank You to Anachron for this post:
  • Dorena Verne, Kalkofe
Zitieren
#5
Schön wenn ich euch so viel Anregung gebe Wink
Postet doch einfach eure Skripte hier.
Ein Metaversum sind viele kleine Räume, die nahtlos aneinander passen,
sowie direkt sichtbar und begehbar sind, als wäre es aus einem Guss.



Zitieren
#6
(25.04.2022, 09:41)Manfred Aabye schrieb: Weil das nicht geht.
Versuche mal Max Mustermann zu bannen der sich imerwieder in neuen Grids Registriert.
Bei dem Skript reicht der Name.

Das Script macht aber nichts anderes. Es benutzt llDetectedName() welches den vollen HG Namen zurückgibt.

Ich gehe mal davon aus, dass du dich gegen deine "Hackerattacken" zu Schüzen versuchst. Das wirst du so aber nicht schaffen. Wenn jemand will braucht er sich nur einen Avatar mit einem anderen Namen erstellen.
Wenn du dich gegen so etwas schützen willst stelle einfach folgenes in der OpenSim.ini ein:

Code:
[Startup]
  UseSceneBackup = false

Dann darfst du nur nicht vergessen, nach jeder änderung an der Region den backup befehl zu nutzen.
[-] The following 3 users say Thank You to Gubbly for this post:
  • Bogus Curry, Kalkofe, Xenos Yifu
Zitieren
#7
Das hab ich zu llAddToLandBanList gefunden.

llAddToLandBanList Test
PHP-Code:
//llAddToLandBanList-example.lsl

default
{
    
state_entry()
    {
        
//llSetText("Don't touch me or you'll be banned for 30 minutes!", <1, 0, 0>, 1);
        
llSetText("Klick mich nicht an oder du wirst für 30 Minuten gesperrt!", <100>, 1);
    }

    
touch_start(integer num)
    {
        
llAddToLandBanList(llDetectedKey(0), 0.5);
    }


Funktionen Test
• llAddToLandPassList
• llRemoveFromLandBanList
• llRemoveFromLandPassList
• llResetLandBanList
• llResetLandPassList
PHP-Code:
// Functions - Funktionen
// •      llAddToLandPassList
// •      llRemoveFromLandBanList
// •      llRemoveFromLandPassList
// •      llResetLandBanList
// •      llResetLandPassList
//
// This is not a complete solution, requires full avatar names to work - even for unbanning someone!
// This is meant only as an example of the land ban and pass management functions.
// free to copy, use, modify, distribute - just don't ask me to debug your modified code. ;-)
//
// Dies ist keine vollständige Lösung, erfordert vollständige Avatarnamen, um zu funktionieren - sogar um jemanden zu entsperren!
// Dies ist nur als Beispiel für die Landverbots- und Passverwaltungsfunktionen gedacht.
// frei zu kopieren, zu verwenden, zu modifizieren, zu verteilen - bitte mich nur nicht, deinen modifizierten Code zu debuggen. ;-)
//
// Commands are:
//   /5 ban:full_avatar_name
//   /5 tempban:full_avatar_name
//   /5 unban:full_avatar_name
//   /5 pass:full_avatar_name
//   /5 unpass:full_avatar_name
//   /5 clearban
//   /5 clearpass

string command;

default
{
    
state_entry()
    {
        
llListen(5""llGetOwner(), "");
    }

    
on_rez(integer param)
    {
        
llResetScript();
    }

    
listen(integer chanstring namekey idstring message)
    {
        if (
command != "")
        {
            
llOwnerSay("Sorry, still processing last command, try again in a second.");
            
llOwnerSay("Tut mir leid, der letzte Befehl wird noch bearbeitet, versuche es gleich noch einmal.");
        }

        list 
args llParseString2List(message,[":"],[]);
        
command llToLower(llList2String(args,0));

        if (
command == "clearbans")
        {
            
llResetLandBanList();
        }
        if (
command == "clearpass")
        {
            
llResetLandPassList();
        }
        else
        {
            
llSensor(llList2String(args,1),NULL_KEY,AGENT,96,PI);
        }
    }

    
no_sensor()
    {
        
command "";
    }

    
sensor(integer num)
    {
        
integer i 0;
        for (; 
num; ++i)
        {
            if (
command == "ban")
            {
                
// Ban indefinetely
                
llAddToLandBanList(llDetectedKey(i),0.0);
            }
            if (
command == "tempban")
            {
                
// Ban for 1 hour.
                
llAddToLandBanList(llDetectedKey(i),1.0);
            }
            if (
command == "unban")
            {
                
llRemoveFromLandBanList(llDetectedKey(i));
            }
            if (
command == "pass")
            {
                
// Add to land pass list for 1 hour
                
llAddToLandPassList(llDetectedKey(i),1.0);
            }
            if (
command == "unpass")
            {
                
llRemoveFromLandPassList(llDetectedKey(i));
            }
        }
        
command "";
    }


Alles hat seine vor- und Nachteile.
Ein Metaversum sind viele kleine Räume, die nahtlos aneinander passen,
sowie direkt sichtbar und begehbar sind, als wäre es aus einem Guss.



Zitieren


Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  YEngine Skript Restart Manfred Aabye 6 2.111 15.03.2022, 12:43
Letzter Beitrag: Manfred Aabye

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste