-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if another player has the same serial #3854
Conversation
New enum called SERIAL_DUPLICATE and logic that checks if there are no other players on the server having the same serial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
This solution is not perfect because if you run multiple MTA clients on one machine (VM), you get the same serial, making localhost testing impossible. |
Maybe you could add something like |
I forgot about that, thanks for reminding. |
Good idea, I look forward to other people's opinions as well |
I forgot you can use VMs to run multiple MTA clients. You need 1 VM (os) per client right? |
That's right |
Maybe we can have a setting like |
Make a new parameter called check_duplicate_serials which is enabled by default
Would this be optimized if 'std::unordered_map' and 'find' were used instead of a loop? |
In fact, in this use case there are no significant differences in terms of average server sizes, but for a larger search operation it is really better to use unordered_map and its method. If someone wants to refactor it, they have to modify the entire class, and this pull request is not intended for that. |
Server/mods/deathmatch/logic/packets/CPlayerDisconnectedPacket.h
Outdated
Show resolved
Hide resolved
How would they know server's moderator serial? |
From servers with a loophole or a data leak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that, good job!
Co-authored-by: Fernando Rocha <[email protected]>
This pull request adds a check when connecting to ensure that players can't use the same serial, thus preventing abuses related to serial manipulation, such as for example, when they try to spoof a server's moderator's serial as their own, while they're connected to the server.
The change involved the addition of a new parameter called
check_duplicate_serials
which allows turning off the feature for development and testing servers to connect with virtual machines.The new code is:
CD50
The new description is: Serial already in use