Mythruna
May 16, 2024, 11:44:32 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Poll
Question: Start doing movies about Mythruna?
Yes - 2 (100%)
No - 0 (0%)
Total Voters: 2

Pages: [1]
  Print  
Author Topic: [Help] [Commands] Admin server [quickly]  (Read 8164 times)
TezertMC
Newbie
*
Posts: 4


View Profile
« on: March 22, 2012, 09:13:50 AM »

Hi, I am Polish, so in case you were sorry for the mistakes ... I do not know English very well Smiley no, but to the point, perhaps three hours after I realized how to make your own server Smiley Yeaa Well, but now I want to play it with other Poles ... I noticed that on some servers is'' security'' means protection so that others could not smash it to me. Well, I just want something on the server so he could be somebody help me? PLIS PLIS PLIS pleats. it winds up the video on Youtube, with different guides ... and so I want to shoot with'' How to make your own server in Mythruna'' I think that someone will help me to write Smiley! Please quickly;)




TezertMC .
« Last Edit: March 23, 2012, 07:26:05 AM by TezertMC » Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #1 on: March 22, 2012, 12:53:10 PM »

Ignore my previous response.

You may need to explain more about what you mean by "security".

Do you mean limiting which players can join or some other admin functions?
Logged
TezertMC
Newbie
*
Posts: 4


View Profile
« Reply #2 on: March 22, 2012, 01:30:57 PM »

hmmm may be so, I would like to secure the area to the other players on the server is not able to break me, breaking in my building, I know life and my experience in Minecraft I know that a lot of such people.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #3 on: March 22, 2012, 02:37:24 PM »

hmmm may be so, I would like to secure the area to the other players on the server is not able to break me, breaking in my building, I know life and my experience in Minecraft I know that a lot of such people.

This sounds like what property is for.  I will have to look up how to grant yourself admin privileges for increasing property maximums and/or granting yourself larger properties.  I forget.
Logged
TezertMC
Newbie
*
Posts: 4


View Profile
« Reply #4 on: March 22, 2012, 02:43:48 PM »

will do the trick to do so, because as I was playing on a server, the English could not smash anything ... just how far I walked away from the city that I could .... if it is such a command ... and if you know it .. : P you could write?
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #5 on: March 22, 2012, 02:58:18 PM »

Do you know how to place property?

http://www.youtube.com/watch?v=h7tSLJypqK0
Logged
randomprofile
Global Moderator
Sr. Member
*****
Posts: 265


View Profile WWW
« Reply #6 on: March 23, 2012, 01:07:23 AM »

Sady I didn't even read your topic because I fear my head will explode, but regardless in the future please refrain from using big fonts like that... and titles that draw attention... sorry if I am being mean, but I want this forum to be cleaner.
Logged
TezertMC
Newbie
*
Posts: 4


View Profile
« Reply #7 on: March 23, 2012, 07:25:03 AM »

Well, well, if you are a moderator, you can zmeinić ... Title ... I change my bold, but I would ask is for someone to help me ....
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #8 on: March 23, 2012, 08:02:22 AM »

There was a page on adding admin commands to a server here:
http://mythruna.com/mediawiki/index.php?title=Running_a_Server

In case that admin script is old I'm pasting in the latest here:
Code:

println '------ admin commands version:$Revision: 2121 $';

import com.jme3.math.*;

import mythruna.Coordinates;
import mythruna.db.*;
import mythruna.es.*;

