Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Countering alt accounts. #6

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e9ea605
Added code to check number of imprisoned alt accounts.
Exultant Jun 14, 2012
a7cb23f
Fixed issue with kicking players.
Exultant Jun 14, 2012
7aec199
Modified kicking behaviour.
Exultant Jun 15, 2012
2498370
Fixed onPlayerQuitEvent issue.
Exultant Jun 15, 2012
76309a1
Modified temp ban conditions.
Exultant Jun 26, 2012
677a5a0
Fixed pploadalts bug regarding command arguments.
Exultant Jun 27, 2012
c4cba81
Added code to take advantage of changes to CombatTag API in order to …
Exultant Sep 7, 2012
271a682
Added missing files.
Exultant Sep 8, 2012
00d41de
Added better control over summoned prisoners.
Diagoras Sep 8, 2012
ed992cd
Merge branch 'master' of git://github.com/Exultant/PrisonPearl
Diagoras Sep 8, 2012
a1938be
Added Exultant's new files.
Diagoras Sep 8, 2012
0e8a6fd
Fixes.
Diagoras Sep 8, 2012
21c3d51
Fixes.
Diagoras Sep 8, 2012
d63367f
Merge pull request #1 from Diagoras/master
Diagoras Sep 8, 2012
427237f
Fixes.
Diagoras Sep 8, 2012
6211225
Efficiency optimizations.
Diagoras Sep 8, 2012
f8032d0
Added code to drop superfluous pearls at the player's feet if their i…
Exultant Sep 9, 2012
bb089f4
Added load/save for MOTD.
Diagoras Sep 9, 2012
bd148b8
Optimized concatenation.
Diagoras Sep 9, 2012
50925d8
Merge remote-tracking branch 'upstream/master'
Diagoras Sep 9, 2012
4bdb3bc
Critical fixes.
Diagoras Sep 9, 2012
a1d4081
Rest of the critical fixes.
Diagoras Sep 9, 2012
6b55b93
Merge pull request #3 from Diagoras/master
Diagoras Sep 9, 2012
3737721
removed pointless debug statement.
Exultant Sep 12, 2012
113a87e
Merge branch 'master' of https://github.com/Exultant/PrisonPearl
Exultant Sep 12, 2012
de0983f
Maven POM file for PrisonPearl
Oct 13, 2012
9e9e3c9
added Physical Shop to Maven dependencies
Oct 13, 2012
30ffca2
add CombatTag to Maven dependencies
Oct 13, 2012
c49ce17
Merge pull request #4 from theliet/master
Exultant Oct 18, 2012
bb02f8d
Prevent summoning or returning CombatTagged players.
Exultant Dec 10, 2012
c9290ee
Update dependencies.
Exultant Dec 10, 2012
ec6e19c
If pearl stealing in the prison world is disabled, location of the pe…
Exultant Dec 10, 2012
333d236
Drop pearls that would otherwise be deleted.
Exultant Dec 10, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="lib" path="bukkit.jar">
<attributes>
<attribute name="javadoc_location" value="http://jd.bukkit.org/apidocs/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="PhysicalShop.jar"/>
<classpathentry kind="lib" path="craftbukkit.jar"/>
<classpathentry kind="lib" path="CombatTag.jar"/>
<classpathentry kind="lib" path="craftbukkit-1.4.5-R0.3-SNAPSHOT.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
bukkit.jar
PhysicalShop.jar
craftbukkit.jar
*.class
bukkit.jar
PhysicalShop.jar
craftbukkit.jar
*.class
.idea
/craftbukkit-1.4.5-R0.3-SNAPSHOT.jar
/CombatTag.jar
209 changes: 118 additions & 91 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,119 @@
name: PrisonPearl
main: com.untamedears.PrisonPearl.PrisonPearlPlugin
version: 1.3
soft-depend: [PhysicalShop]

commands:
pplocate:
description: Locates your prison pearl
usage: /<command>
aliases: ppl

pplocateany:
description: Locates any prison pearl in the world
usage: /<command> player
permission: prisonpearl.locateany

ppfree:
description: Frees a prison pearl
usage: /<command> [player]
aliases: ppf

ppfreeany:
description: Frees any prison pearl in the world
usage: /<command> player
permission: prisonpearl.freeany

ppsummon:
description: Summons a player from their prison pearl, requiring them to stay within range of their pearl
usage: /ppsummon [player] [range]
aliases: pps

ppreturn:
description: Returns a summoned player back to their prison pearl
usage: /ppbanish [player]
aliases: ppr

ppkill:
description: Instantly kills a summoned player, sending them back to their prison pearl
usage: /ppkill [player]
aliases: ppk

ppsave:
description: Saves all prisonpearl related data to disk
usage: /ppsave
permission: prisonpearl.save

ppimprisonany:
description: Imprisons any player in the world
usage: /ppimprisonany player
permission: prisonpearl.imprisonany

ppbroadcast:
description: Broadcast your pplocate commands to another player
usage: /ppbroadcast player
alias: ppb

ppconfirm:
description: Confirm reception of pplocate commands from a player
usage: /ppconfirm [player]

ppsilence:
description: Silence reception of pplocate commands from player
usage: /ppsilence player

ppinfo:
description: Get information about player in a pearl
usage: /ppinfo [player]
alias: ppi

permissions:
prisonpearl.*:
description: Gives full access to PrisonPearl commands
default: op
children:
prisonpearl.locateany: true
prisonpearl.freeany: true
prisonpearl.imprisonany: true
prisonpearl.save: true

