Skip to content

Add getSystemInfo function#2267

Closed
Pirulax wants to merge 4 commits into
multitheftauto:masterfrom
Pirulax:feature/system-info
Closed

Add getSystemInfo function#2267
Pirulax wants to merge 4 commits into
multitheftauto:masterfrom
Pirulax:feature/system-info

Conversation

@Pirulax

@Pirulax Pirulax commented Jun 18, 2021

Copy link
Copy Markdown
Contributor

This function returns basic information about the client's system in a table.
Example:

{
    CPU = {
        MaxClockSpeed = 3200,
        NaNumberOfCores = 6,
        Name = "AMD Ryzen 5 1600 Six-Core Processor",
        NumberOfLogicalProcessors = 12
    },
    GPU = {
        Name = "Radeon RX 570 Series",
        RAM = 419328
    },
    TotalPhysicalMemory = 16727152 -- in bytes. I actually think it should be in MB (as the VRAM size)
}

Note: First call to this function is veeeeeery slow, as it has to query WMI.
Subsequent calls are fast, as static variables are used to cache the data.

To clarify, this PR adds:

  • CPU info (table under CPU key)
  • TotalPhysicalMemory
  • GPU info is just here for convenience (already available from dxGetStatus)

@Pirulax

This comment has been minimized.

@Dutchman101

Dutchman101 commented Jun 18, 2021

Copy link
Copy Markdown
Member

