Indigo Rose Software

Go Back   Indigo Rose Software Forums > TrueUpdate 3.5 > TrueUpdate 3.5 Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 08-12-2008
davedoc davedoc is offline
Forum Member
 
Join Date: Aug 2008
Posts: 7
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?
Reply With Quote
  #2  
Old 08-12-2008
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
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;
to this:

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;
After this, you might want to use the new variable you created to set the correct filename you will try to download afterwards. In other words, before you use the g_SourceURL in your download screen action, change it to something like
Code:
g_SourceURL = g_servername .. "/updates/myProduct/update_" .. g_AvailableVersion .. ".exe".
Please check if this works, if that was indeed what you were trying.

Also, see this post.

Ulrich

Last edited by Ulrich; 08-12-2008 at 01:57 PM.
Reply With Quote
  #3  
Old 08-21-2008
davedoc davedoc is offline
Forum Member
 
Join Date: Aug 2008
Posts: 7
I fixed it by just hard coding the url in HTTP.TestConnection. We only have 2 servers so it's not a big deal.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software