prisonpearl.locateany:
description: Allows user to use pplocateany to locate prison pearls other than his own

prisonpearl.freeany:
description: Allows user to use ppfreeany to free prison pearls he does not possess

prisonpearl.imprisonany:
description: Allows user to use ppimprisonany to imprison any player at will

prisonpearl.save:
description: Allows user to use ppsave command

name: PrisonPearl
main: com.untamedears.PrisonPearl.PrisonPearlPlugin
version: 1.5.1
soft-depend: [PhysicalShop, CombatTag]

commands:
pplocate:
description: Locates your prison pearl
usage: /<command>
aliases: ppl

pplocateany:
description: Locates any prison pearl in the world
usage: /<command> player
permission: prisonpearl.locateany

ppfree:
description: Frees a prison pearl
usage: /<command> [player]
aliases: ppf

ppfreeany:
description: Frees any prison pearl in the world
usage: /<command> player
permission: prisonpearl.freeany

ppsummon:
description: Summons a player from their prison pearl, requiring them to stay within range of their pearl
usage: /ppsummon [player] [range]
aliases: pps

ppreturn:
description: Returns a summoned player back to their prison pearl
usage: /ppbanish [player]
aliases: ppr

ppkill:
description: Instantly kills a summoned player, sending them back to their prison pearl
usage: /ppkill [player]
aliases: ppk

ppsave:
description: Saves all prisonpearl related data to disk
usage: /ppsave
permission: prisonpearl.save

ppimprisonany:
description: Imprisons any player in the world
usage: /ppimprisonany player
permission: prisonpearl.imprisonany

ppbroadcast:
description: Broadcast your pplocate commands to another player
usage: /ppbroadcast player
alias: ppb

ppconfirm:
description: Confirm reception of pplocate commands from a player
usage: /ppconfirm [player]

ppsilence:
description: Silence reception of pplocate commands from player
usage: /ppsilence player

ppinfo:
description: Get information about player in a pearl
usage: /ppinfo [player]
alias: ppi
pploadalts:
description: reload alt lists from file
usage: /pploadalts
ppcheckall:
description: checkban all accounts
usage: /ppcheckall
ppcheck:
description: checkban the player
usage: /ppcheck [player]

ppsetdist:
description: Sets distance prisoner can move.

ppsetdamage:
description: Sets damage prisoner receives.

pptogglespeech:
description: Toggles whether prisoner can talk in public chat.

pptoggledamage:
description: Toggles whether prisoner can damage players and mobs.

pptoggleblocks:
description: Toggles whether prisoner can break blocks.

ppsetmotd:
description: Sets prisoner's MOTD.

permissions:
prisonpearl.*:
description: Gives full access to PrisonPearl commands
default: op
children:
prisonpearl.locateany: true
prisonpearl.freeany: true
prisonpearl.imprisonany: true
prisonpearl.save: true

prisonpearl.locateany:
description: Allows user to use pplocateany to locate prison pearls other than his own

prisonpearl.freeany:
description: Allows user to use ppfreeany to free prison pearls he does not possess

prisonpearl.imprisonany:
description: Allows user to use ppimprisonany to imprison any player at will

prisonpearl.save:
description: Allows user to use ppsave command


63 changes: 63 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.untamedears.PrisonPearl</groupId>
<artifactId>prisonpearl</artifactId>
<version>1.5-SNAPSHOT</version>
<packaging>jar</packaging>

<name>PrisonPearl</name>
<description>Bukkit Server Plugin</description>
<inceptionYear>2012</inceptionYear>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>

<properties>
<project.build.sourceEncoding>CP1252</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.4.5 R0.3 SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.wolvereness.physicalshop</groupId>
<artifactId>PhysicalShop</artifactId>
<version>9.2.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/lib/PhysicalShop.jar</systemPath>
</dependency>
<dependency>
<groupId>com.trc202.CombatTag</groupId>
<artifactId>CombatTag</artifactId>
<version>5.0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/lib/CombatTag.jar</systemPath>
</dependency>
</dependencies>

<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
</repositories>


</project>
67 changes: 67 additions & 0 deletions src/com/untamedears/PrisonPearl/AltsList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package com.untamedears.PrisonPearl;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Set;

import org.bukkit.Bukkit;

class AltsList {
private HashMap<String, String[]> altsHash;
private boolean initialised = false;

public AltsList() {
}

public void load(File file) {
try {
loadAlts(file);
initialised = true;
} catch (IOException e) {
e.printStackTrace();
Bukkit.getLogger().info("Failed to load file!");
initialised = false;
}
}

private void loadAlts(File file) throws IOException {
altsHash = new HashMap<String, String[]>();
FileInputStream fis;
fis = new FileInputStream(file);
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String line;
while ((line = br.readLine()) != null) {
if (line.length() > 1) {
String parts[] = line.split(" ");
String[] newString = new String[parts.length];
System.arraycopy(parts, 0, newString, 0, parts.length);
for (String part : parts) {
altsHash.put(part, newString);
}
}
}
}

public String[] getAltsArray(String name){
if (initialised && altsHash.containsKey(name)) {
String[] names = altsHash.get(name);
String[] alts = new String[names.length-1];
for (int i = 0, j = 0; i < names.length; i++) {
if (!names[i].equals(name)) {
alts[j] = names[i];
j++;
}
}
return alts;
}
return new String[0];
}

public Set<String> getAllNames() {
return altsHash.keySet();
}
}
Loading