Merge branch 'master' of ssh://dev.mineplex.com:7999/min/mineplex

This commit is contained in:
Chiss 2013-10-26 11:35:02 +11:00
commit 8958b8998f
4 changed files with 74 additions and 2 deletions

Binary file not shown.

View File

@ -0,0 +1,43 @@
package mineplex.bungee.globalServer;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public abstract class Packet
{
public abstract void parseStream(DataInputStream inputStream) throws IOException;
public abstract void write(DataOutputStream dataOutput) throws IOException;
protected String readString(DataInputStream dataInputStream, int maxLength) throws IOException
{
short length = dataInputStream.readShort();
if (length > maxLength)
{
throw new IOException("Received string length longer than maximum allowed (" + length + " > " + maxLength + ")");
}
else if (length < 0)
{
throw new IOException("Received string length is less than zero! Weird string!");
}
else
{
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < length; i++)
{
stringBuilder.append(dataInputStream.readChar());
}
return stringBuilder.toString();
}
}
protected void writeString(String string, DataOutputStream dataOutputStream) throws IOException
{
dataOutputStream.writeShort(string.length());
dataOutputStream.writeChars(string);
}
}

View File

@ -1,14 +1,16 @@
package mineplex.core.account.repository;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.mysql.RepositoryBase;
public class MysqlAccountRepository extends RepositoryBase
{
private static String CREATE_ACCOUNT_TABLE = "CREATE TABLE IF NOT EXISTS Accounts (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(40), gems INT, rank VARCHAR(40), rankPerm BOOL, rankExpire LONG, lastLogin LONG, totalPlayTime LONG, PRIMARY KEY (id));";
public MysqlAccountRepository(String connectionUrl, String username, String password)
public MysqlAccountRepository(JavaPlugin plugin)
{
super(connectionUrl, username, password);
super(plugin);
}
/*

View File

@ -0,0 +1,27 @@
package mineplex.core.disguise.disguises;
public class DisguiseWitch extends DisguiseMonster
{
public DisguiseWitch(org.bukkit.entity.Entity entity)
{
super(entity);
DataWatcher.a(21, Byte.valueOf((byte)0));
}
@Override
protected int GetEntityTypeId()
{
return 66;
}
public void a(boolean flag)
{
DataWatcher.watch(21, Byte.valueOf((byte)(flag ? 1 : 0)));
}
public boolean bT()
{
return DataWatcher.getByte(21) == 1;
}
}