ID:171112
 
I hope to make something that a player can download from my game's hub entry so they can check the availability of different servers(if the game is being hosted on the server). (When they ran it, they would get a list of the current working servers and clicking on a button would redirect them to join the server.) How can I redirect the player like this? To communicate between the program and serverI would assume it would use Import() and Export(). Can I do this or does any of this violate a security feature and can't be done? Does anyone have any suggestions on how I can do this if it is possible?
Using world.Export(), in conjunction with the default 'ping' function of world.Topic() can acheive this very simply. For redirecting the player, all you need to do is create a link that points to the game server's address.
Look up the procs I mentioned, if you haven't already. They can be very useful - I use them primarily to create a LAN based chat system with computers that have no access to the hub through BYOND.
EGUY wrote:
I hope to make something that a player can download from my game's hub entry so they can check the availability of different servers(if the game is being hosted on the server). (When they ran it, they would get a list of the current working servers and clicking on a button would redirect them to join the server.) How can I redirect the player like this? To communicate between the program and serverI would assume it would use Import() and Export(). Can I do this or does any of this violate a security feature and can't be done? Does anyone have any suggestions on how I can do this if it is possible?


Hmmm a Server Diaognostic tool for SDE. Good Idea :)
Okay. I have looked at the two procs but I do not understand how I can use them together to ping a server and check the number of players as Topic is supposed to do by default. What I am trying to do is make it so the player downloads the program and they open it. Then they get a list of verbs. When they click on a verb like 'Check Main Server', I want it to check to see if the game is being hosted on http://whatever:1000, and if it is, it returns the number of players in that server and the CPU useage of the server. The process should look like this to a user(usr << is used to represent output in the text box):

Player Clicks 'Check Main Server'
Usr << "Checking Main Server..."
(Pings the server and returns, the world is being hosted)
Usr << "Main Server being hosted. Currently, 40 people are playing and the CPU useage of the host computer is 20%."
Usr << "Would you like to join?"
(asks player with an alert(), if they accept, usr << link(...))

OR if it isn't being hosted:

Player Clicks 'Check Main Server'
Usr << "Checking Main Server..."
(Pings the server and returns, the world is not being hosted)
Usr << "Main Server not currently being hosted. Please try back later, it may be down for updates."

I also plan to do this(if it works) with multiple servers. This would work as a program to help the player that would include hublib to e-mail me about bugs,etc. and have verbs to links about the game's website, and maybe a chatroom. For myself, it would have the ability to reboot or shutdown servers.
In response to EGUY
If it is a proc...you shouldn't be using usr right?
In response to N1ghtW1ng
It is a verb that calls procs.