= Adjusted user parsing, requiring proper formatting now.
This commit is contained in:
@@ -70,18 +70,19 @@ public class KittyUser extends DatabaseTrackedObject
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
String[] strings = string.split(",");
|
String[] strings = string.split(",");
|
||||||
beans = Integer.parseInt(strings[0]);
|
if(strings.length < 2)
|
||||||
if(strings.length > 1)
|
|
||||||
{
|
|
||||||
role = KittyRole.valueOf(Integer.parseInt(strings[1])).get();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
GlobalLog.Log(LogFilter.Database, "Upgrading user " + name + " to include 'role' in DB");
|
GlobalLog.Log(LogFilter.Database, "Upgrading user " + name + " to include 'role' in DB");
|
||||||
|
|
||||||
// Mark ourselves dirty to re-write the role information stored in the user.
|
// Mark ourselves dirty to re-write the role information stored in the user.
|
||||||
// Just uses defaults from earlier again.
|
// Just uses defaults from earlier again.
|
||||||
MarkDirty();
|
MarkDirty();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
beans = Integer.parseInt(strings[0]);
|
||||||
|
role = KittyRole.valueOf(Integer.parseInt(strings[1])).get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e)
|
catch (NumberFormatException e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user