multitheftauto / mtasa-resources

This project maintains a list of up-to-date resources that come with Multi Theft Auto.
https://multitheftauto.com
MIT License
151 stars 151 forks source link

ip2c: Add safety checks to exported function arguments #414

Closed Fernando-A-Rocha closed 1 year ago

Fernando-A-Rocha commented 1 year ago

Adds safety checks to arguments of getCountryName( country ) and getPlayerCountry ( player ).

Also fixes admin2 calling getCountryName(aPlayers[player].country) without checking if the country code is set. This would always trigger an error when playing on LAN as ip2c can't get any country from your local ip.

Fernando-A-Rocha commented 1 year ago

I noticed that on a new server with default resources, ip2c doesn't have fetchRemote access so I added the aclrequest to meta.xml

e

Was this the right thing to do? Is there a way to allow it by default?

brenodanyel commented 1 year ago

I noticed that on a new server with default resources, ip2c doesn't have fetchRemote access so I added the aclrequest to meta.xml

e

Was this the right thing to do? Is there a way to allow it by default?

Maybe it's better to send a PR on mtasa-blue adding a simple <object name="resource.ip2c"/> under the "Admin" group to enable it by default, so that server owners don't have to worry about running aclrequest allow ... manually?

Fernando-A-Rocha commented 1 year ago

I noticed that on a new server with default resources, ip2c doesn't have fetchRemote access so I added the aclrequest to meta.xml e Was this the right thing to do? Is there a way to allow it by default?

Maybe it's better to send a PR on mtasa-blue adding a simple <object name="resource.ip2c"/> under the "Admin" group to enable it by default, so that server owners don't have to worry about running aclrequest allow ... manually?

I was looking for this. Thank you, this seems the right thing to do. I'll revert my latest aclrequest commit and do that instead 👍