so im trying to run some games localy and the eroor im getting is explained on the website but my algos run fine on the website and i double checked and i dont use print.
here is the error:
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 0 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[0,98,-1],“p1Stats”:[30.0,530.0,55.7,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,530.0,55.7,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputDeploy(Parser.java:239)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:324)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 1 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[0,98,-1],“p1Stats”:[30.0,530.0,55.7,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,530.0,55.7,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputDeploy(Parser.java:239)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:324)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 0 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[1,98,0],“p1Stats”:[30.0,530.0,55.7,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,530.0,55.7,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputBuild(Parser.java:115)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:318)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 1 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[1,98,0],“p1Stats”:[30.0,530.0,55.7,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,530.0,55.7,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputBuild(Parser.java:115)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:318)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 0 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[0,99,-1],“p1Stats”:[30.0,535.0,55.8,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,535.0,55.8,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputDeploy(Parser.java:239)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:324)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 1 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[0,99,-1],“p1Stats”:[30.0,535.0,55.8,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,535.0,55.8,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputDeploy(Parser.java:239)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:324)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Winner (p1 perspective, 1 = p1 2 = p2): 1
Waiting to exit finished game.
sent game end playerIndex: 0
sent game end playerIndex: 1
sent game end playerIndex: 0
sent game end playerIndex: 1
Done waiting now exiting finished game.
Hard Exiting Now
Closing stream
Closing playerIndex: 0
Closing stream
Closing playerIndex: 1
Exited for loop
End of main
Closing stream
Closing stream
if anyone can help would be very usefull