Code:
PLAYERS* players[100];
...
players[0]=new(PLAYERS);
players[0].id = id;
players[0].sampla= sample;
...
send_data_to(NULL,players,sizeof(PLAYERS));



this way I did up there, it works, but I have no way of knowing what kind of data is being sent.
no have "_type" variable for *void in on receive.

So I need to send a simple struct containing an struct array within another struct

Sample:
Code:
typedef struct _PLAYERS
{

var id;
var sample;
...

}PLAYERS

typedef struct _clients
{

int _type;
struct _PLAYERS client[100]

}clients

...
send data
...

clients* players=new(clients);

players._type = PLAYERS_LIST;
players->client[0]=new(PLAYERS);
players->client[0].id = id;
players->client[0].id = id;

players->client[1]=new(PLAYERS);
players->client[1].id = id;
players->client[1].id = id;
...etc

send_data_to(NULL,players,sizeof(clients));



Its no work (T.T)


Last edited by NeoNeper; 01/07/13 16:12.

Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________