Well I kinda understand how things work... the thing is this
I have some client code:
peer = enet_host_connect (client, & address, 2, 0);
name = player.getname(); //this returns a string from inside a class member
peer->data = (void*)name.c_str(); I am making the peer data the name of the
player
On the server end:
ENetPeer *peer2[2];
while (enet_host_service (server, & event, 100) > 0)
{ switch (event.type)
{
case ENET_EVENT_TYPE_CONNECT:
peer2[1] = event.peer;
textprintf_ex(screen, font, 10, 200, white,-1,"%s is client
!",peer2[1]->data); this is allegro, it just outputs the %s is client on
screen
name=(char*)peer->data;
....
The problem is that this crashes when it tries to output the peer2[1]->data .
When debugging I checked to see if the peer2[1].data changes to whatever the
client has set it but its just 0x000000 .
So my question... shouldn't event.peer have the data that the client has set ?
_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss