spmn / sa-mp_masterlist_fix

Master of your... internet tab!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is not working

DX-BR opened this issue · comments

commented

How do I make it functional and add a new list?

download the source version I added a list but it didn't work can you update the source to work in the latest version of samp?

commented

Hello,

AFAIK SACNR shut down their masterlist and there are no other 3rd-party masterlists still active. So your only choice is to use the lists provided by SA-MP.com, which are anyway the defaults.

commented

I made my own list and hosted it on my site, but no server appears on the list, I believe it is not injecting more new servers with the current code

commented

Oh, right. It is not mentioned anywhere, but this project is only compatible with SA-MP 0.3.7-R1 server browser.

This means that you will have to replace your samp.exe browser. You can keep samp.dll and all the other SA-MP files unchanged, so the actual game client is not affected by this change.

commented

Is there a way to make the current version of samp SA-MP 0.3.7-R5 compatible?

commented

SA-MP server browser is not tied to the SA-MP client version. You can "combine" samp.exe 0.3.7-R1 and samp.dll 0.3.7-R5, so when you connect to a server you will actually be using 0.3.7-R5 (you will see the relevant SA-MP 0.3.7-R5 started message printed to your screen).

Updating is also a valid solution, but unfortunately I do not have enough time right now, so you will have to do it yourself. All you have to do is update this address here[1], everything else should stay the same. I think CheatEngine used to have a very useful memory scanning tool that you could use to find the relevant address.

[1] https://github.com/spmn/sa-mp_masterlist_fix/blob/master/sa-mp_masterlist_fix/fix.cpp#L22

Hello @spmn ; I'd like to point out that I have released a new alternatve server monitor along with api and masterlist as a continuation of SACNR's defunct one, if interested please check https://sam.markski.ar

Hi @markski1, I'm finally looking to update this thing now that it's been confirmed that SA-MP hit EOL. I am looking to add support for 0.3.7 R5 and maybe 0.3DL R1.

One thing I have noticed is that your masterlist API does not filter the servers by version. For example, if a 0.3.7 client asks for the masterlist, it should be served a list of 0.3.7-compatible servers only. You could infer the client version by looking at the user agent. Example UA: Mozilla/3.0 (compatible; SA:MP v0.3.7) or Mozilla/3.0 (compatible; SA:MP v0.3.DL)

Or you could expose an API for filtering, just like the official SA-MP masterlist does: http://lists.sa-mp.com/0.3.7/servers. Whatever you'd like.

Thanks for replying back @spmn , I will attempt to implement something along the lines of your initial suggestion. Would allowing for a parameter (such as ?version=0.3.7 at the end) be viable for how your fix is implemented?

================================================================

Update: All of this should now be live (code changes here).

The masterlist now considers user agent, and failing that, you may explicitly specify a version. (Check http://gateway.markski.ar:42069/api/GetMasterlist?version=0.3.7 ; http://gateway.markski.ar:42069/api/GetMasterlist?version=0.3DL).

Furthermore, I've set up nginx proxy so that the API can be queried through port 80 (so you should be able to use http://sam.markski.ar/api/ without specifying the port.)

If you have any other suggestion or would like to work together to have a fully working version of this ASAP, feel free to contact me directly through any of the methods on my website or github profile.

Huge thanks for the effort you're pouring into hosting and maintaining the masterlist. It definitely takes a big effort to keep the list clean and look out for bad actors, especially in a game that is known to be riddled with cheaters and exploiters. I've added your name and your masterlist service to the README. If there is anything missing, feel free to open a PR with the changes.

I've made the mod compatible with possibly(?) all SA-MP server browsers ever shipped. However, what is guaranteed is that 0.3.7 R1, 0.3.7 R5 and 0.3DL definitely work. By default, the patched requests will be made to this endpoint: ($(version) gets replaced with 0.3.7, 0.3.DL, 0.3z etc)

"url": "http://gateway.markski.ar:42069/api/GetMasterlist?version=$(version)"

As you can see in that JSON file, now you can also change the hosted masterlist. However, the official list stays the default.

There are many other changes. You can have a look at the release notes or the commit log if you're familiar with this low level stuff.

==========

Now some bad news :(

Unfortunately (at least for me), the client struggles to display the SA-MP servers with the new list. Initially I thought that was because of the black magic done inside this DLL, but apparently the client shows with no problems a self-hosted mirror of the official SA-MP masterlist (served from a VPS, not from the local network).

I am not sure whether that's because the servers have huge ping for me (>400ms) and the client waits too much on query packets or there are malicious SA-MP servers that send malformed packets (maybe there is even an exploit inside the server browser? who knows)

I believe the best way to handle this is to figure out the problem (either ping or exploit) and filter out the problematic servers before answering to the list request.

Glad it is useful. As for the issues, I'll try it myself and see what I can do or find, if anything. The sheer amount of servers may be the issue (where the official hosted tab stored a maximum of 200, and samonitor sends back 600)

EDITED: This was a long list of possible reasons which were ultimately wrong. See next post.

Update: I am happy (and also ashamed) to confirm that this was my fault. Using the "version" parameter got a cached version of the Masterlist which was NOT getting flushed every time it was refreshed. As such, every 30 mintues, the same 500+ IP's got added to the list, causing the list to contain more than 10,000 IP's for the last few hours.

After fixing this bug and restarting the SAMonitor server, the issue is fixed!

imagen

Thanks again for your work rewriting this mod. I will be sure to add a page for it in the website tomorrow.

Fix confirmed on my side too. Glad it all worked out in the end.

If you have any other suggestions or questions, feel free to contact me on Discord -- same nick as here.