Author Topic: Revenge of the TCP object [Solved]  (Read 3331 times)

It's called RTB, you might have heard of it.
I want it to do it this way if they do not have RTB. Notice how it does not run the check if they have RTB.

What does that even do? Does it shoot rays to see where the terrain is and place bricks there or something?

#1: embedded loops for x, y
#2: z = getTerrainHeight(x, y)
#3: place brick at x, y, z

#1: embedded loops for x, y
#2: z = getTerrainHeight(x, y)
#3: place brick at x, y, z
Ah, well mine was a complete guess but yeah, I figured when he said it was more efficient.

%req = "GET /get/ColorSetMaker_Version.txt?w=1fc5f9ab HTTP/1.1\r\n";
I tried that form of GET request("GET" SPC %File SPC "HTTP/1.1\r\n") and it gave me a 408 timeout error.

I fiddled around (alot), and I found that this worked perfectly when I used it:
%Req = "GET " @ %File @ " HTTP/1.1\r\nHost: " @ %Server @ "\r\n\n";

Hopefully it works for you too.

You should be using the public address to the file, not the private one ... a public one looks like this:

http://dl.dropbox.com/u/12345678/file.whatever

i said that earlier

You should be using the public address to the file, not the private one ... a public one looks like this:

http://dl.dropbox.com/u/12345678/file.whatever
How do I make it public?

move the file into your public folder (in my dropbox)
then right click it>dropbox>get public link

move the file into your public folder (in my dropbox)
then right click it>dropbox>get public link
Still says it.
Code: [Select]
$ColorSetMaker::Version = "0";

function ColorSetMaker_VersionCheck()
{
if(isFile("./RTBinfo.txt") && (isFile("add-ons/System_ReturnToBlockland/client.cs")))
{
return;
}

if(isObject(ColorSetMaker_Downloader))
ColorSetMaker_Downloader.delete();

new TCPObject(ColorSetMaker_Downloader);

ColorSetMaker_Downloader.connect("dl.dropbox.com:80");
}

function ColorSetMaker_Downloader::onConnected(%this)
{
//http://dl.dropbox.com/u/74047590/ColorSetMaker_Version.txt

%req = "GET /u/74047590/ColorSetMaker_Version.txt HTTP/1.1\r\n";

%this.send(%req);
}

function ColorSetMaker_Downloader::onConnectFailed(%this)
{
MessageBoxOK("Attention!", "Unable to connect to the online version information.");
}

function ColorSetMaker_Downloader::onDisconnect(%this)
{
if(!$ColorSetMaker_Connected)
{
MessageBoxOK("Attention!", "Unable to connect to the online version information.");
}

else
{
$ColorSetMaker_Connected = "";
}
}

function ColorSetMaker_Downloader::onLine(%this, %line)
{
echo("\c21:" SPC getSubStr(getWord(%line, 6), 0, 6));

echo("\c22:" SPC getSubStr(getWord(%line, 6), 0, 1));

echo("\c23:" SPC %this);

echo("\c24:" SPC %line);


if(getSubStr(getWord(%line, 6), 0, 6) == $ColorSetMaker::Version)
{
$ColorSetMaker_connected = 1;

ColorSetMaker_Downloader.disconnect();

ColorSetMaker_VersionResult(false);
}

else
{
if(getSubStr(getWord(%line, 6), 0, 6) !$= "1 BETA")
{
$ColorSetMaker_AvailableVersion = "1 BETA";
}

else
{
$ColorSetMaker_AvailableVersion = getSubStr(getWord(%line, 6), 0, 1);
}

ColorSetMaker_Downloader.disconnect();

ColorSetMaker_BersionResult(true);
}
}

function ColorSetMaker_VersionResult(%x)
{
if(%x)
{
MessageBoxOk("Good News!", "Your Color Set Maker mod is up to date.");
}

else
{
MessageBoxOK("Attention!", "There is a more current version of your Color Set Maker mod.\n\nYour Version:" SPC $ColorSetMaker::Version @ "\n\nAvailable: " @ $ColorSetMaker_AvailableVersion);
}
}

Still says what?

Try adding the host field, it would be "Host: dl.dropbox.com\r\n"

Still says what?

Try adding the host field, it would be "Host: dl.dropbox.com\r\n"
here?
ColorSetMaker_Downloader.connect("dl.dropbox.com:80");
no it wouldn't?

try changing
%req = "GET /u/74047590/ColorSetMaker_Version.txt HTTP/1.1\r\n";
to
%req = "GET u/74047590/ColorSetMaker_Version.txt HTTP/1.1\r\n";

Lugnut, that is incorrect. He must try what I did first.

Lugnut, that is incorrect. He must try what I did first.
Result:
1:
2:
3: 8369
4:
1:
2:
3: 8369
4: <html>
1:
2:
3: 8369
4: <head><title>Dropbox - 4xx</title>
1:
2:
3: 8369
4: <link href="https://www.dropbox.com/static/css/main.css" rel="stylesheet" type="text/css">
1:
2:
3: 8369
4: <link rel="shortcut icon" href="/static/images/favicon.ico"/>
1:
2:
3: 8369
4: </head>
1:
2:
3: 8369
4: <body style="background-color:#fff">
1:
2:
3: 8369
4: <br/><br/>
1:
2:
3: 8369
4: <div align="center">
1:
2:
3: 8369
4: <table><tr><td width="600px">
1:
2:
3: 8369
4: <center><img id="errorimage" src="/static/images/psychobox.png"/></center>
1:
2:
3: 8369
4: <div id="errorbox">
1: you're
2: y
3: 8369
4: <h1>Error (4xx)</h1>We can't find the page you're looking for. Check out our <a href="https://www.dropbox.com/help">Help Center</a> and <a href="http://forums.dropbox.com">forums</a> for help, or head back to <a href="https://www.dropbox.com/home">home</a>.
1:
2:
3: 8369
4: </div>
1:
2:
3: 8369
4: </td></tr></table>
1:
2:
3: 8369
4: </div>
1:
2:
3: 8369
4:
1:
2:
3: 8369
4: <script type="text/javascript" src="/static/javascript/external/dropbox-mini.js"></script>
1:
2:
3: 8369
4: <script>

Do this for the request, each line is an \r\n
Code: [Select]
GET /u/74047590/ColorSetMaker_Version.txt HTTP/1.1
Host: dl.dropbox.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Connection: keep-alive
If-None-Match: 23n

Make sure the request ends in \r\n\r\n

When it works, you're going to remove some fields to see which you don't need.
« Last Edit: May 08, 2012, 01:08:34 PM by Kalphiter »

Do this for the request, each line is an \r\n
Code: [Select]
GET /u/74047590/ColorSetMaker_Version.txt HTTP/1.1
Host: dl.dropbox.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Connection: keep-alive
If-None-Match: 23n

Make sure the request ends in \r\n\r\n

When it works, you're going to remove some fields to see which you don't need.
Like this?
Code: [Select]
%req = "GET /u/74047590/ColorSetMaker_Version.txt HTTP/1.1\r\n Host: dl.dropbox.com\r\n User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0\r\n Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n Accept-Language: en-us,en;q=0.5\r\n Connection: keep-alive\r\n If-None-Match: 23n\r\n\r\n";