=Finished Character Database
TODO: Make the output... prettier
This commit is contained in:
@@ -14,5 +14,6 @@
|
|||||||
<classpathentry kind="lib" path="lib/twitter4j-core-4.0.7-javadoc.jar"/>
|
<classpathentry kind="lib" path="lib/twitter4j-core-4.0.7-javadoc.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/twitter4j-core-4.0.7.jar"/>
|
<classpathentry kind="lib" path="lib/twitter4j-core-4.0.7.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/luaj-jse-3.0.1.jar"/>
|
<classpathentry kind="lib" path="lib/luaj-jse-3.0.1.jar"/>
|
||||||
|
<classpathentry kind="lib" path="F:/Shared/Coding/Java/workspace/ProKitty/lib/fuzzywuzzy-1.2.0.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ buildhelp=1
|
|||||||
c++, g++, cplus, cpp=1
|
c++, g++, cplus, cpp=1
|
||||||
catch=1
|
catch=1
|
||||||
charactercreate=1
|
charactercreate=1
|
||||||
|
charactereditbio=1
|
||||||
|
charactereditname=1
|
||||||
|
characterediturl=1
|
||||||
choose=1
|
choose=1
|
||||||
crouton=1
|
crouton=1
|
||||||
dbflush=1
|
dbflush=1
|
||||||
@@ -42,6 +45,7 @@ roll=1
|
|||||||
rpend=1
|
rpend=1
|
||||||
rpg=1
|
rpg=1
|
||||||
rpstart=1
|
rpstart=1
|
||||||
|
searchcharacter=1
|
||||||
showpoll=1
|
showpoll=1
|
||||||
shutdown=1
|
shutdown=1
|
||||||
stats=1
|
stats=1
|
||||||
|
|||||||
Binary file not shown.
@@ -7,6 +7,7 @@ benchmark, bench=
|
|||||||
rating=
|
rating=
|
||||||
poll=
|
poll=
|
||||||
rafflespin=
|
rafflespin=
|
||||||
|
charactereditURL=
|
||||||
bet=
|
bet=
|
||||||
guildrolelist=
|
guildrolelist=
|
||||||
stats=
|
stats=
|
||||||
@@ -30,6 +31,7 @@ tony, stark, dontfeelgood, dontfeelsogood=
|
|||||||
role=
|
role=
|
||||||
raffleend=
|
raffleend=
|
||||||
ping=
|
ping=
|
||||||
|
charactereditbio=
|
||||||
roll=
|
roll=
|
||||||
blur=
|
blur=
|
||||||
choose=
|
choose=
|
||||||
@@ -37,6 +39,7 @@ rpstart=
|
|||||||
guildrolenotallowed=
|
guildrolenotallowed=
|
||||||
perish, thenperish=
|
perish, thenperish=
|
||||||
teey=
|
teey=
|
||||||
|
searchcharacter=
|
||||||
dbstats=
|
dbstats=
|
||||||
rafflestart=
|
rafflestart=
|
||||||
beans=
|
beans=
|
||||||
@@ -49,6 +52,7 @@ rpg=
|
|||||||
tweet=
|
tweet=
|
||||||
charactercreate=
|
charactercreate=
|
||||||
help=
|
help=
|
||||||
|
charactereditname=
|
||||||
fetch=
|
fetch=
|
||||||
crouton=
|
crouton=
|
||||||
invite=
|
invite=
|
||||||
|
|||||||
+32
-4
@@ -89,6 +89,13 @@ RaffleEndSuccess=
|
|||||||
RaffleEndInfo=
|
RaffleEndInfo=
|
||||||
RaffleEndFailure=I don't think there's one going!
|
RaffleEndFailure=I don't think there's one going!
|
||||||
|
|
||||||
|
[CommandCharacterSearch]
|
||||||
|
CharacterSearchNoCharacterFound=Couldn't find a character with that name or ID!
|
||||||
|
CharacterSearchMultipleCharacterHeader=I found a couple characters with that name, use `charactersearch UniqueID` with their Unique ID to find them!
|
||||||
|
CharacterSearchMultipleCharacter=%s is owned by %s. Unique ID is `%s`
|
||||||
|
CharacterSearchOneCharacter=I found one character with that name! \n Owner: %s | Name: %s | Bio: %s | Ref: <%s> | Unique ID: `%s`
|
||||||
|
CharacterSearchInfo=Find a character with their name or Unique ID! `charactersearch name` or `charactersearch UniqueID`
|
||||||
|
|
||||||
[CommandDoWork]
|
[CommandDoWork]
|
||||||
DoWorkFinished=I finished with my work! :D
|
DoWorkFinished=I finished with my work! :D
|
||||||
DoWorkInfo=Occupies a core for a few seconds
|
DoWorkInfo=Occupies a core for a few seconds
|
||||||
@@ -123,6 +130,13 @@ PollShowChoices=And the choices are:\n
|
|||||||
[CommandHelpBuilder]
|
[CommandHelpBuilder]
|
||||||
HelpBuilderInfo=Emit help for all commands as formatted HTML
|
HelpBuilderInfo=Emit help for all commands as formatted HTML
|
||||||
|
|
||||||
|
[CommandCharacterEditURL]
|
||||||
|
CharacterEditURLInfo=
|
||||||
|
CharacterEditURLNotValid=
|
||||||
|
CharacterEditURLSuccess=
|
||||||
|
CharacterEditURLNotAuth=
|
||||||
|
CharacterEditURLIDNotValid=
|
||||||
|
|
||||||
[CommandRPG]
|
[CommandRPG]
|
||||||
RPGInfo=Admin+ command only right now - experimental text RPG! Format is !rpg <rpg command>
|
RPGInfo=Admin+ command only right now - experimental text RPG! Format is !rpg <rpg command>
|
||||||
RPGInvalid=Invalid RPG Command!
|
RPGInvalid=Invalid RPG Command!
|
||||||
@@ -175,6 +189,13 @@ RaffleStartInfo=
|
|||||||
HelpInfo=Lets you look up specific commands, or get a link to a list of all commands.
|
HelpInfo=Lets you look up specific commands, or get a link to a list of all commands.
|
||||||
HelpDisplay=You can get help with a specific command by typing `!help command`!\nGeneral Commands: `boop, roll, choose, help, info, vote, results, showpoll, wolfram, cplus, java, beans, role, bet, yeet`
|
HelpDisplay=You can get help with a specific command by typing `!help command`!\nGeneral Commands: `boop, roll, choose, help, info, vote, results, showpoll, wolfram, cplus, java, beans, role, bet, yeet`
|
||||||
|
|
||||||
|
[CommandCharacterEditBio]
|
||||||
|
CharacterEditBioSuccess=
|
||||||
|
CharacterEditBioIDNotValid=
|
||||||
|
CharacterEditBioNotAuth=
|
||||||
|
CharacterEditBioInfo=
|
||||||
|
CharacterEditBioNotValid=
|
||||||
|
|
||||||
[CommandTweet]
|
[CommandTweet]
|
||||||
TweetInfo=Kitty will tweet to her personal twitter account
|
TweetInfo=Kitty will tweet to her personal twitter account
|
||||||
TweetError=Tweet command failed!
|
TweetError=Tweet command failed!
|
||||||
@@ -185,6 +206,13 @@ GuildRoleAddFailure=Failed to add %s to %s
|
|||||||
GuildRoleAddNotAllowed=You are not allowed to add %s!
|
GuildRoleAddNotAllowed=You are not allowed to add %s!
|
||||||
GuildRoleAddInfo=Add a role to yourself!
|
GuildRoleAddInfo=Add a role to yourself!
|
||||||
|
|
||||||
|
[CommandCharacterEditName]
|
||||||
|
CharacterEditNameInfo=
|
||||||
|
CharacterEditNameNotValid=
|
||||||
|
CharacterEditNameIDNotValid=
|
||||||
|
CharacterEditNameSuccess=
|
||||||
|
CharacterEditNameNotAuth=
|
||||||
|
|
||||||
[CommandColiru]
|
[CommandColiru]
|
||||||
ColiruError=Please provide some c++ code to attempt to compile!
|
ColiruError=Please provide some c++ code to attempt to compile!
|
||||||
ColiruInfo=Will try to compile any c++ code you put in! Supports up to C++14 standard, uses g++.
|
ColiruInfo=Will try to compile any c++ code you put in! Supports up to C++14 standard, uses g++.
|
||||||
@@ -199,10 +227,10 @@ YeetInfo=Yeet yourself or yeet a friend with @!
|
|||||||
CroutonInfo=Crouton
|
CroutonInfo=Crouton
|
||||||
|
|
||||||
[CommandCharacterCreate]
|
[CommandCharacterCreate]
|
||||||
CharacterCreateDuplicate=
|
CharacterCreateDuplicate=You can't create a character with the same name!
|
||||||
CharacterCreateInfo=
|
CharacterCreateInfo=Create a character for kitty to hold onto for you! `createcharacter name, shortbio, refURL`
|
||||||
CharacterCreateSuccess=
|
CharacterCreateSuccess=You successfully created a character!
|
||||||
CharacterCreateNullInfo=
|
CharacterCreateNullInfo=There's not enough info!
|
||||||
|
|
||||||
[CommandTeey]
|
[CommandTeey]
|
||||||
TeeyInfo=Teey yourself back into existance, or teey a friend with @!
|
TeeyInfo=Teey yourself back into existance, or teey a friend with @!
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import dataStructures.UserInput;
|
|||||||
|
|
||||||
public class CommandCharacterCreate extends Command
|
public class CommandCharacterCreate extends Command
|
||||||
{
|
{
|
||||||
public CommandCharacterCreate(KittyRole level, KittyRating rating) { super(level, rating); }
|
public CommandCharacterCreate(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String HelpText() { return LocStrings.Stub("CharacterCreateInfo"); }
|
public String HelpText() { return LocStrings.Stub("CharacterCreateInfo"); }
|
||||||
@@ -33,6 +33,5 @@ public CommandCharacterCreate(KittyRole level, KittyRating rating) { super(level
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res.Call(LocStrings.Stub("CharacterCreateDuplicate"));
|
res.Call(LocStrings.Stub("CharacterCreateDuplicate"));
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package commands;
|
||||||
|
|
||||||
|
import core.CharacterManager;
|
||||||
|
import core.Command;
|
||||||
|
import core.LocStrings;
|
||||||
|
import dataStructures.*;
|
||||||
|
|
||||||
|
public class CommandCharacterEditBio extends Command
|
||||||
|
{
|
||||||
|
public CommandCharacterEditBio(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String HelpText() { return LocStrings.Stub("CharacterEditBioInfo"); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Long.parseLong(input.args.split(" ")[0]);
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
res.Call(LocStrings.Stub("CharacterEditBioNotValid"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0);
|
||||||
|
if(character.getOwner().equals(user))
|
||||||
|
{
|
||||||
|
CharacterManager.instance.editBio(character, input.args.substring(input.args.indexOf(' ')));
|
||||||
|
res.Call(LocStrings.Stub("CharacterEditBioSuccess"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res.Call(LocStrings.Stub("CharacterEditBioNotAuth"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package commands;
|
||||||
|
|
||||||
|
import core.CharacterManager;
|
||||||
|
import core.Command;
|
||||||
|
import core.LocStrings;
|
||||||
|
import dataStructures.*;
|
||||||
|
|
||||||
|
public class CommandCharacterEditName extends Command
|
||||||
|
{
|
||||||
|
public CommandCharacterEditName(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String HelpText() { return LocStrings.Stub("CharacterEditNameInfo"); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Long.parseLong(input.args.split(" ")[0]);
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
res.Call(LocStrings.Stub("CharacterEditNameNotValid"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0);
|
||||||
|
if(character.getOwner().equals(user))
|
||||||
|
{
|
||||||
|
CharacterManager.instance.editName(character, input.args.substring(input.args.indexOf(' ')));
|
||||||
|
res.Call(LocStrings.Stub("CharacterEditNameSuccess"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res.Call(LocStrings.Stub("CharacterEditNameNotAuth"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package commands;
|
||||||
|
|
||||||
|
import core.CharacterManager;
|
||||||
|
import core.Command;
|
||||||
|
import core.LocStrings;
|
||||||
|
import dataStructures.*;
|
||||||
|
|
||||||
|
public class CommandCharacterEditURL extends Command
|
||||||
|
{
|
||||||
|
public CommandCharacterEditURL(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String HelpText() { return LocStrings.Stub("CharacterEditURLInfo"); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Long.parseLong(input.args.split(" ")[0]);
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
res.Call(LocStrings.Stub("CharacterEditURLNotValid"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0);
|
||||||
|
if(character.getOwner().equals(user))
|
||||||
|
{
|
||||||
|
CharacterManager.instance.editRefImage(character, input.args.substring(input.args.indexOf(' ')));
|
||||||
|
res.Call(LocStrings.Stub("CharacterEditURLSuccess"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res.Call(LocStrings.Stub("CharacterEditURLNotAuth"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package commands;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import core.CharacterManager;
|
||||||
|
import core.Command;
|
||||||
|
import core.LocStrings;
|
||||||
|
import dataStructures.*;
|
||||||
|
|
||||||
|
public class CommandCharacterSearch extends Command
|
||||||
|
{
|
||||||
|
public CommandCharacterSearch(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String HelpText() { return LocStrings.Stub("CharacterSearchInfo"); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
|
{
|
||||||
|
ArrayList <KittyCharacter> characters = CharacterManager.instance.searchCharacter(input.args);
|
||||||
|
if(characters.size() < 1)
|
||||||
|
{
|
||||||
|
res.Call(LocStrings.Stub("CharacterSearchNoCharacterFound"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(characters.size() > 1)
|
||||||
|
{
|
||||||
|
res.Call(LocStrings.Stub("CharacterSearchMultipleCharacterHeader"));
|
||||||
|
for(KittyCharacter character:characters)
|
||||||
|
{
|
||||||
|
res.Call(String.format(LocStrings.Stub("CharacterSearchMultipleCharacter"), character.getName(), character.getOwner().name, character.getUID()));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res.Call(String.format(LocStrings.Stub("CharacterSearchOneCharacter"), characters.get(0).getOwner().name, characters.get(0).getName(), characters.get(0).getBio(), characters.get(0).getRefImage(), characters.get(0).getUID()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,19 @@
|
|||||||
package core;
|
package core;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import dataStructures.KittyCharacter;
|
import dataStructures.KittyCharacter;
|
||||||
|
import dataStructures.KittyTrackedLong;
|
||||||
import dataStructures.KittyUser;
|
import dataStructures.KittyUser;
|
||||||
|
import me.xdrop.fuzzywuzzy.FuzzySearch;
|
||||||
import utils.GlobalLog;
|
import utils.GlobalLog;
|
||||||
import utils.LogFilter;
|
import utils.LogFilter;
|
||||||
|
|
||||||
public class CharacterManager
|
public class CharacterManager
|
||||||
{
|
{
|
||||||
public static CharacterManager instance;
|
public static CharacterManager instance;
|
||||||
|
KittyTrackedLong uniqueID = new KittyTrackedLong("CharacterIDCounter", "");
|
||||||
|
|
||||||
private Vector <KittyCharacter> characters = new Vector<KittyCharacter>();
|
private Vector <KittyCharacter> characters = new Vector<KittyCharacter>();
|
||||||
public CharacterManager()
|
public CharacterManager()
|
||||||
@@ -25,6 +29,33 @@ public class CharacterManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<KittyCharacter> searchCharacter(String query)
|
||||||
|
{
|
||||||
|
ArrayList<KittyCharacter> chars = new ArrayList<KittyCharacter>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
long UID = Long.parseLong(query);
|
||||||
|
for(KittyCharacter character:characters)
|
||||||
|
{
|
||||||
|
if(character.getUID() == UID)
|
||||||
|
{
|
||||||
|
chars.add(character);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch(Exception e)
|
||||||
|
{
|
||||||
|
for(KittyCharacter character:characters)
|
||||||
|
{
|
||||||
|
if(FuzzySearch.ratio(query.toLowerCase(), character.getName().toLowerCase()) > 60)
|
||||||
|
{
|
||||||
|
chars.add(character);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return chars;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean addCharacter(KittyUser user, String name, String bio, String refImage)
|
public boolean addCharacter(KittyUser user, String name, String bio, String refImage)
|
||||||
{
|
{
|
||||||
for(KittyCharacter character:characters)
|
for(KittyCharacter character:characters)
|
||||||
@@ -35,45 +66,29 @@ public class CharacterManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
characters.add(new KittyCharacter(user, name, bio, refImage));
|
characters.add(new KittyCharacter(user, name, bio, refImage, uniqueID.Get()));
|
||||||
|
uniqueID.Add(1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean removeCharacter(KittyUser user, String name)
|
public void removeCharacter(KittyCharacter character, String name)
|
||||||
{
|
{
|
||||||
for(KittyCharacter character:characters)
|
characters.remove(character);
|
||||||
{
|
|
||||||
if(character.getName().equals(name) && character.getOwner().discordID.equals(user.discordID))
|
|
||||||
{
|
|
||||||
characters.remove(character);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean editRefImage(KittyUser user, String name, String refImage)
|
public void editRefImage(KittyCharacter character, String refImage)
|
||||||
{
|
{
|
||||||
for(KittyCharacter character:characters)
|
character.editRefImage(refImage);
|
||||||
{
|
|
||||||
if(character.getName().equals(name) && character.getOwner().discordID.equals(user.discordID))
|
|
||||||
{
|
|
||||||
return character.editRefImage(user, refImage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean editBio(KittyUser user, String name, String bio)
|
public void editBio(KittyCharacter character, String bio)
|
||||||
{
|
{
|
||||||
for(KittyCharacter character:characters)
|
character.editBio(bio);
|
||||||
{
|
}
|
||||||
if(character.getName().equals(name) && character.getOwner().discordID.equals(user.discordID))
|
|
||||||
{
|
public void editName(KittyCharacter character, String name)
|
||||||
return character.editBio(user, bio);
|
{
|
||||||
}
|
character.editName(name);
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -424,6 +424,10 @@ public class ObjectBuilderFactory
|
|||||||
manager.Register(LocCommands.Stub("benchmark, bench"), new CommandBenchmark(KittyRole.General, KittyRating.Safe));
|
manager.Register(LocCommands.Stub("benchmark, bench"), new CommandBenchmark(KittyRole.General, KittyRating.Safe));
|
||||||
manager.Register(LocCommands.Stub("rafflejoin"), new CommandRaffleJoin(KittyRole.General, KittyRating.Safe));
|
manager.Register(LocCommands.Stub("rafflejoin"), new CommandRaffleJoin(KittyRole.General, KittyRating.Safe));
|
||||||
manager.Register(LocCommands.Stub("charactercreate"), new CommandCharacterCreate(KittyRole.General, KittyRating.Safe));
|
manager.Register(LocCommands.Stub("charactercreate"), new CommandCharacterCreate(KittyRole.General, KittyRating.Safe));
|
||||||
|
manager.Register(LocCommands.Stub("searchcharacter"), new CommandCharacterSearch(KittyRole.General, KittyRating.Safe));
|
||||||
|
manager.Register(LocCommands.Stub("charactereditbio"), new CommandCharacterEditBio(KittyRole.General, KittyRating.Safe));
|
||||||
|
manager.Register(LocCommands.Stub("charactereditname"), new CommandCharacterEditName(KittyRole.General, KittyRating.Safe));
|
||||||
|
manager.Register(LocCommands.Stub("charactereditURL"), new CommandCharacterEditURL(KittyRole.General, KittyRating.Safe));
|
||||||
manager.Register(LocCommands.Stub("leaderboard"), new CommandLeaderboard(KittyRole.General, KittyRating.Safe));
|
manager.Register(LocCommands.Stub("leaderboard"), new CommandLeaderboard(KittyRole.General, KittyRating.Safe));
|
||||||
|
|
||||||
return manager;
|
return manager;
|
||||||
|
|||||||
@@ -6,43 +6,30 @@ public class KittyCharacter
|
|||||||
private String name;
|
private String name;
|
||||||
private String bio;
|
private String bio;
|
||||||
private String refImage;
|
private String refImage;
|
||||||
|
private long uniqueID;
|
||||||
|
|
||||||
public KittyCharacter(KittyUser owner, String name, String bio, String refImage)
|
public KittyCharacter(KittyUser owner, String name, String bio, String refImage, long uniqueID)
|
||||||
{
|
{
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.bio = bio;
|
this.bio = bio;
|
||||||
this.refImage = refImage;
|
this.refImage = refImage;
|
||||||
|
this.uniqueID = uniqueID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void editBio(String bio)
|
||||||
private boolean allowedToEdit(KittyUser editor)
|
|
||||||
{
|
{
|
||||||
if(editor.identifier.equals(owner.identifier))
|
this.bio = bio;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean editBio(KittyUser editor, String bio)
|
public void editRefImage(String refImage)
|
||||||
{
|
{
|
||||||
if(allowedToEdit(editor))
|
this.refImage = refImage;
|
||||||
{
|
|
||||||
this.bio = bio;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean editRefImage(KittyUser editor, String refImage)
|
public void editName(String name)
|
||||||
{
|
{
|
||||||
if(allowedToEdit(editor))
|
this.name = name;
|
||||||
{
|
|
||||||
this.refImage = refImage;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public KittyUser getOwner()
|
public KittyUser getOwner()
|
||||||
@@ -65,6 +52,11 @@ public class KittyCharacter
|
|||||||
return refImage;
|
return refImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getUID()
|
||||||
|
{
|
||||||
|
return uniqueID;
|
||||||
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return name + " " + bio + " " + refImage;
|
return name + " " + bio + " " + refImage;
|
||||||
|
|||||||
Reference in New Issue
Block a user