i am trying to send an array of integers to the server.
On the client side i have done it like this:
Code: Select all
var myarr = {positions:this.pos_arr};
this.sfs.addEventListener(SFS2X.SFSEvent.EXTENSION_RESPONSE, this.new_positions,this);
this.sfs.send(new SFS2X.Requests.System.ExtensionRequest(DICE_GAME.GAME_COMMANDS.GAME_START,myarr));
The compiler shows the OUTGOING DATA:
Code: Select all
[INFO] OUTGOING DATA
p: [Object]
p: [Object]
positions: [Array]
19: 1216 (Num)
18: 1152 (Num)
17: 1088 (Num)
16: 1024 (Num)
15: 960 (Num)
14: 896 (Num)
13: 832 (Num)
12: 768 (Num)
11: 704 (Num)
10: 640 (Num)
9: 576 (Num)
8: 512 (Num)
7: 448 (Num)
6: 384 (Num)
5: 320 (Num)
4: 256 (Num)
3: 192 (Num)
2: 128 (Num)
1: 64 (Num)
0: 0 (Num)
r: -1 (Num)
c: 0 (Str)
c: 1 (Num)
a: 13 (Num)
But on the server I am not able to get this integers into a Collection of Integers.
On the server the code looks like this:
Code: Select all
public class StartGame extends BaseClientRequestHandler {
@Override
public void handleClientRequest(User player, ISFSObject params) {
// TODO Auto-generated method stub
try {
ServerGameExtension ext = (ServerGameExtension) getParentExtension();
ext.getGame(player,params);
Collection<Integer> myarr = params.getIntArray("myarr");
The variable myarr is null.
Do you have any ideea how to get that integers?
Thank you in advance for your help.