Anti-Cheat functionality
In previous scripts we read all of the relevant .ini file values on the client maschine in one block and compared that with hardcoded values. The solution had the advantage that it was niether possible to cheat on the client nor the server app.
But, it took nearly 2 seconds to do and was cumbersome to deal with for the scripter if a value was changed on any of the ships. It also required an update of the whole mod if anything was changed!
For SW I think we need an improved concept:
1) check all of the client config values (flux.ini) that have an influence on the mp game.
2) check the keybinds to insure that TRI is not activated.
3) Check the ship .ini files.
When the ship is selected in the players GUI we can create a sim using the players ini.file (but not place it in the world), and then use a switch with the T_type of the ship for the case statement.
For each T_type we would have a list of ini file values to check against a hardcoded value and also check for the correct subsims on the sim. (Thats because some of the scripted functionality is dependent on the existance or non-existance of certain Subsims.)
That would be much faster than simply reading all of the relevant .ini files on a client, regardless of which ship a player has selected.
The above could be done while still in the GUI, it would be fast and also let the player know something is wrong with his files before he even tried to join a game (and not occupy the server with first loading and then rejecting a client)
Items 1 and 2 would cover a server operator too but item 3, as described above, doesn't cover possible cheating by a server host! i.e the host could, for example, reduce the hitpoints on all the other ships, except his own.
The options I see here are:
a) create and check all possible sims via the GUI script before a server is started. This would probably add an additional 3 to 5 secs. load time for the server app. (which is already rather long)
b) Check the servers ship .ini files against the hardcoded reference values as other players enter the game, depending on the ship types that enter. That wouldn't delay loading but, if the host had incorrect files, a message would have to be transmitted, that the game will be terminated in, say 20 seconds, due to server malfunction.
(This would probably fall back on us more than on the server operator as the assumed source of the problem.)
Question:
What is the general view on this subject and are there other options you can think of?
Iwar2 Multiplayer Fan Site
Please Log in or Create an account to join the conversation.
- Roi Danton
- Offline
- Regular
It's quiet important: I would say, option 3a) 'cause it's crappy when the server starts, you're happy to play the scenario and then it ends immediately (or after 20 sec). So checking the ini files on every computer (clients and server) before loading the scenario is the best way.Originally posted by MajorTom
Question:
What is the general view on this subject
I think you can check the ship itself the player has selected instead of checking the whole Ship type. I.e. like (example EA StarFury):and are there other options you can think of?
~Buda5 Designer & Scripter
buda5.firstones.com
~Buda5 Designer & Scripter
buda5.firstones.com
Please Log in or Create an account to join the conversation.
Now we have subsims that are important too:
Example: The CUV ship is recognized by the existance of a "Cargo_engineerreloader" and that triggers the reload and heal functions.
Obviously, other ships should not have that subsim. If you did put it on an A-Wing, you could dock it to an X-Wing and heal it. But you wouldn't notice it in the properties of the A-Wing.ini file.
I would rather not create the sim, but I don't know of a way to check the ships inifile for a subsims existance, without creating the ship. (unless you know the exact template number of it).
Can you think of a way, Roi?
Iwar2 Multiplayer Fan Site
Please Log in or Create an account to join the conversation.
- Roi Danton
- Offline
- Regular
Well, you can look in every template of a sims ini (referring to the example above):Originally posted by MajorTom
I would rather not create the sim, but I don't know of a way to check the ships inifile for a subsims existance, without creating the ship. (unless you know the exact template number of it).
Can you think of a way, Roi?
~Buda5 Designer & Scripter
buda5.firstones.com
~Buda5 Designer & Scripter
buda5.firstones.com
Please Log in or Create an account to join the conversation.
Oh! I just thought:
what if the player made his own subsim .ini.
Or he could change the contents of an existant subsim, for example, one of his less usefull guns.
To heal and reload others, he would only need to change the weapon subsim like this:
[Properties]
name=Cargo_EngineerReloader
Or, if someone wanted to deploy gunstars he could change his X-Wing secondary laser to:
[Properties]
name=Cargo_MiniGunstar
[] I think we will have to create the ship and do something like this:
bool ClientInifilesOk (hsim sim)
{
switch
{
case: T_Patcom // this is the A-Wing
if ( Sim.FindSubsimByName(sim, "Cargo_MiniGunstar") ) return false;
// do the other inifile properties as you suggested in the first post
break;
case: T_Passenger //the cuv ship
if ( Sim.FindSubsimByName(sim, "Cargo_StationReloader") ) return false;
// do the other inifile properties as you suggested in the first post
break;
//ect. ect.
}// switch
} // bool IniFilesOk
What do you think?
btw: the previous versions of the mp mods have 470 lines of code used to get and compare the properties of all the ships and all of the different weapons. They are all still useable but we have even more ini files now.
Iwar2 Multiplayer Fan Site
Please Log in or Create an account to join the conversation.
- Roi Danton
- Offline
- Regular
Good solution against cheating, but I would test the ship.ini before the subsims b/c testing the ship ini is for every ship the same (besides the CUV), but testing the Subsims is different for almost every ship.Originally posted by MajorTom
What do you think?
One ship to load doesn't take so long. Before loading and testing you could focus a screen with the lines "Standby ... perusing the ships check list" or smthg like that.
@Old Version: Maybe for checking the sim.ini it could be helpful? But I wouldn't copy whole passages if they doesn't fit exactly with that what you want to realize here.
~Buda5 Designer & Scripter
buda5.firstones.com
~Buda5 Designer & Scripter
buda5.firstones.com
Please Log in or Create an account to join the conversation.