Fixed an issue with personal gates
Added default permissions
This commit is contained in:
		
							
								
								
									
										13
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								README
									
									
									
									
									
								
							@@ -41,6 +41,16 @@ stargate.admin -- Allow all admin features (Hidden/Private only so far)
 | 
			
		||||
  stargate.admin.private -- Allow use of Private gates not owned by user
 | 
			
		||||
  stargate.admin.hidden -- Allow access to Hidden gates not ownerd by user
 | 
			
		||||
 | 
			
		||||
=============
 | 
			
		||||
Default Permissions
 | 
			
		||||
=============
 | 
			
		||||
stargate.use -- Everyone
 | 
			
		||||
stargate.create -- Op
 | 
			
		||||
stargate.destroy -- Op
 | 
			
		||||
stargate.option -- Op
 | 
			
		||||
stargate.free -- Op
 | 
			
		||||
stargate.admin -- Op
 | 
			
		||||
 | 
			
		||||
=============
 | 
			
		||||
Instructions
 | 
			
		||||
=============
 | 
			
		||||
@@ -146,6 +156,9 @@ maxgates - If non-zero, will define the maximum amount of gates allowed on any n
 | 
			
		||||
=============
 | 
			
		||||
  Changes
 | 
			
		||||
=============
 | 
			
		||||
[Version 0.6.2]
 | 
			
		||||
 - Fixed an issue with private gates
 | 
			
		||||
 - Added default permissions
 | 
			
		||||
[Version 0.6.1]
 | 
			
		||||
 - Stop destruction of open gates on startup
 | 
			
		||||
[Version 0.6.0]
 | 
			
		||||
 
 | 
			
		||||
@@ -754,7 +754,10 @@ public class Portal {
 | 
			
		||||
		// Check if the player can create gates on this network
 | 
			
		||||
		if (!Stargate.canCreate(player, network)) {
 | 
			
		||||
			Stargate.debug("createPortal", "Player doesn't have create permissions on network. Trying personal");
 | 
			
		||||
			network = player.getName().substring(0, 11);
 | 
			
		||||
			network = player.getName();
 | 
			
		||||
			if (network.length() > 11) {
 | 
			
		||||
				network = network.substring(0, 11);
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			// Check if we can create a gate on our own network
 | 
			
		||||
			if (!Stargate.canCreate(player,  network)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -432,7 +432,9 @@ public class Stargate extends JavaPlugin {
 | 
			
		||||
		if (hasPerm(player, "stargate.create.network." + network)) return true;
 | 
			
		||||
		
 | 
			
		||||
		// Check if this is a personal gate, and if the player has create.personal
 | 
			
		||||
		if (player.getName().substring(0,  11).equalsIgnoreCase(network) && hasPerm(player, "stargate.create.personal")) return true;
 | 
			
		||||
		String pNet = player.getName();
 | 
			
		||||
		if (pNet.length() > 11) pNet = pNet.substring(0, 11);
 | 
			
		||||
		if (pNet.equalsIgnoreCase(network) && hasPerm(player, "stargate.create.personal")) return true;
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,29 @@
 | 
			
		||||
name: Stargate
 | 
			
		||||
main: net.TheDgtl.Stargate.Stargate
 | 
			
		||||
version: 0.6.1
 | 
			
		||||
version: 0.6.2
 | 
			
		||||
description: Stargate mod for Bukkit
 | 
			
		||||
author: Drakia
 | 
			
		||||
website: http://www.thedgtl.net
 | 
			
		||||
commands:
 | 
			
		||||
  sg:
 | 
			
		||||
    description: Used to reload the plugin. Console use only.
 | 
			
		||||
    usage: /<command> reload - Used to reload the plugin. Console use only.
 | 
			
		||||
    usage: /<command> reload - Used to reload the plugin. Console use only.
 | 
			
		||||
permissions:
 | 
			
		||||
  stargate.use:
 | 
			
		||||
    description: Allow use of all gates linking to any world in any network
 | 
			
		||||
    default: true
 | 
			
		||||
  stargate.create:
 | 
			
		||||
    description: Allow creating gates on any network
 | 
			
		||||
    default: op
 | 
			
		||||
  stargate.destroy:
 | 
			
		||||
    description: Allow destruction gates on any network
 | 
			
		||||
    default: op
 | 
			
		||||
  stargate.free:
 | 
			
		||||
    description: Allow free use/creation/destruction of gates
 | 
			
		||||
    default: op
 | 
			
		||||
  stargate.option:
 | 
			
		||||
    description: Allow use of all options
 | 
			
		||||
    default: op
 | 
			
		||||
  stargate.admin:
 | 
			
		||||
    description: Allow all admin features (Hidden/Private only so far)
 | 
			
		||||
    default: op
 | 
			
		||||
		Reference in New Issue
	
	Block a user