Announcement

Collapse
No announcement yet.

What server was actually used by the client?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What server was actually used by the client?

    Question

    I have multiple servers set up in my True Update project file. The problem is that I need to know what server was used by the client to get the server files. I want my server script to then download the patch/install file from the correct server.

    Answer

    1) Go to Client Screens -> Download Server Script -> On Start -> Line 146:

    Look for this block of code
    Code:
    -- Break out of this loop if we succeeded
    if(screen_globals.GotServerFiles) then
    break;
    end
    Change to this:

    Code:
    -- Break out of this loop if we succeeded
    if(screen_globals.GotServerFiles) then
    ServerUsed = ServerName;
    break;
    end
    2) Then go to Server Script -> Line 10-15:

    Code:
    if ServerUsed == "Server1" then
    -- Server1 was used
    g_SourceURL = "http://Server1/patch.exe";
    else
    -- Server2 was used
    g_SourceURL = "http://Server2/patch.exe";
    end
    Of course this if statement could be expanded if you have more than 2 servers set up.
Working...
X