Network target

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by merendo.

Hello guys and girls;

I have a problem and I´m hoping you can help me. How can I define f.e.
SendNetworkString(ClientID, String$)
that on the serverside I may send the string$ to all users. And on the Clientside, how to send the string$ to only one user???

Sorry for my bad english. Please correct me if something was wrong.

Thank you, merendo

We always need to hear both sides of the story (by Phil Collins)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

You have to do it in a loop.
You must know which users are connected to you server. (Place these information in a liked list or an array) After that do a SendNetworkString to every ones who are connected to the server.
Doing network stuff is a little bit problematic in PB atm.
Anyway, I encountered some problems using the SendNetworkString and ReceiveNetworkString but I cound not figure it out. It has something to do with the statusbar text. I used the send_ API command instead to send Strings and Datas through the web.
To keep my User-List on the server side up to date I wrote a little procedure that Pings the client after a while of idle to see if the client is still available. Didnt the server got a respone in the next X Time, the user will be disconnected from the serverside and the UserSlot is beeing freed for other connections.

Hope that helpes. If you need help, you can write me a, of course german, mail to: [url]mailto:tranquilizer@secretly.de[/url]

See you

Tranquilizer/ Secretly!
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

You have to do it in a loop.
You must know which users are connected to you server. (Place these information in a liked list or an array) After that do a SendNetworkString to every ones who are connected to the server.
Doing network stuff is a little bit problematic in PB atm.
Anyway, I encountered some problems using the SendNetworkString and ReceiveNetworkString but I cound not figure it out. It has something to do with the statusbar text. I used the send_ API command instead to send Strings and Datas through the web.
To keep my User-List on the server side up to date I wrote a little procedure that Pings the client after a while of idle to see if the client is still available. Didnt the server got a respone in the next X Time, the user will be disconnected from the serverside and the UserSlot is beeing freed for other connections.

Hope that helpes. If you need help, you can write me a, of course german, mail to: [url]mailto:tranquilizer@secretly.de[/url]

See you

Tranquilizer/ Secretly!
Registred PureBasic User
Post Reply