Nice, this will allow scripters to make scripts smarter (estimate how high-end player's PC is, and decide if they will load heavy mods and scripts or limited / more optimized lightweight versions)

Also, in my eyes this function is fine to return basic GPU specs (model name & video mem), with a note on its wiki page saying For more than just basic GPU information, use dxGetStatus. Because people would expect a function called getSystemInfo returns info about the most important hardware. So i wouln't consider it as much of a duplicate functionality.

@StrixG StrixG added the enhancement New feature or request label Jun 19, 2021
@StrixG StrixG added this to the Backlog milestone Jun 19, 2021
@botder

botder commented Jul 5, 2021

Copy link
Copy Markdown
Member

Why exactly is this needed and how would that be used to "optimize" scripts?

@AlexTMjugador

AlexTMjugador commented Jul 5, 2021

Copy link
Copy Markdown
Member

I think it's main use would be to compute some kind of "performance score" for the client PC, and deciding things like what models to load or what code to run based on that score, as @Dutchman101 said. Obviously, you can't trust things like clock speed or available memory alone (fun fact: I have an old single-core Pentium D from around 2005 lying around that goes up to 3.4 GHz, and obviously nobody would claim that is a good CPU nowadays, despite its high clocks), but if you mix them using some kind of model (i.e. "if this CPU has more than 4 cores, is an Intel Core or Ryzen and has at least 3 GHz of base clock speed then it should be good") you could get pretty interesting conclusions.

The alternatives I can see that are possible right now are:

  • Benchmark the client PC on the first connection, which provides accurate data, but this information may become stale if the hardware is changed. Also, the benchmark can't be too hard, because lower end PCs may crash when running it due to lack of memory, for example, so it may have trouble telling apart really high end PCs from those in lower ranges. Not to mention that executing a benchmark is not necessarily so quick and energy efficient.
  • Introduce settings that, while configured by default to target low end PCs, allow players with beefier PCs to enjoy enhanced visuals and things like that. While this is a nice concept, some players can't really be bothered to understand and tweak the settings, and it can be argued that the first impression a server gives, in terms of the visual quality it offers by default, can make some difference.

All in all, while I concede that this function is not exactly the most privacy-friendly and easy to use thing in the world (I'm scared that some scripters may hardcode a list of hardware names and, in general, use it in a sloppy way and call it a day), I can definitely see some interesting use cases for it. Although maybe MTA can already provide scripters with a "performance score", similarly to what the Linux kernel does when computing the "bogoMIPS" (but hopefully better)?

@starfleet001

Copy link
Copy Markdown

This function is a paramount for heavily modified servers. Knowing basic information about player's hardware will allow to greatly improve user experience and possibly even reduce amount of crashes.

Currently I use relatively ugly approaches to handle low-end PCs. The main one would be to wait for "memory overflow" error (if lucky player wasn't crashed before it showed) and then unload models, switch to low-performance mode (optimized for low end PCs) and load again. Knowing information about player's CPU and physical memory will allow to select best suitable loading mode in advance which is way better. It would also allow to create different loading profiles for different category PCs (so not only generalized "low end" / "good enough specs" but more categorized).

Other approaches were tried over the years too. Like selecting "graphics settings" before loading. This one is nearly useless because most players don't tend to read detailed information or benefits of different modes (or even understand what mode will be the best suitable for them) and just click "high" or something similar. And then in some cases it lead to crashes (either due low amount of memory or something else). Fast benchmarking approach was tried too but in some weird cases it froze the client so it was removed basically after a week of public testing. Also benchmark results were not really reliable. I still keep manual override options for advanced players tho (so they could override server selected models and textures loading options).

Another benefits that I see here (besides creating different models loading profiles):

  • Smart scripts. Different optimization strategies could be used based on information about hardware. It might be related to complex computations as well as simple things like reducing amount of repeated heavy calls (so lower amount for low-end PC, higher for better PC).
  • Providing suggestions based on hardware (CPU / OS tweaks). Currently I use similar approach based on the name of GPU and GPU memory (suggesting optimal or best settings for NVIDIA / AMD user). This is mostly for advanced users but it's proven to be quite useful in providing good user experience. Specially for cases with outdated drivers (there are users with dedicated GPU that is not used by MTA:SA in some cases and re-installing or updating drivers usually fixes it, sometimes GPU settings tweaks are required).

I think it also makes sense to add information about currently available amount of physical memory or / and current memory usage of gta_sa.exe process. It might slow down this function tho (I'm not sure). But it could be useful to know for sure in advance how many models can be replaced without crashing the client or producing overflow errors.

I don't really see any downside here. I wouldn't be too worried about some scripters using it for lazy scripting techniques. There are many ways to create sloppy things right now and this function wouldn't make a difference in this regard IMO.

Anyway, my apologies for this long comment but it's quite an interesting topic and really useful function. It would be nice to see it reviewed, tested and merged soon since it could provide many benefits right now even before IMG related features are integrated.

@patrikjuvonen patrikjuvonen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stand against this feature until it can provide a way to disable sharing the information to scripts via settings menu.

Comment on lines +43 to +44
{ "RAM", (lua_Number)gpu.memoryKB},
{ "Name", gpu.name },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent use of whitespace.

Suggested change
{ "RAM", (lua_Number)gpu.memoryKB},
{ "Name", gpu.name },
{"RAM", (lua_Number)gpu.memoryKB},
{"Name", gpu.name},

Comment on lines +23 to +26
uint32_t MaxClockSpeed = 0;
std::string Name = {};
uint32_t NumberOfCores = 0;
uint32_t NumberOfLogicalProcessors = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is inconsistent.

Suggested change
uint32_t MaxClockSpeed = 0;
std::string Name = {};
uint32_t NumberOfCores = 0;
uint32_t NumberOfLogicalProcessors = 0;
uint32_t MaxClockSpeed = 0;
std::string Name = {};
uint32_t NumberOfCores = 0;
uint32_t NumberOfLogicalProcessors = 0;

Comment on lines +31 to +32
WMIProcessorInfo CPU = {};
uint64_t TotalPhysicalMemory = 0; // In KiB

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is inconsistent.

Suggested change
WMIProcessorInfo CPU = {};
uint64_t TotalPhysicalMemory = 0; // In KiB
WMIProcessorInfo CPU = {};
uint64_t TotalPhysicalMemory = 0; // In KiB

SString GetWMIOSVersion();
unsigned int GetWMIVideoAdapterMemorySize(const unsigned long ulVen, const unsigned long ulDev);
long long GetWMITotalPhysicalMemory();
WMISystemInfo GetWMISystemInfo();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is inconsistent.

{"tocolor", tocolor},

#ifdef MTA_CLIENT
{"getSystemInfo", ArgumentParser<mta::GetSystemInfo>}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing comma.

Suggested change
{"getSystemInfo", ArgumentParser<mta::GetSystemInfo>}
{"getSystemInfo", ArgumentParser<mta::GetSystemInfo>},

@patrikjuvonen patrikjuvonen added the feedback Further information is requested label Aug 4, 2021
@patrikjuvonen patrikjuvonen marked this pull request as draft August 4, 2021 13:45
@AlexTMjugador

Copy link
Copy Markdown
Member

It would be nice to see it reviewed, tested and merged soon since it could provide many benefits right now even before IMG related features are integrated.

Just for the record, in case I didn't state my thoughts clearly on my previous comment, judging by the downvotes and the overall "I would love to see this added and here's why" tone of this comment: I think that this function can be a good addition to MTA. I was just pointing out some considerations that I think are worth thinking about before this is merged in a final release.

@starfleet001

Copy link
Copy Markdown

I stand against this feature until it can provide a way to disable sharing the information to scripts via settings menu.

I probably never gonna understand why some game developers so against basic and necessary functionality for a game.. Specially when we already had GPU information for years.

Just wanna point out something. Disabling this kind of necessary functionality in the settings would create additional issues and potentially not user friendly behavior. In my case i would probably need to drastically change models loading flow in order to ask the user to share hardware information prior loading. Or simply kick a player (which is a really really bad thing but many servers that will require hardware information will probably do it this way).

Similar to how some servers handle "Allow screen upload" checkbox right now.. I remember in the beginning it wasn't a problem with "screen upload". Just removing some functionality from users with disabled option was enough. But later "render targets" became a part of necessary functionality and i had to force all users to enable this option so they wouldn't lose gameplay features. In this case of course it's not hard to do it without kicks using banner (unlike hardware information which is mostly required prior regular models loading flow).

It's surprising why one of the greatest multiplayers created lacks necessary scripting functionality. Starting from detailed hardware information and ending with client settings (like for example "Audio" volumes). Something is holding us back :(

@patrikjuvonen

Copy link
Copy Markdown
Contributor

I stand against this feature until it can provide a way to disable sharing the information to scripts via settings menu.

I probably never gonna understand why some game developers so against basic and necessary functionality for a game.. Specially when we already had GPU information for years.

Just wanna point out something. Disabling this kind of necessary functionality in the settings would create additional issues and potentially not user friendly behavior. In my case i would probably need to drastically change models loading flow in order to ask the user to share hardware information prior loading. Or simply kick a player (which is a really really bad thing but many servers that will require hardware information will probably do it this way).

Similar to how some servers handle "Allow screen upload" checkbox right now.. I remember in the beginning it wasn't a problem with "screen upload". Just removing some functionality from users with disabled option was enough. But later "render targets" became a part of necessary functionality and i had to force all users to enable this option so they wouldn't lose gameplay features. In this case of course it's not hard to do it without kicks using banner (unlike hardware information which is mostly required prior regular models loading flow).

It's surprising why one of the greatest multiplayers created lacks necessary scripting functionality. Starting from detailed hardware information and ending with client settings (like for example "Audio" volumes). Something is holding us back :(

Privacy.

@starfleet001

Copy link
Copy Markdown

Privacy.

I understand this point. Thank you. Personally I hardly see any privacy issues with knowing client's hardware. After all, it's a game (multiplayer). And the game is hardware dependent.
Well, I hope that we will get this kind of functionally at least in some way. But in my opinion it would be better without option to disable it (for reasons I mentioned in my previous comment).

@AlexTMjugador

AlexTMjugador commented Aug 4, 2021

Copy link
Copy Markdown
Member

Personally I hardly see any privacy issues with knowing client's hardware. After all, it's a game (multiplayer). And the game is hardware dependent.

While it can be argued that the device information this function provides is pretty basic, device fingerprinting is an actual concern that has already seen some bad uses. Wikipedia has a good article about the subject. I definitely wouldn't want to introduce a function that may help such activities without even thinking about it.

Besides, making it an option means that you can handle the setting being disabled, as you discussed previously, as you seem fit for your server. It's possible to do the check in a separate resource that loads before the bulk of your resources, so you can take the corresponding action before any model gets loaded, and handle any synchronization via events. Personally, I wouldn't mind such an option being enabled by default, much like CEF is not entirely disabled by default, so I don't think that user-friendliness should be impacted that much for those who seek that "plug and play" experience.

@starfleet001

Copy link
Copy Markdown

Besides, making it an option means that you can handle the setting being disabled, as you discussed previously, as you seem fit for your server. It's possible to do the check in a separate resource that loads before the bulk of your resources, so you can take the corresponding action before any model gets loaded.

Of course it can be handled. But like I mentioned, it will lead to unnecessary steps and complications. Typically users don't like complications (proven in many areas of life and specially in online games).
Also I have seen many projects that decide to kick player instead of explaining at least in some good form what is required from the user. Obviously it's a fault of server developer that such not user friendly way was chosen. But it's avoidable (if there is no option).

Besides, making it optional will not solve device fingerprinting in any way. And for advanced users hardware information spoofing isn't something too complicated. So arguably speaking making it an option is counter productive (if we are talking about potential bad usage).
We already have many things in this game that can be used in a bad manner. I think we should consider amount of benefits in relation to amount of potential bad practices (or something like this). And in this case I believe benefits outweighs.

@AlexTMjugador

Copy link
Copy Markdown
Member

Besides, making it optional will not solve device fingerprinting in any way. And for advanced users hardware information spoofing isn't something too complicated. So arguably speaking making it an option is counter productive (if we are talking about potential bad usage).

Trivially, if a script can't get fingerprintable information at all, every device fingerprinting concern is solved, because device fingerprinting can't happen in the first place. While I agree that spoofing this information solves most concerns related with fingerprinting, I don't think we should make advanced users lives harder just because they are already advanced, the same way we should not make not-so-advanced or privacy-conscious users lives harder by having to explicitly enable such an option.

We already have many things in this game that can be used in a bad manner. I think we should consider amount of benefits in relation to amount of potential bad practices (or something like this). And in this case I believe benefits outweighs.

This is a fair point. I usually advocate for using each new feature as an opportunity to apply experience or new knowledge that would arguably result in a better software design overall, though, because I fear technical debt creeping up my back quite a bit.

@starfleet001

Copy link
Copy Markdown

Trivially, if a script can't get fingerprintable information at all, every device fingerprinting concern is solved, because device fingerprinting can't happen in the first place.

You are right. Though I was talking about developers not letting users in unless hardware information is shared. So if some server decides to use hardware information with the sole purpose of device fingerprinting then it would be a way to go. This is why I mentioned that option is "counter productive" and I believe there is no perfect solution for this particular problem (if we even consider this as a problem). For example I don't consider this as a problem in 2021 because it's already possible to use different forms of device or in-game behavior fingerprinting without this function (and it can be quite effective).

@Shuubaru

Copy link
Copy Markdown

This function is a paramount for heavily modified servers. Knowing basic information about player's hardware will allow to greatly improve user experience and possibly even reduce amount of crashes.

Unless we can know the amount of ram the game process is using, forget about preventing people from "out of memory" crashes.

@ArranTuna

Copy link
Copy Markdown
Collaborator

I stand against this feature until it can provide a way to disable sharing the information to scripts via settings menu.

Servers can see your IP address and you're worried about them seeing the name of your CPU..?

@LosFaul

LosFaul commented Aug 12, 2021

Copy link
Copy Markdown
Contributor

to make one thing clear:
hardware information is NOT personal information

@Pirulax

Pirulax commented Aug 28, 2021

Copy link
Copy Markdown
Contributor Author

Isn't the serial the perfect candidate for device fingerprinting?
This won't change the situation at all. Devices can be fingerprinted by their serial already.
This basic sysinfo won't make it any worse.
And you can't even spook it (unlike this one, which probably is fairly easy).

@patrikjuvonen

Copy link
Copy Markdown
Contributor

I don't want my GPU information to be read by scripts.

@Pirulax

Pirulax commented Aug 28, 2021

Copy link
Copy Markdown
Contributor Author

That's already done by dxGetStatus. It isn't a new feature.
This PR just adds CPU info + RAM size.

@Dutchman101

Dutchman101 commented Aug 28, 2021

Copy link
Copy Markdown
Member

I find this entire privacy concern heavily exaggerated

Your main concern would be device fingerprinting right? Well, the best way for server owners to fingerprint a player is already built into MTA: serials. It can't get worse than that, so having a scripting function that returns CPU and GPU name doesn't do much after that point.

Of course, we can add a client option similar to others (e.g "Allow external sounds" and "Allow screenshots"), but that would be wasted developer effort on this PR as it brings no additional privacy value, and may only complicate a server scripter's job of educating players that they need to allow getting PC specs (either to let the game run properly, or as some servers would do - barr the player unless they allow it, and make a tooltip or something instructing them to enable it. It's all wasted effort, as players like to fiddle with random options without a particular purpose of allowing/disallowing something)

@Dutchman101

Copy link
Copy Markdown
Member

Anyone that wants to, feel free to adopt this PR

@github-actions github-actions Bot removed the stale Inactive for over 90 days, to be closed label Dec 4, 2023
@github-actions

github-actions Bot commented Mar 4, 2024

Copy link
Copy Markdown
Contributor

This draft pull request is stale because it has been open for at least 90 days with no activity. Please continue on your draft pull request or it will be closed in 30 days automatically.

@github-actions github-actions Bot added the stale Inactive for over 90 days, to be closed label Mar 4, 2024
@ghost

ghost commented Mar 4, 2024

Copy link
Copy Markdown

I will create a new PR soon. 😄

@github-actions github-actions Bot removed the stale Inactive for over 90 days, to be closed label Mar 5, 2024
@github-actions github-actions Bot added the stale Inactive for over 90 days, to be closed label Jun 3, 2024
@github-actions

github-actions Bot commented Jun 3, 2024

Copy link
Copy Markdown
Contributor

This draft pull request is stale because it has been open for at least 90 days with no activity. Please continue on your draft pull request or it will be closed in 30 days automatically.

@Dutchman101 Dutchman101 marked this pull request as ready for review June 30, 2024 03:53
@Dutchman101

Copy link
Copy Markdown
Member

I will create a new PR soon. 😄

@Nico8340
Are you still planning for it?

@ghost

ghost commented Jun 30, 2024

Copy link
Copy Markdown

@Nico8340 Are you still planning for it?

Yes

@ghost

ghost commented Oct 8, 2024

Copy link
Copy Markdown

Bump?

@Fernando-A-Rocha

Copy link
Copy Markdown
Contributor

PR abandoned ?

@ghost

ghost commented Nov 6, 2024

Copy link
Copy Markdown

I just saw that there is such a PR with some funny comments on it. I don't get it why some people dragged here the privacy concerns.
If I install a software I give rights to it to read my full detailed system information by default. This is basic.
If I run and use that software I know that everything I do in it (INSIDE) will be logged, this is also basic. Doesn't matter if I don't like it.
If the software wants to protect itself from malicious users, I also accept that it needs some power against those. If it means that I need to give kernel access, then it means that. For example, if another software would like to change some things in the main software's exe while running.

For me, privacy concers came into my mind, when a software does much more than these. When it logs my activities/actions OUTSIDE of the software. When it logs my browsing history for e.g. When it logs my file architecture alongside its content. When it listens to microphone/webcam, etc.
We know that MTA doesn't do these.

Note: There are known aggressive kernel ACs like Vanguard which even collects some of these mentioned sensitive data and there are huge concerns about this process.

If I connect to a server, I know that everyting I do on it, will be logged. YES, even private messages. Server owners, server administrators must have the full power to fight against their malicious users. If you don't want your server owners to read your pms, then use other software for communitacion. But again, if you use discord for example, or messenger, then Facebook and Discord will read your messages. There is no such things like 'no one reads it only me and my partner'.

In my opinion this PR is okay, but lacks of more detailed data.
For example motherboard manufacturer, model, number etc.
RAM manufacturer, model, HDD/SSD manufacturers etc.
Server owners would still need to make their own fingerprint system which uses these data. With a CPU name only, there couldn't be created a good fingerprint system which was the main concern for some reason.
I would even allow a getProcessList() function to be made to get the running process of the client's PC to see if they use something suspicious (if the program doesn't hide itself)

Keep in mind that even this: https://wiki.multitheftauto.com/wiki/Fingerprint
exists, but I don't know how this can generate unique hash for every PC. (reading some comment on DC, people says its not unique everytime which I expected to be. Without the power to read system data there is no such thing as fingerprint)

MTA serial system can no longer be trusted. Serials can easily be spoofed into anything. What can we do to prevent cheaters from coming back? Ban by nick? They choose another. Ban by serial? They spoof it. Ban by IP? They use VPN. Implement VPN-Detect API usage? There are VPN IPs which won't be detected by any of the apis on the internet even if you pay for one.

Topic about map/mod optimisaiton: This PR would sufficient their needs as well, however I maybe read something which I misundrstood, but you can't avoid some players to not to download some files if their PC is lowend. On connect every running resource will be automatically downloaded. You can disable certain things to be loaded for e.g textures which would be the benefit of this PR. (maybe I misread something there are huge ammount of comments anyway)

I just would like to read the answers and reason why knowing such hw infos of a user would break user privacy.
For example I use now i5-9300h processor. What do you can do now? Even if I gave my IP, the worst thing could happen is a DDoS attack, as geolocating hardly works well. Especially with cgnat ips.

@TracerDS

TracerDS commented Nov 6, 2024

Copy link
Copy Markdown
Contributor

Not everyone shares your opinion.
Its very controversial what an app should and should not do. Mta was always focused on privacy.
I wouldnt like someone reading my private messages. Whatsapp has e2e encryption iirc. That makes it somewhat safe that no one apart from me and the user I message will see that message.
I also hope no one backdoored discord to spy on us.

That being said it all depends what will we introduce to mta. Collecting machine info only? Okay, fair.
Collecting basic system info such as Windows version, architecture? Fair enough.
Collecting something more? Absolutely not.

@ghost

ghost commented Nov 6, 2024

Copy link
Copy Markdown

Collecting machine info only? Okay, fair. Collecting basic system info such as Windows version, architecture? Fair enough. Collecting something more? Absolutely not.

I understand that there are different opinions, thats not the problem. What I don't understand is having a CPU name how can be malicious to a user if a server knows what CPU the player uses?

I comepletely agree with all these you wrote (in quoted) This is what I wrote as well in more detail.
Only difference between us is the private messages. I don't want to argue on it as it would be hugely OFF topic, but I do understand all concerns about it.

@botder

botder commented Jan 1, 2025

Copy link
Copy Markdown
Member

I still don't really see a convincing reason why a script/server/client needs this sort of information. For process memory there is getProcessMemoryStats. And please don't tell me you're going to build a huge CPU database/list just to determine the strength of the computer - we could let the user set a performance switch in the settings. When it comes to privacy, less information is always better. When it comes to fingerprinting/anti-cheat, returning fake information from Lua functions is child's play - the information is worthless.

@starfleet001

Copy link
Copy Markdown

When it comes to fingerprinting/anti-cheat, returning fake information from Lua functions is child's play - the information is worthless.

There are ways to make it harder for client to fake this information. Implement getSystemInfo on server side. Send packet with client specs to the server on connection as part of other client data. Sure, it will not stop last gen cheats from sending fake packet. But it's usually harder to do than hooking and spoofing Lua data on client side. And it is better than relying on client side function.

The truth is this. The current state of MTA AC leaves servers no choice but to fingerprint cheaters and try to make ban evasion as hard as possible. Accounts system with 2FA don't stop the abuse and don't even slow down cheaters anymore. Getting hardware information is also important to make better security for normal accounts (users) and prevent potential abuse.

we could let the user set a performance switch in the settings

So instead of good performance profiling you suggest to add new setting that could be abused by any user (in a lot of cases servers use more optimized but less accurate approach for different things on low end computers and it's ok as long as the number of low end computers isn't too high but if any user with good specs can fool the server by using this simple setting then it will potentially create more competitive advantage issues than any current solution that is based on client specs).

@PlatinMTA

Copy link
Copy Markdown
Contributor

we could let the user set a performance switch in the settings
So instead of good performance profiling you suggest to add new setting that could be abused by any user

I think that adding a server graphics option in the configuration could be quite useful, but yeah the profiling would be good to catch cheaters and ban evasors (serials are simply too easy to spoof, when serial2)

@botder

botder commented Jan 2, 2025

Copy link
Copy Markdown
Member

There are ways to make it harder for client to fake this information. Implement getSystemInfo on server side. Send packet with client specs to the server on connection as part of other client data. Sure, it will not stop last gen cheats from sending fake packet. But it's usually harder to do than hooking and spoofing Lua data on client side. And it is better than relying on client side function.

Since the code here is going to be public, it will only be a matter of minutes/days until cheaters will submit fake data.

The truth is this. The current state of MTA AC leaves servers no choice but to fingerprint cheaters and try to make ban evasion as hard as possible. Accounts system with 2FA don't stop the abuse and don't even slow down cheaters anymore. Getting hardware information is also important to make better security for normal accounts (users) and prevent potential abuse.

Have you tried blocking IP ranges and access from non-domestic IP ranges?

we could let the user set a performance switch in the settings

So instead of good performance profiling you suggest to add new setting that could be abused by any user (in a lot of cases servers use more optimized but less accurate approach for different things on low end computers and it's ok as long as the number of low end computers isn't too high but if any user with good specs can fool the server by using this simple setting then it will potentially create more competitive advantage issues than any current solution that is based on client specs).

What do you mean fool the server? If the user is dumb enough to request higher fidelity graphics and their game runs at 5 FPS, then it's a user problem. And if we're talking about actually good players, then they will want to play on the lowest setting anyway, to increase average FPS, smoothness and distractions by details. You're doing something wrong if players gain a clear advantage on lowest settings.

@starfleet001

Copy link
Copy Markdown

Since the code here is going to be public, it will only be a matter of minutes/days until cheaters will submit fake data.

You are in the position to make it harder to bypass. It would be more beneficial for everyone if things like this would be handled by netc (so creating interface with hardware information).

Have you tried blocking IP ranges and access from non-domestic IP ranges?

Of course. It helps to keep amateur cheaters away. But we have to deal with targeted attacks from time to time. These developers usually use compromised domestic routers for proxy. And you'd be surprised but in a lot of cases they don't bother properly spoofing hardware data to evade restrictions. So better profiting in this case would definitely help.

Also there are legitimate use cases for VPN. Blocking it completely reduces the number of potential players. Every day more countries add more restrictions for its citizens (we are slowly moving into the dark ages of the internet worldwide). So the use of VPN is becoming new norm for good players.

You're doing something wrong if players gain a clear advantage on lowest settings.

I was just talking about uselessness of any "preferred quality" setting. Because it wouldn't reflect what user hardware is actually capable of.

@PlatinMTA

PlatinMTA commented Jan 5, 2025

Copy link
Copy Markdown
Contributor

I was just talking about uselessness of any "preferred quality" setting. Because it wouldn't reflect what user hardware is actually capable of.

Really useful, I don't understand the argument being made here, they are just graphical settings dude I would be pissed off if the developer chose my graphical settings for me. I want to be able to set my own graphical settings, some players prefer more FPS, some players prefer more visual fidelity (not that much to get from renderwave in 2025 but you get the point).

In my case as a server developer, I have a big ass config panel in which you can change most things, from controls to graphical settings. It would be pretty nice to set the default values depending on their preferred style of gameplay rather than hardware information (this can be already be done, but a global solution would just up the QOL for every user... eventually server owners will take this into account, hopefully. still a really easy thing to integrate), then again with either approach the user should be able to choose what things should be ON or OFF. If something should be always ON, then dont make it togglable, simple as

@starfleet001

starfleet001 commented Jan 5, 2025

Copy link
Copy Markdown

Really useful, I don't understand the argument being made here

Then I'd suggest to create new issue specifically for this feature. It's not related to this PR anyway. I'm not arguing that it could be useful for someone. The thing is... This "graphics" setting already exists (fx quality, draw distance, etc.). I set my custom gamemode settings to low, medium or high by default based on user selected setting from the game.
This is what I tried to explain. It's redundant. But I have nothing against it and it doesn't make sense to argue about it.

"Preferred quality" setting doesn't solve the need for hardware profiling (to know the exact capabilities of user hardware). There are other use cases for this besides fingerprinting. It was already discussed earlier in this topic.

If someone here is worried so bad about function that would return not personally identifiable hardware information then just add new checkbox to disable it (enabled by default). MTA already uses this approach for "screen upload" functionality. This is the most optimal solution that would satisfy everyone in my opinion.

@PlatinMTA

Copy link
Copy Markdown
Contributor

"Preferred quality" setting doesn't solve the need for hardware profiling

Totally agree, I also agree that this should be handled in a way that scriptkiddies have a hard time circumventing (in netc for example)

@ghost

ghost commented Jan 5, 2025

Copy link
Copy Markdown

Well as I see there are two types of opinion for this PR, one for the performance part and the other one for a new fingerprinting opportunity.
As I already wrote a little while ago, to make a good fingerprint based on this systeminfo func we would need way more details than this PR would give us.

--
We have tried to block IP ranges as well as blocking a whole country (because 90% of the players from that country were all cheaters)

They started to use vpn, we started to use a detector api for that but now they found vpn services which won't get detected by any of the best vpn detector apis.

We also faced a problem which occured among good vpn users. They used vpn to connect to our server because the vpn service gave them better routing so they had -60ms. Now they can't use that.

They can spoof their serial into anything, not only generating new ones but setting it to other player's serial or set it to an insult word (recently a PR changed this so they have to spoof their serial into a real looking one)

So from our viewpoint a new fingerprinting system would be highly appreciated.
We already protected our gamemodes so they can't cause much harm but they can do pesky things. Currently the only solution is to manually ban them when they cheat.

@botder

botder commented Jan 6, 2025

Copy link
Copy Markdown
Member

@derxgbb The solution to this would be to update the serial system, from my point of view.

@ghost

ghost commented Jan 8, 2025

Copy link
Copy Markdown

@derxgbb The solution to this would be to update the serial system, from my point of view.

If that's possible to update that system in a way where malicious users will not be able to spoof/fake their serials then its okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feedback Further information is requested stale Inactive for over 90 days, to be closed

Projects

None yet

Development

Successfully merging this pull request may close these issues.