mirror of
https://github.com/encounter/dynmap.git
synced 2026-03-30 11:08:39 -07:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| afc0d9bd6b | |||
| 267b423ff1 | |||
| d523ce8a41 | |||
| ee7e6eedc8 | |||
| 4d6d156e9c | |||
| 177310a949 | |||
| 0707953718 | |||
| 8546b2205e | |||
| d154f23bab | |||
| 0b38a4cec8 | |||
| 02aedc9478 | |||
| 3702e07210 | |||
| 6afb0d9b92 | |||
| 1d6cedeeb0 | |||
| a3528e9937 | |||
| bae2a48a83 | |||
| 11b2123f14 | |||
| f93f37deea | |||
| cf5e2e00e6 | |||
| 121c1050ce | |||
| 4f6dd1d778 | |||
| 3ed44ee905 | |||
| 8f9d2c01c2 | |||
| faa1948225 | |||
| 67e0bd2f2c | |||
| 4fc8a53eb0 | |||
| 1c1937c80c | |||
| f24dfd6c3e | |||
| 86b87e78e3 | |||
| 34fe8316c3 | |||
| 387844b9dc | |||
| a493f85bcf | |||
| 1ab7a8ddbf | |||
| bdb2620ca9 | |||
| d8812ce575 | |||
| 6c618fa727 | |||
| a9214502cf | |||
| ef0ad40496 | |||
| 2628559b55 | |||
| 11021720c7 | |||
| de4fdb2b0c | |||
| ecdb50920e | |||
| 50f7382b7a |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.dynmap</groupId>
|
||||
<artifactId>dynmap</artifactId>
|
||||
<version>0.34</version>
|
||||
<version>0.38</version>
|
||||
<name>dynmap</name>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@@ -133,7 +133,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>[1.1-R5-SNAPSHOT,1.7)</version>
|
||||
<version>[1.2.5-R1.0,1.7)</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@@ -158,5 +158,26 @@
|
||||
<version>dev-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.tehkode</groupId>
|
||||
<artifactId>PermissionsEx</artifactId>
|
||||
<version>1.19.1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/PermissionsEx.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.bananaco</groupId>
|
||||
<artifactId>bPermissions</artifactId>
|
||||
<version>2.9.1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/bpermissions.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.platymuus.bukkit.permissions</groupId>
|
||||
<artifactId>PermissionsBukkit</artifactId>
|
||||
<version>1.6</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/PermissionsBukkit.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -6,6 +6,8 @@ import java.util.List;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.dynmap.DynmapChunk;
|
||||
import org.dynmap.DynmapLocation;
|
||||
import org.dynmap.DynmapWorld;
|
||||
@@ -13,11 +15,12 @@ import org.dynmap.utils.MapChunkCache;
|
||||
|
||||
public class BukkitWorld extends DynmapWorld {
|
||||
private World world;
|
||||
private Permission perm;
|
||||
|
||||
public BukkitWorld(World w) {
|
||||
super(normalizeWorldName(w.getName()), w.getMaxHeight(), w.getSeaLevel());
|
||||
|
||||
super(w.getName(), w.getMaxHeight(), w.getSeaLevel());
|
||||
world = w;
|
||||
perm = new Permission("dynmap.world." + getName(), "Dynmap access for world " + getName(), PermissionDefault.OP);
|
||||
}
|
||||
/* Test if world is nether */
|
||||
@Override
|
||||
@@ -93,8 +96,4 @@ public class BukkitWorld extends DynmapWorld {
|
||||
public World getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
public static String normalizeWorldName(String n) {
|
||||
return n.replace('/', '-');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package org.dynmap.bukkit;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Future;
|
||||
@@ -48,6 +50,8 @@ import org.bukkit.event.world.SpawnChangeEvent;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
import org.bukkit.event.world.WorldLoadEvent;
|
||||
import org.bukkit.event.world.WorldUnloadEvent;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@@ -63,13 +67,17 @@ import org.dynmap.PlayerList;
|
||||
import org.dynmap.bukkit.permissions.BukkitPermissions;
|
||||
import org.dynmap.bukkit.permissions.NijikokunPermissions;
|
||||
import org.dynmap.bukkit.permissions.OpPermissions;
|
||||
import org.dynmap.bukkit.permissions.PEXPermissions;
|
||||
import org.dynmap.bukkit.permissions.PermBukkitPermissions;
|
||||
import org.dynmap.bukkit.permissions.PermissionProvider;
|
||||
import org.dynmap.bukkit.permissions.bPermPermissions;
|
||||
import org.dynmap.common.BiomeMap;
|
||||
import org.dynmap.common.DynmapCommandSender;
|
||||
import org.dynmap.common.DynmapPlayer;
|
||||
import org.dynmap.common.DynmapServerInterface;
|
||||
import org.dynmap.common.DynmapListenerManager.EventType;
|
||||
import org.dynmap.markers.MarkerAPI;
|
||||
import org.getspout.spoutapi.plugin.SpoutPlugin;
|
||||
|
||||
public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
private DynmapCore core;
|
||||
@@ -273,6 +281,27 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public Set<String> checkPlayerPermissions(String player, Set<String> perms) {
|
||||
OfflinePlayer p = getServer().getOfflinePlayer(player);
|
||||
if(p.isBanned())
|
||||
return new HashSet<String>();
|
||||
Set<String> rslt = permissions.hasOfflinePermissions(player, perms);
|
||||
if (rslt == null) {
|
||||
rslt = new HashSet<String>();
|
||||
if(p.isOp()) {
|
||||
rslt.addAll(perms);
|
||||
}
|
||||
}
|
||||
return rslt;
|
||||
}
|
||||
@Override
|
||||
public boolean checkPlayerPermission(String player, String perm) {
|
||||
OfflinePlayer p = getServer().getOfflinePlayer(player);
|
||||
if(p.isBanned())
|
||||
return false;
|
||||
return permissions.hasOfflinePermission(player, perm);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Player access abstraction class
|
||||
@@ -417,9 +446,22 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
/* Set up player login/quit event handler */
|
||||
registerPlayerLoginListener();
|
||||
|
||||
permissions = NijikokunPermissions.create(getServer(), "dynmap");
|
||||
/* Build default permissions from our plugin */
|
||||
Map<String, Boolean> perdefs = new HashMap<String, Boolean>();
|
||||
List<Permission> pd = plugin.getDescription().getPermissions();
|
||||
for(Permission p : pd) {
|
||||
perdefs.put(p.getName(), p.getDefault() == PermissionDefault.TRUE);
|
||||
}
|
||||
|
||||
permissions = PEXPermissions.create(getServer(), "dynmap");
|
||||
if (permissions == null)
|
||||
permissions = BukkitPermissions.create("dynmap");
|
||||
permissions = bPermPermissions.create(getServer(), "dynmap", perdefs);
|
||||
if (permissions == null)
|
||||
permissions = PermBukkitPermissions.create(getServer(), "dynmap", perdefs);
|
||||
if (permissions == null)
|
||||
permissions = NijikokunPermissions.create(getServer(), "dynmap");
|
||||
if (permissions == null)
|
||||
permissions = BukkitPermissions.create("dynmap", perdefs);
|
||||
if (permissions == null)
|
||||
permissions = new OpPermissions(new String[] { "fullrender", "cancelrender", "radiusrender", "resetstats", "reload", "purgequeue", "pause", "ips-for-id", "ids-for-ip", "add-id-for-ip", "del-id-for-ip" });
|
||||
/* Get and initialize data folder */
|
||||
@@ -610,7 +652,7 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
}
|
||||
|
||||
private static DynmapLocation toLoc(Location l) {
|
||||
return new DynmapLocation(BukkitWorld.normalizeWorldName(l.getWorld().getName()), l.getBlockX(), l.getBlockY(), l.getBlockZ());
|
||||
return new DynmapLocation(DynmapWorld.normalizeWorldName(l.getWorld().getName()), l.getBlockX(), l.getBlockY(), l.getBlockZ());
|
||||
}
|
||||
|
||||
private void registerPlayerLoginListener() {
|
||||
@@ -783,6 +825,7 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
return;
|
||||
Block b = event.getBlock();
|
||||
Material m = b.getType();
|
||||
if(m == null) return;
|
||||
switch(m) {
|
||||
case STATIONARY_WATER:
|
||||
case WATER:
|
||||
@@ -790,7 +833,7 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
case LAVA:
|
||||
case GRAVEL:
|
||||
case SAND:
|
||||
checkBlock(event.getBlock(), "blockphysics");
|
||||
checkBlock(b, "blockphysics");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -805,12 +848,14 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
public void onBlockFromTo(BlockFromToEvent event) {
|
||||
if(event.isCancelled())
|
||||
return;
|
||||
Material m = event.getBlock().getType();
|
||||
if((m != Material.WOOD_PLATE) && (m != Material.STONE_PLATE))
|
||||
checkBlock(event.getBlock(), "blockfromto");
|
||||
m = event.getToBlock().getType();
|
||||
if((m != Material.WOOD_PLATE) && (m != Material.STONE_PLATE))
|
||||
checkBlock(event.getToBlock(), "blockfromto");
|
||||
Block b = event.getBlock();
|
||||
Material m = b.getType();
|
||||
if((m != Material.WOOD_PLATE) && (m != Material.STONE_PLATE) && (m != null))
|
||||
checkBlock(b, "blockfromto");
|
||||
b = event.getToBlock();
|
||||
m = b.getType();
|
||||
if((m != Material.WOOD_PLATE) && (m != Material.STONE_PLATE) && (m != null))
|
||||
checkBlock(b, "blockfromto");
|
||||
}
|
||||
};
|
||||
pm.registerEvents(fromtolistener, this);
|
||||
@@ -1077,7 +1122,10 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
|
||||
private boolean detectSpout() {
|
||||
Plugin p = this.getServer().getPluginManager().getPlugin("Spout");
|
||||
return (p != null);
|
||||
if(p != null) {
|
||||
return p.isEnabled();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasSpout() {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package org.dynmap.bukkit;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
@@ -31,8 +31,8 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
private static Method gethandle = null;
|
||||
private static Method removeentities = null;
|
||||
private static Method getworldhandle = null;
|
||||
private static Field chunkbiome = null;
|
||||
private static boolean use_spout = false;
|
||||
private static boolean use_sections = false;
|
||||
|
||||
private World w;
|
||||
private DynmapWorld dw;
|
||||
@@ -50,7 +50,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
private boolean do_save = false;
|
||||
private boolean isempty = true;
|
||||
private ChunkSnapshot[] snaparray; /* Index = (x-x_min) + ((z-z_min)*x_dim) */
|
||||
private byte[][] swampcnt;
|
||||
private byte[][] sameneighborbiomecnt;
|
||||
private BiomeMap[][] biomemap;
|
||||
private boolean[][] isSectionNotEmpty; /* Indexed by snapshot index, then by section index */
|
||||
|
||||
@@ -114,41 +114,61 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
return blkdata;
|
||||
}
|
||||
public int getBlockSkyLight() {
|
||||
return snap.getBlockSkyLight(bx, y, bz);
|
||||
try {
|
||||
return snap.getBlockSkyLight(bx, y, bz);
|
||||
} catch (ArrayIndexOutOfBoundsException aioobx) {
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
public final int getBlockEmittedLight() {
|
||||
return snap.getBlockEmittedLight(bx, y, bz);
|
||||
try {
|
||||
return snap.getBlockEmittedLight(bx, y, bz);
|
||||
} catch (ArrayIndexOutOfBoundsException aioobx) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
private void biomePrep() {
|
||||
if(swampcnt != null)
|
||||
if(sameneighborbiomecnt != null)
|
||||
return;
|
||||
int x_size = x_dim << 4;
|
||||
int z_size = (z_max - z_min + 1) << 4;
|
||||
swampcnt = new byte[x_size][];
|
||||
sameneighborbiomecnt = new byte[x_size][];
|
||||
biomemap = new BiomeMap[x_size][];
|
||||
for(int i = 0; i < x_size; i++) {
|
||||
swampcnt[i] = new byte[z_size];
|
||||
sameneighborbiomecnt[i] = new byte[z_size];
|
||||
biomemap[i] = new BiomeMap[z_size];
|
||||
}
|
||||
for(int i = 0; i < x_size; i++) {
|
||||
initialize(i + x_base, 64, z_base);
|
||||
for(int j = 0; j < z_size; j++) {
|
||||
Biome bb = snap.getBiome(bx, bz);
|
||||
BiomeMap bm;
|
||||
if(bb == null)
|
||||
biomemap[i][j] = BiomeMap.NULL;
|
||||
bm = BiomeMap.NULL;
|
||||
else
|
||||
biomemap[i][j] = biome_to_bmap[bb.ordinal()];
|
||||
if(biomemap[i][j] == BiomeMap.SWAMPLAND) {
|
||||
for(int ii = i-1; ii < i+2; ii++) {
|
||||
for(int jj = j-1; jj < j+2; jj++) {
|
||||
if(ii < 0) continue;
|
||||
if(jj < 0) continue;
|
||||
if(ii >= x_size) continue;
|
||||
if(jj >= z_size) continue;
|
||||
swampcnt[ii][jj]++;
|
||||
}
|
||||
bm = biome_to_bmap[bb.ordinal()];
|
||||
biomemap[i][j] = bm;
|
||||
int cnt = 0;
|
||||
if(i > 0) {
|
||||
if(bm == biomemap[i-1][j]) { /* Same as one to left */
|
||||
cnt++;
|
||||
sameneighborbiomecnt[i-1][j]++;
|
||||
}
|
||||
if((j > 0) && (bm == biomemap[i-1][j-1])) {
|
||||
cnt++;
|
||||
sameneighborbiomecnt[i-1][j-1]++;
|
||||
}
|
||||
if((j < (z_size-1)) && (bm == biomemap[i-1][j+1])) {
|
||||
cnt++;
|
||||
sameneighborbiomecnt[i-1][j+1]++;
|
||||
}
|
||||
}
|
||||
if((j > 0) && (biomemap[i][j] == biomemap[i][j-1])) { /* Same as one to above */
|
||||
cnt++;
|
||||
sameneighborbiomecnt[i][j-1]++;
|
||||
}
|
||||
sameneighborbiomecnt[i][j] = (byte)cnt;
|
||||
|
||||
stepPosition(BlockStep.Z_PLUS);
|
||||
}
|
||||
}
|
||||
@@ -158,54 +178,170 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
try {
|
||||
return biomemap[x - x_base][z - z_base];
|
||||
} catch (Exception ex) {
|
||||
exceptions++;
|
||||
return BiomeMap.NULL;
|
||||
}
|
||||
}
|
||||
|
||||
public final int countSmoothedSwampBiomes() {
|
||||
public final int getSmoothGrassColorMultiplier(int[] colormap, int width) {
|
||||
int mult = 0xFFFFFF;
|
||||
try {
|
||||
return swampcnt[x - x_base][z - z_base];
|
||||
} catch (Exception ex) {
|
||||
return 0;
|
||||
int rx = x - x_base;
|
||||
int rz = z - z_base;
|
||||
BiomeMap bm = biomemap[rx][rz];
|
||||
if(sameneighborbiomecnt[rx][rz] >= (byte)8) { /* All neighbors same? */
|
||||
mult = bm.getModifiedGrassMultiplier(colormap[bm.biomeLookup(width)]);
|
||||
}
|
||||
else {
|
||||
int raccum = 0;
|
||||
int gaccum = 0;
|
||||
int baccum = 0;
|
||||
for(int xoff = -1; xoff < 2; xoff++) {
|
||||
for(int zoff = -1; zoff < 2; zoff++) {
|
||||
bm = biomemap[rx+xoff][rz+zoff];
|
||||
int rmult = bm.getModifiedGrassMultiplier(colormap[bm.biomeLookup(width)]);
|
||||
raccum += (rmult >> 16) & 0xFF;
|
||||
gaccum += (rmult >> 8) & 0xFF;
|
||||
baccum += rmult & 0xFF;
|
||||
}
|
||||
}
|
||||
mult = ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
mult = 0xFFFFFF;
|
||||
}
|
||||
return mult;
|
||||
}
|
||||
public final int getSmoothFoliageColorMultiplier(int[] colormap, int width) {
|
||||
int mult = 0xFFFFFF;
|
||||
try {
|
||||
int rx = x - x_base;
|
||||
int rz = z - z_base;
|
||||
BiomeMap bm = biomemap[rx][rz];
|
||||
if(sameneighborbiomecnt[rx][rz] >= (byte)8) { /* All neighbors same? */
|
||||
mult = bm.getModifiedFoliageMultiplier(colormap[bm.biomeLookup(width)]);
|
||||
}
|
||||
else {
|
||||
int raccum = 0;
|
||||
int gaccum = 0;
|
||||
int baccum = 0;
|
||||
for(int xoff = -1; xoff < 2; xoff++) {
|
||||
for(int zoff = -1; zoff < 2; zoff++) {
|
||||
bm = biomemap[rx+xoff][rz+zoff];
|
||||
int rmult = bm.getModifiedFoliageMultiplier(colormap[bm.biomeLookup(width)]);
|
||||
raccum += (rmult >> 16) & 0xFF;
|
||||
gaccum += (rmult >> 8) & 0xFF;
|
||||
baccum += rmult & 0xFF;
|
||||
}
|
||||
}
|
||||
mult = ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
mult = 0xFFFFFF;
|
||||
}
|
||||
return mult;
|
||||
}
|
||||
public final int getSmoothColorMultiplier(int[] colormap, int width, int[] swampmap, int swampwidth) {
|
||||
int mult = 0xFFFFFF;
|
||||
try {
|
||||
int rx = x - x_base;
|
||||
int rz = z - z_base;
|
||||
BiomeMap bm = biomemap[rx][rz];
|
||||
if(sameneighborbiomecnt[rx][rz] >= (byte)8) { /* All neighbors same? */
|
||||
if(bm == BiomeMap.SWAMPLAND) {
|
||||
mult = swampmap[bm.biomeLookup(swampwidth)];
|
||||
}
|
||||
else {
|
||||
mult = colormap[bm.biomeLookup(width)];
|
||||
}
|
||||
}
|
||||
else {
|
||||
int raccum = 0;
|
||||
int gaccum = 0;
|
||||
int baccum = 0;
|
||||
for(int xoff = -1; xoff < 2; xoff++) {
|
||||
for(int zoff = -1; zoff < 2; zoff++) {
|
||||
bm = biomemap[rx+xoff][rz+zoff];
|
||||
int rmult;
|
||||
if(bm == BiomeMap.SWAMPLAND) {
|
||||
rmult = swampmap[bm.biomeLookup(swampwidth)];
|
||||
}
|
||||
else {
|
||||
rmult = colormap[bm.biomeLookup(width)];
|
||||
}
|
||||
raccum += (rmult >> 16) & 0xFF;
|
||||
gaccum += (rmult >> 8) & 0xFF;
|
||||
baccum += rmult & 0xFF;
|
||||
}
|
||||
}
|
||||
mult = ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
mult = 0xFFFFFF;
|
||||
}
|
||||
return mult;
|
||||
}
|
||||
|
||||
public final int countSmoothedSwampBiomes(int sx, int sz, int scale) {
|
||||
public final int getSmoothWaterColorMultiplier() {
|
||||
try {
|
||||
int xx = x - x_base;
|
||||
int zz = z - z_base;
|
||||
sx <<= 1;
|
||||
sz <<= 1;
|
||||
int s0 = swampcnt[xx][zz];
|
||||
int w;
|
||||
int tot;
|
||||
if(sx < scale) {
|
||||
w = scale - sx;
|
||||
tot = (w * swampcnt[xx-1][zz]) + ((scale - w) * s0);
|
||||
int rx = x - x_base;
|
||||
int rz = z - z_base;
|
||||
BiomeMap bm = biomemap[rx][rz];
|
||||
if(sameneighborbiomecnt[rx][rz] >= (byte)8) { /* All neighbors same? */
|
||||
return bm.getWaterColorMult();
|
||||
}
|
||||
else if(sx > scale) {
|
||||
w = sx - scale;
|
||||
tot = (w * swampcnt[xx+1][zz]) + ((scale - w) * s0);
|
||||
int raccum = 0;
|
||||
int gaccum = 0;
|
||||
int baccum = 0;
|
||||
for(int xoff = -1; xoff < 2; xoff++) {
|
||||
for(int zoff = -1; zoff < 2; zoff++) {
|
||||
bm = biomemap[rx+xoff][rz+zoff];
|
||||
int mult = bm.getWaterColorMult();
|
||||
raccum += (mult >> 16) & 0xFF;
|
||||
gaccum += (mult >> 8) & 0xFF;
|
||||
baccum += mult & 0xFF;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tot = scale * s0;
|
||||
}
|
||||
if(sz < scale) {
|
||||
w = scale - sz;
|
||||
tot += (w * swampcnt[xx][zz-1]) + ((scale - w) * s0);
|
||||
}
|
||||
else if(sz > scale) {
|
||||
w = sz - scale;
|
||||
tot += (w * swampcnt[xx][zz+1]) + ((scale - w) * s0);
|
||||
}
|
||||
else {
|
||||
tot += scale * s0;
|
||||
}
|
||||
return tot;
|
||||
} catch (Exception ex) {
|
||||
return 0;
|
||||
return ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
public final int getSmoothWaterColorMultiplier(int[] colormap, int width) {
|
||||
int mult = 0xFFFFFF;
|
||||
try {
|
||||
int rx = x - x_base;
|
||||
int rz = z - z_base;
|
||||
BiomeMap bm = biomemap[rx][rz];
|
||||
if(sameneighborbiomecnt[rx][rz] >= (byte)8) { /* All neighbors same? */
|
||||
mult = colormap[bm.biomeLookup(width)];
|
||||
}
|
||||
else {
|
||||
int raccum = 0;
|
||||
int gaccum = 0;
|
||||
int baccum = 0;
|
||||
for(int xoff = -1; xoff < 2; xoff++) {
|
||||
for(int zoff = -1; zoff < 2; zoff++) {
|
||||
bm = biomemap[rx+xoff][rz+zoff];
|
||||
int rmult = colormap[bm.biomeLookup(width)];
|
||||
raccum += (rmult >> 16) & 0xFF;
|
||||
gaccum += (rmult >> 8) & 0xFF;
|
||||
baccum += rmult & 0xFF;
|
||||
}
|
||||
}
|
||||
mult = ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
mult = 0xFFFFFF;
|
||||
}
|
||||
return mult;
|
||||
}
|
||||
|
||||
public final double getRawBiomeTemperature() {
|
||||
return snap.getRawBiomeTemperature(bx, bz);
|
||||
@@ -409,9 +545,6 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
public boolean isSectionEmpty(int sy) {
|
||||
return true;
|
||||
}
|
||||
public int getTopNonEmptySection() {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -457,11 +590,22 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
|
||||
private static class SpoutChunkSnapshot implements ChunkSnapshot {
|
||||
private ChunkSnapshot chunk;
|
||||
private short[] customids; /* (X << 11) | (Z << 7) | Y */
|
||||
private short[] customids;
|
||||
private final int shiftx;
|
||||
private final int shiftz;
|
||||
|
||||
SpoutChunkSnapshot(ChunkSnapshot chunk, short[] customids) {
|
||||
SpoutChunkSnapshot(ChunkSnapshot chunk, short[] customids, int height) {
|
||||
this.chunk = chunk;
|
||||
this.customids = customids.clone();
|
||||
int sx = 11;
|
||||
int sz = 7; /* 128 high values */
|
||||
while(height > 128) {
|
||||
sx++;
|
||||
sz++;
|
||||
height = (height >> 1);
|
||||
}
|
||||
shiftx = sx;
|
||||
shiftz = sz;
|
||||
}
|
||||
/* Need these for interface, but not used */
|
||||
public final int getX() { return chunk.getX(); }
|
||||
@@ -473,7 +617,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
public final long getCaptureFullTime() { return chunk.getCaptureFullTime(); }
|
||||
|
||||
public final int getBlockTypeId(int x, int y, int z) {
|
||||
int id = customids[(x << 11) | (z << 7) | y];
|
||||
int id = customids[(x << shiftx) | (z << shiftz) | y];
|
||||
if(id != 0) return id;
|
||||
return chunk.getBlockTypeId(x, y, z);
|
||||
}
|
||||
@@ -490,12 +634,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
return chunk.getHighestBlockYAt(x, z);
|
||||
}
|
||||
public boolean isSectionEmpty(int sy) {
|
||||
//TODO return chunk.isSectionEmpty(sy);
|
||||
return false;
|
||||
}
|
||||
public int getTopNonEmptySection() {
|
||||
return 0;
|
||||
//TODO return chunk.getTopNonEmptySection();
|
||||
return chunk.isSectionEmpty(sy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -532,15 +671,13 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
} catch (ClassNotFoundException cnfx) {
|
||||
} catch (NoSuchMethodException nsmx) {
|
||||
}
|
||||
|
||||
/* Get CraftChunkSnapshot.biome field */
|
||||
/* Check for ChunkSnapshot.isSectionEmpty(int) method */
|
||||
try {
|
||||
Class c = Class.forName("org.bukkit.craftbukkit.CraftChunkSnapshot");
|
||||
chunkbiome = c.getDeclaredField("biome");
|
||||
chunkbiome.setAccessible(true);
|
||||
} catch (ClassNotFoundException cnfx) {
|
||||
} catch (NoSuchFieldException nsmx) {
|
||||
ChunkSnapshot.class.getDeclaredMethod("isSectionEmpty", new Class[] { int.class });
|
||||
use_sections = true;
|
||||
} catch (NoSuchMethodException nsmx) {
|
||||
}
|
||||
|
||||
use_spout = DynmapPlugin.plugin.hasSpout();
|
||||
|
||||
init = true;
|
||||
@@ -590,7 +727,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
SpoutChunk sc = (SpoutChunk)c;
|
||||
short[] custids = sc.getCustomBlockIds();
|
||||
if(custids != null) {
|
||||
return new SpoutChunkSnapshot(ss, custids);
|
||||
return new SpoutChunkSnapshot(ss, custids, c.getWorld().getMaxHeight());
|
||||
}
|
||||
}
|
||||
return ss;
|
||||
@@ -799,23 +936,16 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
isSectionNotEmpty[idx] = new boolean[nsect + 1];
|
||||
int maxy = 0;
|
||||
if(snaparray[idx] != EMPTY) {
|
||||
/* Get max height */
|
||||
if(dw.isNether()) {
|
||||
maxy = 128;
|
||||
if(!use_sections) {
|
||||
Arrays.fill(isSectionNotEmpty[idx], true);
|
||||
}
|
||||
else {
|
||||
for(int i = 0; i < 16; i++) {
|
||||
for(int j = 0; j < 16; j++) {
|
||||
maxy = Math.max(maxy, snaparray[idx].getHighestBlockYAt(i, j));
|
||||
for(int i = 0; i < nsect; i++) {
|
||||
if(snaparray[idx].isSectionEmpty(i) == false) {
|
||||
isSectionNotEmpty[idx][i] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
maxy = (maxy-1) >> 4;
|
||||
for(int i = 0; i <= nsect; i++) {
|
||||
if(i <= maxy) { /* Below top? */
|
||||
isSectionNotEmpty[idx][i] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public boolean isEmptySection(int sx, int sy, int sz) {
|
||||
@@ -901,8 +1031,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
public boolean setChunkDataTypes(boolean blockdata, boolean biome, boolean highestblocky, boolean rawbiome) {
|
||||
this.biome = biome;
|
||||
this.biomeraw = rawbiome;
|
||||
//this.highesty = highestblocky;
|
||||
this.highesty = true;
|
||||
this.highesty = highestblocky;
|
||||
this.blockdata = blockdata;
|
||||
return true;
|
||||
}
|
||||
@@ -931,6 +1060,9 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
Biome[] b = Biome.values();
|
||||
BiomeMap[] bm = BiomeMap.values();
|
||||
biome_to_bmap = new BiomeMap[b.length];
|
||||
for(int i = 0; i < b.length; i++) {
|
||||
biome_to_bmap[i] = BiomeMap.NULL;
|
||||
}
|
||||
for(int i = 0; i < b.length; i++) {
|
||||
String bs = b[i].toString();
|
||||
for(int j = 0; j < bm.length; j++) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.List;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.dynmap.Log;
|
||||
import org.getspout.spoutapi.block.design.BlockDesign;
|
||||
import org.getspout.spoutapi.block.design.GenericBlockDesign;
|
||||
@@ -73,6 +74,7 @@ public class SpoutPluginBlocks {
|
||||
for(CustomBlock b : cb) {
|
||||
BlockDesign bd = b.getBlockDesign();
|
||||
String blkid = bd.getTexturePlugin() + "." + b.getName();
|
||||
blkid = blkid.replace(' ', '_');
|
||||
/* If not GenericCubiodBlockDesign, we don't handle it */
|
||||
if((bd instanceof GenericCuboidBlockDesign) == false) {
|
||||
Log.info("Block " + blkid + " not suppored - only cubiod blocks");
|
||||
@@ -166,7 +168,7 @@ public class SpoutPluginBlocks {
|
||||
blks.add(b);
|
||||
|
||||
sb.append("block:id=" + b.getCustomId() + ",data=*,bottom=" + txtidx[0] + ",west=" +txtidx[1] + ",south=" + txtidx[2] + ",east=" + txtidx[3] + ",north="+txtidx[4]+",top="+txtidx[5]);
|
||||
if(b.isOpaque() == false)
|
||||
if(b.getBlockId() == Material.GLASS.getId())
|
||||
sb.append(",transparency=TRANSPARENT");
|
||||
sb.append(",txtid=" + txfileid + "\n");
|
||||
cnt++;
|
||||
|
||||
@@ -1,24 +1,33 @@
|
||||
package org.dynmap.bukkit.permissions;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.dynmap.Log;
|
||||
|
||||
public class BukkitPermissions implements PermissionProvider {
|
||||
String name;
|
||||
protected String name;
|
||||
protected Map<String, Boolean> pd;
|
||||
|
||||
public static BukkitPermissions create(String name) {
|
||||
public static BukkitPermissions create(String name, Map<String,Boolean> pd) {
|
||||
try {
|
||||
Class.forName("org.bukkit.permissions.PermissibleBase"); /* See if class exists */
|
||||
} catch (ClassNotFoundException cnfx) {
|
||||
return null;
|
||||
}
|
||||
Log.info("Using Bukkit Permissions (superperms) for access control");
|
||||
return new BukkitPermissions(name);
|
||||
Log.info("Web interface permissions only available for online users");
|
||||
return new BukkitPermissions(name, pd);
|
||||
}
|
||||
|
||||
public BukkitPermissions(String name) {
|
||||
public BukkitPermissions(String name, Map<String, Boolean> pd) {
|
||||
this.name = name;
|
||||
this.pd = pd;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,4 +37,33 @@ public class BukkitPermissions implements PermissionProvider {
|
||||
? player.hasPermission(name + "." + permission) || player.hasPermission(name + ".*")
|
||||
: true;
|
||||
}
|
||||
@Override
|
||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||
Player p = Bukkit.getPlayerExact(name);
|
||||
HashSet<String> hasperms = null;
|
||||
if (p != null) {
|
||||
hasperms = new HashSet<String>();
|
||||
for(String perm : perms) {
|
||||
if (p.hasPermission(name + "." + perm)) {
|
||||
hasperms.add(perm);
|
||||
}
|
||||
}
|
||||
}
|
||||
return hasperms;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOfflinePermission(String player, String perm) {
|
||||
Player p = Bukkit.getPlayerExact(player);
|
||||
if (p != null) {
|
||||
return p.hasPermission(name + "." + perm);
|
||||
}
|
||||
else {
|
||||
OfflinePlayer op = Bukkit.getOfflinePlayer(player);
|
||||
if((op != null) && op.isOp()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package org.dynmap.bukkit.permissions;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -13,6 +17,7 @@ public class NijikokunPermissions implements PermissionProvider {
|
||||
String name;
|
||||
PermissionHandler permissions;
|
||||
Plugin plugin;
|
||||
String defworld;
|
||||
|
||||
public static NijikokunPermissions create(Server server, String name) {
|
||||
Plugin permissionsPlugin = server.getPluginManager().getPlugin("Permissions");
|
||||
@@ -20,6 +25,9 @@ public class NijikokunPermissions implements PermissionProvider {
|
||||
return null;
|
||||
|
||||
server.getPluginManager().enablePlugin(permissionsPlugin);
|
||||
if(permissionsPlugin.isEnabled() == false)
|
||||
return null;
|
||||
|
||||
Log.info("Using Permissions " + permissionsPlugin.getDescription().getVersion() + " for access control");
|
||||
return new NijikokunPermissions(permissionsPlugin, name);
|
||||
}
|
||||
@@ -27,6 +35,7 @@ public class NijikokunPermissions implements PermissionProvider {
|
||||
public NijikokunPermissions(Plugin permissionsPlugin, String name) {
|
||||
this.name = name;
|
||||
plugin = permissionsPlugin;
|
||||
defworld = Bukkit.getServer().getWorlds().get(0).getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -38,4 +47,25 @@ public class NijikokunPermissions implements PermissionProvider {
|
||||
? permissions.has(player, name + "." + permission) || permissions.has(player, name + ".*")
|
||||
: true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||
if(permissions == null)
|
||||
permissions = ((Permissions)plugin).getHandler();
|
||||
HashSet<String> hasperms = new HashSet<String>();
|
||||
for (String pp : perms) {
|
||||
if (permissions.has(defworld, player, name + "." + pp)) {
|
||||
hasperms.add(pp);
|
||||
}
|
||||
}
|
||||
return hasperms;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOfflinePermission(String player, String perm) {
|
||||
if(permissions == null)
|
||||
permissions = ((Permissions)plugin).getHandler();
|
||||
return permissions.has(defworld, player, name + "." + perm);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.dynmap.bukkit.permissions;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -24,4 +25,12 @@ public class OpPermissions implements PermissionProvider {
|
||||
: true
|
||||
: true;
|
||||
}
|
||||
@Override
|
||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public boolean hasOfflinePermission(String player, String perm) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.dynmap.bukkit.permissions;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.dynmap.Log;
|
||||
|
||||
import ru.tehkode.permissions.PermissionManager;
|
||||
import ru.tehkode.permissions.PermissionUser;
|
||||
import ru.tehkode.permissions.bukkit.PermissionsEx;
|
||||
|
||||
public class PEXPermissions implements PermissionProvider {
|
||||
String name;
|
||||
PermissionManager pm;
|
||||
|
||||
public static PEXPermissions create(Server server, String name) {
|
||||
Plugin permissionsPlugin = server.getPluginManager().getPlugin("PermissionsEx");
|
||||
if (permissionsPlugin == null)
|
||||
return null;
|
||||
server.getPluginManager().enablePlugin(permissionsPlugin);
|
||||
if(permissionsPlugin.isEnabled() == false)
|
||||
return null;
|
||||
if(PermissionsEx.isAvailable() == false)
|
||||
return null;
|
||||
Log.info("Using PermissionsEx " + permissionsPlugin.getDescription().getVersion() + " for access control");
|
||||
return new PEXPermissions(name);
|
||||
}
|
||||
|
||||
public PEXPermissions(String name) {
|
||||
this.name = name;
|
||||
pm = PermissionsEx.getPermissionManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(CommandSender sender, String permission) {
|
||||
Player player = sender instanceof Player ? (Player) sender : null;
|
||||
return (player != null) ? pm.has(player, name + "." + permission) : true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||
HashSet<String> hasperms = new HashSet<String>();
|
||||
PermissionUser pu = pm.getUser(player);
|
||||
if(pu != null) {
|
||||
for (String pp : perms) {
|
||||
if (pu.has(name + "." + pp)) {
|
||||
hasperms.add(pp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return hasperms;
|
||||
}
|
||||
@Override
|
||||
public boolean hasOfflinePermission(String player, String perm) {
|
||||
PermissionUser pu = pm.getUser(player);
|
||||
if(pu != null) {
|
||||
return pu.has(name + "." + perm);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.dynmap.bukkit.permissions;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.dynmap.Log;
|
||||
|
||||
import com.nijiko.permissions.PermissionHandler;
|
||||
import com.platymuus.bukkit.permissions.PermissionInfo;
|
||||
import com.platymuus.bukkit.permissions.PermissionsPlugin;
|
||||
|
||||
import de.bananaco.bpermissions.api.ApiLayer;
|
||||
import de.bananaco.bpermissions.api.util.CalculableType;
|
||||
import de.bananaco.bpermissions.api.util.Permission;
|
||||
|
||||
public class PermBukkitPermissions extends BukkitPermissions {
|
||||
PermissionsPlugin plugin;
|
||||
Map<String, Boolean> pd;
|
||||
|
||||
public static PermBukkitPermissions create(Server server, String name, Map<String, Boolean> pd) {
|
||||
Plugin permissionsPlugin = server.getPluginManager().getPlugin("PermissionsBukkit");
|
||||
if (permissionsPlugin == null)
|
||||
return null;
|
||||
|
||||
server.getPluginManager().enablePlugin(permissionsPlugin);
|
||||
if(permissionsPlugin.isEnabled() == false)
|
||||
return null;
|
||||
|
||||
Log.info("Using PermissionsBukkit " + permissionsPlugin.getDescription().getVersion() + " for access control");
|
||||
Log.info("Web interface permissions only available for online users");
|
||||
return new PermBukkitPermissions(permissionsPlugin, name, pd);
|
||||
}
|
||||
|
||||
public PermBukkitPermissions(Plugin permissionsPlugin, String name, Map<String, Boolean> pd) {
|
||||
super(name, pd);
|
||||
plugin = (PermissionsPlugin) permissionsPlugin;
|
||||
this.pd = pd;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,14 @@
|
||||
package org.dynmap.bukkit.permissions;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public interface PermissionProvider {
|
||||
boolean has(CommandSender sender, String permission);
|
||||
|
||||
Set<String> hasOfflinePermissions(String player, Set<String> perms);
|
||||
|
||||
boolean hasOfflinePermission(String player, String perm);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package org.dynmap.bukkit.permissions;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.dynmap.Log;
|
||||
|
||||
import ru.tehkode.permissions.bukkit.PermissionsEx;
|
||||
|
||||
import de.bananaco.bpermissions.api.ApiLayer;
|
||||
import de.bananaco.bpermissions.api.User;
|
||||
import de.bananaco.bpermissions.api.WorldManager;
|
||||
import de.bananaco.bpermissions.api.util.CalculableType;
|
||||
import de.bananaco.bpermissions.api.util.Permission;
|
||||
|
||||
public class bPermPermissions extends BukkitPermissions {
|
||||
WorldManager wm;
|
||||
|
||||
public static bPermPermissions create(Server server, String name, Map<String,Boolean> pd) {
|
||||
Plugin permissionsPlugin = server.getPluginManager().getPlugin("bPermissions");
|
||||
if (permissionsPlugin == null)
|
||||
return null;
|
||||
server.getPluginManager().enablePlugin(permissionsPlugin);
|
||||
if(permissionsPlugin.isEnabled() == false)
|
||||
return null;
|
||||
|
||||
Log.info("Using bPermissions " + permissionsPlugin.getDescription().getVersion() + " for access control");
|
||||
return new bPermPermissions(name, pd);
|
||||
}
|
||||
|
||||
public bPermPermissions(String name, Map<String,Boolean> pd) {
|
||||
super(name, pd);
|
||||
wm = WorldManager.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||
HashSet<String> hasperms = new HashSet<String>();
|
||||
User usr = wm.getDefaultWorld().getUser(player);
|
||||
if(usr != null) {
|
||||
try { usr.calculateEffectivePermissions(); } catch (Exception x) {}
|
||||
Map<String,Boolean> p = usr.getMappedPermissions();
|
||||
for (String pp : perms) {
|
||||
String permval = name + "." + pp;
|
||||
Boolean v = p.get(permval);
|
||||
if (v != null) {
|
||||
if(v.booleanValue())
|
||||
hasperms.add(permval);
|
||||
}
|
||||
else {
|
||||
v = pd.get(permval);
|
||||
if((v != null) && v.booleanValue())
|
||||
hasperms.add(permval);
|
||||
}
|
||||
}
|
||||
}
|
||||
return hasperms;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOfflinePermission(String player, String perm) {
|
||||
boolean rslt;
|
||||
String permval = name + "." + perm;
|
||||
User usr = wm.getDefaultWorld().getUser(player);
|
||||
if(usr != null) {
|
||||
try { usr.calculateEffectivePermissions(); } catch (Exception x) {}
|
||||
if(usr.getMappedPermissions().containsKey(permval)) {
|
||||
rslt = usr.hasPermission(permval);
|
||||
}
|
||||
else {
|
||||
Boolean v = pd.get(permval);
|
||||
if(v != null)
|
||||
rslt = v;
|
||||
else
|
||||
rslt = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
rslt = false;
|
||||
}
|
||||
return rslt;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,12 +28,20 @@ components:
|
||||
require-player-login-ip: false
|
||||
# (optional) block player login IDs that are banned from chatting
|
||||
block-banned-player-chat: true
|
||||
# Require login for web-to-server chat (requires login-enabled: true)
|
||||
webchat-requires-login: false
|
||||
# If set to true, users must have dynmap.webchat permission in order to chat
|
||||
webchat-permissions: false
|
||||
# Limit length of single chat messages
|
||||
chatlengthlimit: 256
|
||||
# # Optional - make players hidden when they are inside/underground/in shadows (#=light level: 0=full shadow,15=sky)
|
||||
# hideifshadow: 4
|
||||
# # Optional - make player hidden when they are under cover (#=sky light level,0=underground,15=open to sky)
|
||||
# hideifundercover: 14
|
||||
# # (Optional) if true, players that are crouching/sneaking will be hidden
|
||||
# hideifsneaking: false
|
||||
hideifsneaking: false
|
||||
# If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self)
|
||||
protected-player-info: false
|
||||
#- class: org.dynmap.JsonFileClientUpdateComponent
|
||||
# writeinterval: 1
|
||||
# sendhealth: true
|
||||
@@ -48,6 +56,12 @@ components:
|
||||
# hideifshadow: 0
|
||||
# hideifundercover: 0
|
||||
# hideifsneaking: false
|
||||
# # Require login for web-to-server chat (requires login-enabled: true)
|
||||
# webchat-requires-login: false
|
||||
# # If set to true, users must have dynmap.webchat permission in order to chat
|
||||
# webchat-permissions: false
|
||||
# # Limit length of single chat messages
|
||||
# chatlengthlimit: 256
|
||||
|
||||
- class: org.dynmap.SimpleWebChatComponent
|
||||
allowchat: true
|
||||
@@ -90,6 +104,8 @@ components:
|
||||
messagettl: 5
|
||||
# Optional: set number of lines in scrollable message history: if set, messagettl is not used to age out messages
|
||||
#scrollback: 100
|
||||
# Optiona; set maximum number of lines visible for chatbox
|
||||
#visiblelines: 10
|
||||
# Optional: send push button
|
||||
sendbutton: false
|
||||
- class: org.dynmap.ClientComponent
|
||||
@@ -167,17 +183,9 @@ zoomoutperiod: 30
|
||||
# Tile hashing is used to minimize tile file updates when no changes have occurred - set to false to disable
|
||||
enabletilehash: true
|
||||
|
||||
# Optional - control darkening of biome-shaded colors in swamp biomes (1.9+) - default is true for 1.9+, false for 1.8.x
|
||||
#swampshaded: false
|
||||
# Optional - control biome shading of water (1.9+) - default is true for 1.9+, false for 1.8.x
|
||||
#waterbiomeshaded: false
|
||||
|
||||
# Optional - hide ores: render as normal stone (so that they aren't revealed by maps)
|
||||
#hideores: true
|
||||
|
||||
# Optional - control rendering of fences (joining to blocks, as in 1.9+) - default is true for 1.9+, false for 1.8.x
|
||||
#fence-to-block-join: true
|
||||
|
||||
# Optional - enabled BetterGrass style rendering of grass and snow block sides
|
||||
#better-grass: true
|
||||
|
||||
@@ -188,15 +196,10 @@ smooth-lighting: false
|
||||
# Has no effect on maps with explicit format settings
|
||||
image-format: png
|
||||
|
||||
# Pre 0.29 render options - set all three to false if you want same results as 0.28 (i.e. you have existing maps and don't want to render)
|
||||
# use-generated-textures: if true, use generated textures (same as client); false is static, pre 0.29 textures
|
||||
# correct-water-lighting: if true, use corrected water lighting (same as client); false is legacy, pre 0.29 water (darker)
|
||||
# correct-biome-shading: if true, use fixed color mappings for birch, pine, lily, and proper water shading (same as client); false is pre 0.29
|
||||
# use-generated-textures: if true, use generated textures (same as client); false is static water/lava textures
|
||||
# correct-water-lighting: if true, use corrected water lighting (same as client); false is legacy water (darker)
|
||||
use-generated-textures: true
|
||||
correct-water-lighting: true
|
||||
correct-biome-shading: true
|
||||
# To enable smooth biome shading (as done in MC 1.1.0+), set this to true (this does increase render processing about 10%)
|
||||
smooth-biome-shading: true
|
||||
|
||||
# Control loading of player faces (if set to false, skins are never fetched)
|
||||
#fetchskins: false
|
||||
@@ -204,8 +207,8 @@ smooth-biome-shading: true
|
||||
# Control updating of player faces, once loaded (if faces are being managed by other apps or manually)
|
||||
#refreshskins: false
|
||||
|
||||
# Control behavior for new (1.9+) compass orientation (sunrise moved 90 degrees: east is now what used to be south)
|
||||
# default is 'pre19' for 1.8 server (existing orientation), 'newrose' for 1.9+ (preserve maps, rotate rose)
|
||||
# Control behavior for new (1.0+) compass orientation (sunrise moved 90 degrees: east is now what used to be south)
|
||||
# default is 'newrose' (preserve pre-1.0 maps, rotate rose)
|
||||
# 'newnorth' is used to rotate maps and rose (requires fullrender of any HDMap map - same as 'newrose' for FlatMap or KzedMap)
|
||||
compass-mode: newnorth
|
||||
|
||||
@@ -233,6 +236,9 @@ compass-mode: newnorth
|
||||
# Enabled ComputerCraft block rendering support
|
||||
#computercraft-support: true
|
||||
|
||||
# Enabled LC Trees++ block rendering support
|
||||
#lctrees-support: true
|
||||
|
||||
render-triggers:
|
||||
#- playermove
|
||||
#- playerjoin
|
||||
@@ -246,8 +252,8 @@ render-triggers:
|
||||
- blockspread
|
||||
- pistonmoved
|
||||
- explosion
|
||||
- blockfromto
|
||||
- blockphysics
|
||||
#- blockfromto
|
||||
#- blockphysics
|
||||
- structuregrow
|
||||
- blockgrow
|
||||
|
||||
@@ -275,6 +281,11 @@ disable-webserver: false
|
||||
# Enable/disable having the web server allow symbolic links (true=compatible with existing code, false=more secure (default))
|
||||
allow-symlinks: true
|
||||
|
||||
# Enable login support
|
||||
login-enabled: false
|
||||
# Require login to access website (requires login-enabled: true)
|
||||
login-required: false
|
||||
|
||||
# Period between tile renders for fullrender, in seconds (non-zero to pace fullrenders, lessen CPU load)
|
||||
timesliceinterval: 0.0
|
||||
|
||||
@@ -338,6 +349,8 @@ persist-ids-by-ip: true
|
||||
msg:
|
||||
maptypes: "Map Types"
|
||||
players: "Players"
|
||||
chatrequireslogin: "Chat Requires Login"
|
||||
chatnotallowed: "You are not permitted to send chat messages"
|
||||
|
||||
# Set to true to enable verbose startup messages - can help with debugging map configuration problems
|
||||
# Set to false for a much quieter startup log
|
||||
|
||||
@@ -21,15 +21,12 @@ commands:
|
||||
/<command> radiusrender worldname x z ## mapname - Render at least ## block radius from location x,z on world 'worldname' on map 'mapname'
|
||||
/<command> updaterender - Render updates starting at your location on all maps.
|
||||
/<command> updaterender mapname - Render updates starting at your location on give map
|
||||
/<command> updaterender worldname x z - Render updates starting at location x,z on world 'worldname' for all maps
|
||||
/<command> updaterender worldname x z mapname - Render updates starting at location x,z on world 'worldname' for given map
|
||||
/<command> cancelrender - Cancels any active renders on current world
|
||||
/<command> cancelrender world - Cancels any active renders of world 'world'
|
||||
/<command> stats - Show render statistics.
|
||||
/<command> stats world - Show render statistics for maps on world 'world'.
|
||||
/<command> triggerstats - Show render trigger statistics
|
||||
/<command> resetstats - Reset render statistics.
|
||||
/<command> resetstats world - Reset render statistics for maps on world 'world'.
|
||||
/<command> sendtoweb msg - Send message to web users
|
||||
/<command> purgequeue - Set tile update queue to empty
|
||||
/<command> pause - Show render pause state
|
||||
@@ -38,7 +35,8 @@ commands:
|
||||
/<command> ips-for-id <playerid> - Show IP addresses that have been used for the given player ID
|
||||
/<command> add-id-for-ip <playerid> <ipaddress> - Add player ID to given IP address
|
||||
/<command> del-id-for-ip <playerid> <ipaddress> - Delete player ID from given IP address
|
||||
|
||||
/<command> webregister - Start registration process for creating web login account
|
||||
|
||||
dmarker:
|
||||
description: Manipulate map markers
|
||||
usage: |
|
||||
@@ -80,6 +78,15 @@ commands:
|
||||
/<command> listlines - list details of all poly-lines
|
||||
/<command> updateline <label> <arg>:<value> ... - update attributes of poly-line with given label
|
||||
/<command> updateline id:<id> <arg>:<value> ... - update attributes of poly-line with given ID
|
||||
/<command> addcircle <label> radius:<rad> - add new circle centered at current location with given radius and label
|
||||
/<command> addcircle id:<id> <label> radius:<rad> - add new circle centered at current location with given radius and ID
|
||||
/<command> addcircle <label> radius:<rad> x:<x> y:<y> z:<z> world:<world> - add new circle centered at given coordinates with given radius and label
|
||||
/<command> deletecircle <label> - delete circle with given label
|
||||
/<command> deletecircle id:<id> <label> - delete circle with given ID
|
||||
/<command> listcircles - list details of all circles
|
||||
/<command> updatecircle <label> <arg>:<value> ... - update attributes of circle with given label
|
||||
/<command> updatecircle id:<id> <arg>:<value> ... - update attributes of circle with given ID
|
||||
|
||||
dmap:
|
||||
description: List and modify dynmap configuration
|
||||
usage: |
|
||||
@@ -114,6 +121,8 @@ permissions:
|
||||
dynmap.purgequeue: true
|
||||
dynmap.ids-for-ip: true
|
||||
dynmap.ips-for-id: true
|
||||
dynmap.webregister: true
|
||||
dynmap.webregister.other: true
|
||||
dynmap.pause: true
|
||||
dynmap.marker.add: true
|
||||
dynmap.marker.update: true
|
||||
@@ -133,6 +142,10 @@ permissions:
|
||||
dynmap.marker.updatearea: true
|
||||
dynmap.marker.listareas: true
|
||||
dynmap.marker.deletearea: true
|
||||
dynmap.marker.addcircle: true
|
||||
dynmap.marker.updatecircle: true
|
||||
dynmap.marker.listcircles: true
|
||||
dynmap.marker.deletecircle: true
|
||||
dynmap.dmap.worldlist: true
|
||||
dynmap.dmap.worldset: true
|
||||
dynmap.dmap.worldreset: true
|
||||
@@ -142,6 +155,7 @@ permissions:
|
||||
dynmap.dmap.perspectivelist: true
|
||||
dynmap.dmap.shaderlist: true
|
||||
dynmap.dmap.lightinglist: true
|
||||
dynmap.playermarkers.seeall: true
|
||||
dynmap.render:
|
||||
description: Allows /dynmap render command
|
||||
default: true
|
||||
@@ -193,6 +207,12 @@ permissions:
|
||||
dynmap.ips-for-id:
|
||||
description: Allows /dynmap ips-for-id
|
||||
default: op
|
||||
dynmap.webregister:
|
||||
description: Allows /dynmap webregister
|
||||
default: true
|
||||
dynmao,webregister.other:
|
||||
description: Allows /dynmap webregister userid
|
||||
default: op
|
||||
dynmap.marker.add:
|
||||
description: Allows /dmarker add
|
||||
default: op
|
||||
@@ -259,6 +279,18 @@ permissions:
|
||||
dynmap.marker.deleteline:
|
||||
description: Allows /dmarker deleteline
|
||||
default: op
|
||||
dynmap.marker.addcircle:
|
||||
description: Allows /dmarker addcircle
|
||||
default: op
|
||||
dynmap.marker.updatecircle:
|
||||
description: Allows /dmarker updatecircle
|
||||
default: op
|
||||
dynmap.marker.listcircles:
|
||||
description: Allows /dmarker listcircles
|
||||
default: op
|
||||
dynmap.marker.deletecircle:
|
||||
description: Allows /dmarker deletecircle
|
||||
default: op
|
||||
dynmap.dmap.worldlist:
|
||||
description: Allows /dmap worldlist
|
||||
default: op
|
||||
@@ -286,4 +318,9 @@ permissions:
|
||||
dynmap.dmap.lightinglist:
|
||||
description: Allows /dmap lightinglist
|
||||
default: op
|
||||
|
||||
dynmap.webchat:
|
||||
description: Allows web chat (if login required for webchat)
|
||||
default: true
|
||||
dynmap.playermarkers.seeall:
|
||||
description: Allow all players to be seen by user on web UI
|
||||
default: op
|
||||
|
||||
Reference in New Issue
Block a user