Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (kzhao, AndrewAMD, bigsmack, 7th_zorro), 869 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
dplay_id not always set #315275
03/14/10 13:44
03/14/10 13:44
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline OP
Serious User
MrGuest  Offline OP
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
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

Re: dplay_id not always set [Re: MrGuest] #316198
03/22/10 10:34
03/22/10 10:34
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I can not confirm this problem. When do you get a dplay_id of 0?

Re: dplay_id not always set [Re: jcl] #316886
03/27/10 14:42
03/27/10 14:42
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline OP
Serious User
MrGuest  Offline OP
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
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

Re: dplay_id not always set [Re: MrGuest] #317113
03/29/10 11:16
03/29/10 11:16
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
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.

Re: dplay_id not always set [Re: jcl] #317262
03/30/10 11:53
03/30/10 11:53
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline OP
Serious User
MrGuest  Offline OP
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
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.

Re: dplay_id not always set [Re: MrGuest] #317421
03/31/10 15:35
03/31/10 15:35
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
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?


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1