String[] cbss = new String[]{};
try {
cbss = cbsIDsString.split(",");
} catch (NullPointerException e) {
//no battleStations on this map}
}
short[] cbsIDs = new short[cbss.length];
for (short i = 0; i < cbss.length; i++) {
cbsIDs[i] = Short.valueOf(cbss[i]);
}
Exception in thread "main" java.lang.NumberFormatException: For input string: "["mapId":0" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Short.parseShort(Short.java:118) at java.lang.Short.valueOf(Short.java:174) at java.lang.Short.valueOf(Short.java:200) at mysql.QueryManager.loadMaps(QueryManager.java:56) at main.ServerManager.loadDataFromDB(ServerManager.java:94) at main.ServerManager.begin(ServerManager.java:63) at main.Launcher.main(Launcher.java:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
:facepalm: for you: [Only registered and activated users can see links. Click Here To Register...]Quote:
Hello Epvp user ,
I have a question
How would the Jason string look for ClanBattlestaion ?
I have no idea how that must look like ( attribute , value )
I would appreciate help in the point Thanks in advance
Code:String[] cbss = new String[]{}; try { cbss = cbsIDsString.split(","); } catch (NullPointerException e) { //no battleStations on this map} } short[] cbsIDs = new short[cbss.length]; for (short i = 0; i < cbss.length; i++) { cbsIDs[i] = Short.valueOf(cbss[i]); }
Code:Exception in thread "main" java.lang.NumberFormatException: For input string: "["mapId":0" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Short.parseShort(Short.java:118) at java.lang.Short.valueOf(Short.java:174) at java.lang.Short.valueOf(Short.java:200) at mysql.QueryManager.loadMaps(QueryManager.java:56) at main.ServerManager.loadDataFromDB(ServerManager.java:94) at main.ServerManager.begin(ServerManager.java:63) at main.Launcher.main(Launcher.java:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)