Skip to content

Commit

Permalink
Fix Critical JSON MySQL Database List load issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberpwnn committed Aug 9, 2016
1 parent 56e8c32 commit 25b0844
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cyberpwn</groupId>
<artifactId>phantom</artifactId>
<version>6</version>
<version>6.1</version>
<name>Phantom</name>
<description>Phantom - Another Damn API</description>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,4 @@ public String getCodeName()
{
return "mysql";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,14 @@ public static MySQL fromMysql(Configurable c, MySQL db) throws SQLException, Cla
resx.next();
JSONObject jso = new JSONObject(resx.getString("d"));
c.getConfiguration().addJson(jso);
toFields(c);
c.onReadConfig();
resx.close();
stx.close();
}

res.close();
st.close();
toFields(c);
c.onReadConfig();

return db;
}
Expand All @@ -430,6 +430,7 @@ public static MySQL fromMysql(Configurable c, MySQL db) throws SQLException, Cla
*/
public static MySQL toMysql(Configurable c, MySQL db) throws SQLException, ClassNotFoundException
{
fromFields(c);
Connection conn = null;

if(!db.checkConnection())
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/org/cyberpwn/phantom/clust/DataCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,18 @@ else if(o instanceof List)

set(key, l);
}

else if(o instanceof JSONArray)
{
List<String> l = new ArrayList<String>();

for(Object i : ((JSONArray)o))
{
l.add(i.toString());
}

set(key, l);
}
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Phantom
version: 6
version: 6.1
main: org.cyberpwn.phantom.Phantom
description: Phantom - Another Damn API
author: cyberpwn
authors: [cyberpwn]
depend: [ProtocolLib]
website: http://cyberpwn.org/docs/phantom/
commands:
phantom:
Expand Down

0 comments on commit 25b0844

Please sign in to comment.