Jump to content
  • 0

External HTTP server


dugasz1

Question

Hi guys!

I just tried out the external http file download stuff. And i constantly get:
DIAGNOSTIC: [N'C]dugasz1 #1011 External HTTP file mismatch (Retrying this file with internal HTTP) [spawn\spawn_c.lua]

But they are the same. I'm using AWS CloudFront. So, i don't know is it the server even find it? Maybe the redirections mess things up?

I added ContentType: application/octet-stream and i checked it with chrome and postman and it is there. So any idea? 

Link to comment

9 answers to this question

Recommended Posts

  • 0
  • MTA Team

Seems to work for me (MTA does handle redirects). Here is what I did:

1) Set mtaserver.conf to contain: <httpdownloadurl>d1izvzwg6uq9e2.cloudfront.net</httpdownloadurl>
2) Add spawn resource to server
2) Start server
3) Ensure spawn does not exist in client cache
4) Start client
5) Join server
6) Start resource spawn
Result: Download success

Link to comment
  • 0

Do you mean MTA San Andreas 1.5\mods\deathmatch\resources under client cache?

I did these steps and the same error occures.

My servers spawn resource:
https://imgur.com/HjGYluO

The bucket:
https://imgur.com/9emUhE6

In the server config: <httpdownloadurl>d1izvzwg6uq9e2.cloudfront.net</httpdownloadurl>

I'm duing this on Windows 10 don't know is it matter.

The content-type is looks fine too.

https://imgur.com/VfSMy0v

Link to comment
  • 0
  • MTA Team

MD5 and CRC32

Add this in a client script:

function myCallback( responseData, errno )
    outputChatBox(""
                .. " response length:" .. tostring(string.len(responseData))
                .. " errno:" .. tostring(errno)
                )
    local newFile = fileCreate("downloaded.lua")
    if (newFile) then
        fileWrite(newFile, responseData)
        fileClose(newFile)
    end
end
fetchRemote ( "d1izvzwg6uq9e2.cloudfront.net/spawn/spawn_c.lua", myCallback )

Then check the content of downloaded.lua
(it will be in the client resource cache directory)

  • Like 1
Link to comment
  • 0
function greeting(  )
	-- body
end
addCommandHandler("g", greeting)

That's wierd it returns with the first version of the file. I guess the cloudfornt doesn't synced the data. I tried with only the bucket link https://s3.eu-central-1.amazonaws.com/testmtabucket/resources and it worked fine.

How MTA resoulve DNS? Because it almost works in my browser it downloads the almost latest (without the last modofication you writed) with the cloudfront DNS too but MTA downloads the oldest?

Found the reason. CloudFront not the best in updating existing file. Link

Thank you for your help !

Edited by dugasz1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...