I've been working on getting Umotd to load a web page from the server.. to be able to parse it like a local file.
Using code I found at
http://garrysmod.com/wiki/?title=HTTPConnection , I'm using the following.
local function Umotd_fnCallback( contents, size )
if ( contents == nil or contents == "" ) then
contents = "Site " .. Umotd_url .. " gave no results within Gmod timeout"
end
file.Write( "Umotd/".. Ucom .. ".txt", contents )
end
http.Get( Umotd_url, "", Umotd_fnCallback )
Umotd_display = file.Read ( "Umotd/".. Ucom .. ".txt" )
Any URL I pass gives crazy results. It's never fully worked, but has come pretty close at times.
Testing with
http://forums.ulyssesmod.net/ , it never seems to return a full page, if anything at all.
I've attempted to assign Umotd_display = contents within the code, but discovered contents was a 'userdata' variable.
To be honest, I'm not sure what that means, or how to use it.
There is a note along with the page link that says it returns truncated pages.
That seems to be true.
My question is, can anyone assist in figuring out a good way for me to grab a page on the server side.
I understand there may be a 8192 byte limit on the read of the page. Right now, I'd be happy to get more than 15 bytes.