on( [playerConnected] ) {
    type, event ->
       
    Object conn = connection;
    Object p = conn.getAttribute( "player" );

    if( !p.get("userInfo.userId").equals( "pspeed" ) )
        return;
       
    println( "Adding admin commands to " + p.get("userInfo.userId") );
   
    addShellCommand( shell, "test", "Just a test.", null ) {
        println "conn:" + conn;
    }
   
    addShellCommand( shell, "respawn", "Moves you back to the starting location.", null ) {
        respawn( conn, console );       
    }
 
    addShellCommand( shell, "grant", "Grants a specific privilege to a player.", null ) {
   
        String[] parms = it.split( " " );
        if( it.length() == 0 || parms.length == 0 ) {
            console.echo( "Your grants:" + playerData.get( "grant" ) );
        }
       
        String to = parms[0];
        toPlayer = null;
       
        if( to.isNumber() ) {
            toConn = findConnection( to.toInteger() );
            if( toConn == null ) {
                console.echo( "Connection ID not found:" + to );
                return;
            }
            toPlayer = toConn.getAttribute( "player" );             
        } else {
            console.echo( "Operation not yet supported." );
            return;
        }
       
        if( parms.length == 2 ) {
            String grant = parms[1];
            toPlayer.set( "grant." + grant, true );
            toPlayer.save();
        }
        console.echo( "Grants:" + toPlayer.get( "grant" ) );
    }
 
    addShellCommand( shell, "ungrant", "Removes a specific privilege from a player.", null ) {
   
        String[] parms = it.split( " " );
        if( parms.length == 0 ) {
            console.echo( "No target specified." );
        }
       
        String to = parms[0];
        toPlayer = null;
       
        if( to.isNumber() ) {
            toConn = findConnection( to.toInteger() );
            if( toConn == null ) {
                console.echo( "Connection ID not found:" + to );
                return;
            }
            toPlayer = toConn.getAttribute( "player" );             
        } else {
            console.echo( "Operation not yet supported." );
            return;
        }

        if( parms.length < 2 ) {
            console.echo( "No grants specified." );
            return;
        }
       
        String grant = parms[1];
        toPlayer.set( "grant." + grant, null );
        console.echo( "Grants:" + toPlayer.get( "grant" ) );
        toPlayer.save();
    }
 
    addShellCommand( shell, "tp", "Teleports a player.", null ) {
   
        println( "Teleport:" + it );
       
        String[] parms = it.split( " " );
       
        if( parms.length == 0 || parms[0].length() == 0 ) {
            console.echo( "No parameters specified." );
            return;
        }
       
        String from = parms[0];
 
        tpPlayer = null;
       
        if( from.isNumber() ) {
            tpPlayer = findConnection( from.toInteger() );
            if( tpPlayer == null ) {
                console.echo( "Connection ID not found:" + from );
                return;
            }
        } else {
            tpPlayer = findCharacter( from );
            if( tpPlayer == null ) {
                console.echo( "Player not found:" + from );
                return;
            }
        }
 
        if( parms.length == 1 ) {
            pos = getLocation( conn );
            console.echo( "Teleporting player:" + tpPlayer.getAttribute("player").get( "characterInfo.name" )
                            + " to me at:" + pos );
            warp( tpPlayer, pos.x, pos.y, pos.z );                         
        } else if( parms[1].isNumber() ) {
           
            if( parms.length < 3 ) {
                console.echo( "Not enough numbers for a location:" + it );
                return;
            }
           
            x = parms[1].toInteger();
            y = parms[2].toInteger();
            z = 160;
 
            if( parms.length > 3 ) {
                z = parms[3].toInteger();
            }               
 
            console.echo( "Warping " + from + " to:" + x + ", " + y + ", " + z );
            warp( tpPlayer, x + 0.5, y + 0.5, z );                         
        }
       
    }
 
    addShellCommand( shell, "clearleaf", "Clears the current leaf.", null ) {
   
        pos = getLocation( conn );
        cellPos = Coordinates.worldToCell( pos );
        println( "Clear:" + cellPos + "  pos:" + pos );
       
        leaf = worldDb.getLeaf( cellPos.x, cellPos.y, cellPos.z );       
        println( "Leaf:" + leaf );
       
        // clear it all out
        leaf.clear();
       
        worldDb.resetLeaf( leaf );
    }
   
    addShellCommand( shell, "regenleaf", "Regenerates the current leaf.", null ) {
   
        pos = getLocation( conn );
        cellPos = Coordinates.worldToCell( pos );
        println( "Regen:" + cellPos + "  pos:" + pos );

        leaf = worldDb.getLeaf( cellPos.x, cellPos.y, cellPos.z );       
        println( "Leaf:" + leaf );
         
        def locator = new DefaultLeafFileLocator( new File("mythruna.db" ) );       
        colFactory = worldDb.getColumnFactory(); //WorldUtils.createDefaultColumnFactory(locator, worldDb.getSeed());
       
        LeafData[] leafs = colFactory.createLeafs( cellPos.x, cellPos.y );

        int z = Coordinates.worldToLeaf(cellPos.z);
        println( "Generated:" + leafs[z] );       
       
        leaf.getInfo().set( leafs[z].getInfo() );
        leaf.setCells( leafs[z].getCells() );
        leaf.getInfo().lit = false;
        leaf.markChanged();
       
        println( "Leaf after reset:" + leaf );
       
        worldDb.resetLeaf( leaf );
    }

    addShellCommand( shell, "regencol", "Regenerates the current stack of leaves.", null ) {
   
        pos = getLocation( conn );
        cellPos = Coordinates.worldToCell( pos );
        println( "Regen:" + cellPos + "  pos:" + pos );

        println( "Leaf:" + leaf );
 
        def locator = new DefaultLeafFileLocator( new File("mythruna.db" ) );       
        colFactory = worldDb.getColumnFactory(); //WorldUtils.createDefaultColumnFactory(locator, worldDb.getSeed());
       
        LeafData[] leafs = colFactory.createLeafs( cellPos.x, cellPos.y );

        for( int z = 0; z < leafs.length; z++ ) {
       
            def leaf = worldDb.getLeaf( cellPos.x, cellPos.y, z * 32 );       
            println( "Generated:" + leafs[z] );       
       
            leaf.getInfo().set( leafs[z].getInfo() );
            leaf.setCells( leafs[z].getCells() );
            leaf.getInfo().lit = false;
            leaf.markChanged();
       
            println( "Leaf after reset:" + leaf );
       
            worldDb.resetLeaf( leaf );
        }
    }

    addShellCommand( shell, "relightleaf", "Relights the current leaf.", null ) {
   
        pos = getLocation( conn );
        cellPos = Coordinates.worldToCell( pos );
        println( "Regen:" + cellPos + "  pos:" + pos );

        leaf = worldDb.getLeaf( cellPos.x, cellPos.y, cellPos.z );       
        println( "Leaf:" + leaf );
       
        leaf.getInfo().lit = false;
        leaf.markChanged();
       
        println( "Leaf after reset:" + leaf );
       
        worldDb.resetLeaf( leaf );
    }
   
    addShellCommand( shell, "branch", "Manually marks a revision level in the revision history.", null ) {
       
        long rev = worldDb.getLeafDb().mark();
       
        date = new Date(rev);
       
        console.echo( "Branched at:" + rev + " " + date );
    }
   
    addShellCommand( shell, "revs", "Shows the revs for the current leaf or marked section.", null ) {
       
        pos = getLocation( conn );
        cellPos = Coordinates.worldToCell( pos );
        println( "Revs:" + cellPos + "  pos:" + pos );
   
        revs = worldDb.getLeafDb().getRevisions( cellPos.x, cellPos.y, cellPos.z );
       
        println( "revs:" + revs );
 
        console.echo( revs.size() + " revisions for leaf:" + cellPos.x + ", " + cellPos.y + ", " + cellPos.z );
       
        revsList = []
        revsList.addAll(revs);
       
        int index = 0;
        revsList.reverseEach {
            date = new Date(it);
            console.echo( (index++) + " : " + it + "  " + date );
        }   
    }
   
    addShellCommand( shell, "revert", "Reverts the current leaf or marked section to a previous version.", null ) {

        if( it.trim().length() == 0 ) {
            console.echo( "No revision index specified." );
            return;
        }
         
        if( !it.isNumber() ) {       
            console.echo( "Bad parameter:" + it );
            return;
        }
 
        Integer revIndex = it.toInteger();
       
        pos = getLocation( conn );
        cellPos = Coordinates.worldToCell( pos );
        println( "Revs:" + cellPos + "  pos:" + pos );
   
        revs = worldDb.getLeafDb().getRevisions( cellPos.x, cellPos.y, cellPos.z );
       
        println( "revs:" + revs );
 
        console.echo( revs.size() + " revisions for leaf:" + cellPos.x + ", " + cellPos.y + ", " + cellPos.z );
       
        revsList = []
        revsList.addAll(revs);
        revsList = revsList.reverse();
 
        if( revIndex > revsList.size() ) {
            console.echo( "Revision not found for index:" + revIndex );
            return;               
        }
       
        long revertTo = revsList.get(revIndex);               
        console.echo( "Reverting to:" + revertTo );
       
        LeafData old = worldDb.getLeafDb().readData( cellPos.x, cellPos.y, cellPos.z, revertTo );

        leaf = worldDb.getLeaf( cellPos.x, cellPos.y, cellPos.z );       
        println( "Leaf:" + leaf );
       
        println( "old:" + old );
           
        leaf.getInfo().set( old.getInfo() );
        leaf.setCells( old.getCells() );
        leaf.getInfo().lit = false;
        leaf.markChanged();
       
        println( "Leaf after reset:" + leaf );
       
        worldDb.resetLeaf( leaf );
           
    }
   
    addShellCommand( shell, "resizeprop",
                     "Increases the max area of the property that you are standing in.", null ) {
 
        def pos = getLocation();
        def loc = Coordinates.worldToCell(pos);
         
        console.echo( "You are at:" + loc );

        def property = perms.getContainingProperty( loc );
        if( property == null ) {
            console.echo( "You are not in a property." );
            return;
        }
       
        property = property.getId();
       
        def claimType = property[ClaimType.class];       
        console.echo( "claim type:" + claimType );     
       
        if( it.trim().length() == 0 ) {
            return;
        }
       
        if( !it.isNumber() ) {       
            console.echo( "Bad area size:" + it );
            return;
        }
       
        Integer newSize = it.toInteger();       
        property << new ClaimType( claimType.getClaimType(), newSize, claimType.getParent() );
       
        console.echo( "Max size increased to:" + newSize );
    }
}

The linked page talks about how to modify this script to give yourself these admin commands.

Regarding property, once you have the "grant" command then you can grant yourself admin privileges. 

Log in to your server.
Run the /who command and notice what your numbered ID is.
Run ~grant # admin
Then log out and back in again.

Commands added on the server to a player always need to be preceded with the ~ instead of /.  So ~grant, ~ungrant, ~resizeprop, etc.

Once you have the admin ability then you can "giveprop" to yourself or other players.
~giveprop # city
Where # is the player ID shown in the /who command.  That command gives a city property which I think is 256x256 by default.  stronghold is 32x32 and town is 128x128

If you are inside of a placed property then you can increase its max size with the "resizeprop" command.

~resizeprop 65536

...would increase the maximum size of a property to that of a city. 

Note that towns and cities have larger labels on the map and let players give out sub-plots.  A stronghold will never have that no matter how big you make it.

Placing properties is how you keep sections of the world from being modified.  Every player starts with a single stronghold.  The "giveprop" command can be used by an admin to grant more and bigger properties.

You can use this to protect parts of the world in various ways.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!