I am currently adding trading to my game however I came across a major issue that is likely to arise, account compromises.
I thought that one solution to this would be to disable trading for a few days if a user was to log on from a different country.
However, I then thought if this would this be allowed since it would require me to save the last country a player logged on from? (The information will never be seen by any player, and will only be used for account security)
So basically my question is, would saving the last country a player logged on from be allowed?
You could but you shouldn’t. Country information isn’t going to contribute anything significant to a critical system in your experience since that can be spoofed. Player locale is based on their machine so if enough people figure out your system it takes no effort to put a wedge in that.
Perhaps you may want to consider other metrics about a recipient and/or sender’s player and data, the details of the trade itself, a form of security that the user can implement on their side or from your end a way to inspect and roll back inappropriate trades. Some ideas that I’m throwing around but they may not necessarily be applicable or even sufficient for your use case.
If someone uses a vpn, that could be detected as false positive.
Probably make a different type of it.
It’s maybe a cool idea but I would suggest against it, One it doesn’t really make your security any better but can cause really big issues in the long term when roblox might increase the precission on the country list. or if roblox removes that metric all together.
The reason you have access to that information is for localisation and analytics that’s how it’s supposed to be used.
Some things you can’t control if someone loses their account well you can’t control that.
I personally would log things like transaction logs so that if something were to arise it could be traced.
I would look into adding restrictions so players can’t trade X items rapidly or the really rare items take 24 hours to arrive in someone’s inventory similar to Steams system as they prevent these attacks by adding delays in trades that can be canceled, unfortunately, you don’t have any kind of 2FA so it gives people 24 hours to get their account back or notify you that your account was stolen.