|
#1
|
|||
|
|||
|
How to get the "Location" out of the server list
In my client script I have managed to get the table of TrueUpdate servers and iterate over that to find a good one using GetServerFile().
I'm now working in the server file and need to pull the "location" attribute out of the Server that I ended up connecting to. For instance right now I just have this coded to g_SourceURL = "myserver.com/updates/myProduct/update_" .. g_AvailableVersion .. ".exe" I need to find a way to iterate over the list again and replace the myserver.com with the name where I downloaded the server script file from in the client. I've looked through the help and I can see that I'll probably use HTTP.TestConnection to see if I have a connection to each URL, but how can I iterate over the list pulling the location attribute? |
|
#2
|
||||
|
||||
|
Unless I misunderstood what you are trying to do, I think you won't need to do any additional iteration once you have found a valid location of the server files.
You said that you found an active server with GetServerFile(). I assume that you were looking at the "Download Server Script" screen, in the "On Start" event, weren't you? There you see that the loop will break once a valid server is found. So, all you have to do is save the ServerName in a new global variable to be able to use it again where you need it to. For example, you could change this code Code:
-- Break out of this loop if we succeeded
if(screen_globals.GotServerFiles) then
break;
end;
Code:
-- Break out of this loop if we succeeded
if(screen_globals.GotServerFiles) then
-- before leaving the screen, save the server name
g_servername = ServerName;
break;
end;
Code:
g_SourceURL = g_servername .. "/updates/myProduct/update_" .. g_AvailableVersion .. ".exe". Also, see this post. Ulrich Last edited by Ulrich; 08-12-2008 at 01:57 PM. |
|
#3
|
|||
|
|||
|
I fixed it by just hard coding the url in HTTP.TestConnection. We only have 2 servers so it's not a big deal.
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem playing music and browsing together | webcrtor | AutoPlay Media Studio 6.0 | 1 | 11-15-2006 04:09 PM |
| i need a php script, list files on server | RizlaUK | AutoPlay Media Studio 6.0 | 4 | 07-02-2006 01:36 PM |
| Bit on Net Gaming and pinging the game server | Eagle | General Chat | 8 | 12-01-2005 07:13 PM |
| HOWTO: Set up an MP3 Playlist | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-24-2002 12:57 PM |
| HOWTO: Display Conditional Text Based Upon a List Box Selection | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-15-2002 11:54 AM |
All times are GMT -6. The time now is 03:46 AM.








Linear Mode

