dplay_id not always set

Posted By: MrGuest

dplay_id not always set - 03/14/10 13:44

Hey,

I'm having some trouble with sending and receiving data, and finally narrowed it down to the some of the clients dplay_id not being set and read as 0.

When sending data from this client, the server reads the dplay_id as the unique id it should have, but when returning any data through this id the data is lost.

I currently have no entities in the level, and using dplay_unreliable set to -1, and can't find a way around this problem, so thinking it must be a bug.

Many thanks
MrGuest
Posted By: jcl

Re: dplay_id not always set - 03/22/10 10:34

I can not confirm this problem. When do you get a dplay_id of 0?
Posted By: MrGuest

Re: dplay_id not always set - 03/27/10 14:42

When starting as a host and client on the same machine, or different machines across a LAN.

I've got it so the server stores the id from the client join from the on_server event EVENT_JOIN, which is always a unique ID, and any event thereafter from the client will have the same ID, but when displaying the dplay_id on that client, it's still displayed as 0.

This only happens about 5% of the time, and I can't find any way to increase the probability of it happening
Posted By: jcl

Re: dplay_id not always set - 03/29/10 11:16

The dplay_id on a server is always 0. On a client it's set when it joined. Afterwards it is not changed anymore, so the engine itself can not set it to 0. Maybe it's some function in your script? You could determine that when you check dplay_id every frame, and post a message when it becomes 0.
Posted By: MrGuest

Re: dplay_id not always set - 03/30/10 11:53

If I use
Code:
void dplay_check(var id){
  while(!dplay_id) { wait(1); }
  beep();
  while(!id){ wait(1); }
  beep();
}

void client_event(void* str, var id){
  switch(EVENT_TYPE){
    case EVENT_JOIN:

       dplay_check(id);
    break;
  }
}


There are times when the client doesn't get its dplay_id set, this can happen with only 1 client connected to the host.

There are no problems with my script setting dplay_id anywhere as it's a read-only variable.
Posted By: jcl

Re: dplay_id not always set - 03/31/10 15:35

No, I can not confirm this with our test program, and we can connect a huge number of clients. If dplay_id weren't set, a client could not do anything, it could not create entities and you would see lots of error messages. This obviously does not happen.

Just begin with the tutorial. Do you have then a problem too, or only with your project?
© 2024 lite-C Forums