Auth Object
This commit is contained in:
parent
68dd59b519
commit
a6a2d77c4e
10
src/main/java/cf/semikolon/teamspeak/Messages.java
Normal file
10
src/main/java/cf/semikolon/teamspeak/Messages.java
Normal file
@ -0,0 +1,10 @@
|
||||
package cf.semikolon.teamspeak;
|
||||
|
||||
public class Messages
|
||||
{
|
||||
|
||||
public final static String PREFIX = "§9[TeamSpeakAuth]";
|
||||
|
||||
public final static String YOUR_VERIFY_CODE ="§7Dein Verifizierungscode: %s";
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package cf.semikolon.teamspeak.commands;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class VerifyCommand implements CommandExecutor
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
|
||||
{
|
||||
if(sender instanceof Player) {
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package cf.semikolon.teamspeak.objects;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Authentication
|
||||
{
|
||||
|
||||
private static ArrayList<Authentication> list = new ArrayList<>();
|
||||
|
||||
private UUID uuid;
|
||||
private String authKey;
|
||||
|
||||
public Authentication(UUID uuid, String authKey)
|
||||
{
|
||||
this.uuid = uuid;
|
||||
this.authKey = authKey;
|
||||
this.list.add(this);
|
||||
}
|
||||
|
||||
public UUID getUUID()
|
||||
{
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public String getUUIDString()
|
||||
{
|
||||
return uuid.toString();
|
||||
}
|
||||
|
||||
public String getAuthKey()
|
||||
{
|
||||
return authKey;
|
||||
}
|
||||
|
||||
public boolean authenticate(String authKey) {
|
||||
if(this.authKey.equals(authKey)) {
|
||||
this.list.remove(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Authentication getAuthenticationbyUUID(UUID uuid) {
|
||||
for (Authentication authentication : list)
|
||||
{
|
||||
if(authentication.getUUID().equals(uuid)) {
|
||||
return authentication;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Authentication getAuthenticationbyUUID(String uuid) {
|
||||
for (Authentication authentication : list)
|
||||
{
|
||||
if(authentication.getUUID().toString().equals(uuid)) {
|
||||
return authentication;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user