### How could I hash .mis files?

The original Torque Game Engine.

#### How could I hash .mis files?

Isoplere
Posts: 2
Joined: Thu Jan 17, 2019 9:14 pm
So currently I'm trying to have .mis files hashed so they can't be edited (people cheating) in-game, but the question is whenever I change .mis to .cs and it writes to .cs.dso, the program is able to read and load the stage with the extension ".cs" just fine, but not with ".cs.dso" -- does anyone have any suggestions on how it can read .cs.dso or is this impossible?

#### Re: How could I hash .mis files?

Duion
Posts: 1654
Joined: Sun Feb 08, 2015 1:51 am

In case your game is multiplayer, the .mis files cannot be edited by clients.
In case your game is singleplayer, you need to remove the tools, before you release, obviously, this will make it a little harder, but those who want can still do it.
What exactly are you trying to do here? Did you make a release build with compiled scripts already? If so, what is still left that you want do prevent from being edited?

#### Re: How could I hash .mis files?

Happenstance
Posts: 105
Joined: Sat Apr 11, 2015 9:08 pm
Is this for a multiplayer game? If so, players shouldn't be able to cheat by editing their copy of the .mis file if Torque's client-server model is intact. The way mission loading works by default is the server sends the mission file data to every client when they connect - players don't actually load mission files at all. Any changes a player makes to their copy of the .mis file won't have an effect unless they host a server.

If this is a singleplayer game and you just want to protect the mission files from editing, you might be able to put them in a password protected zip. It's been a decade since I used TGE but if I recall it could read data from zip archives.

#### Re: How could I hash .mis files?

Isoplere
Posts: 2
Joined: Thu Jan 17, 2019 9:14 pm
@
Duion
,

The program is "singleplayer" with all files compiled already. The only problem is -- someone could edit the .mis file(s) to change the skybox...or level number...etcetera. I'm trying to prevent .mis files from being edited.

@
Happenstance
,

Unfortunately, the first worked, but the latter did not. =(

#### Re: How could I hash .mis files?

Happenstance
Posts: 105
Joined: Sat Apr 11, 2015 9:08 pm
Thinking about this some more, there's actually no reason missions couldn't be compiled to .dso. I'm assuming it's failing somewhere in the loading stage because certain parts of the code look for a file with a .mis extension and expect those to be readable text files (see loadMission() and buildLoadInfo()). Those parts could easily be rewritten to just exec the mission file like a normal script and proceed from there.

Another potential option which might work:
1). Compile your mission to dso as you were doing before.
2). Create a blank file, name it <something>.mis and inside this file simply add:

Code: Select all

exec(<your_compiled_mission>.cs); 
3). Now when you load a level, have it load the blank <something>.mis file.

I can't test this right now so it's entirely possible it'll fail as well but might be another avenue to explore.

Oh, and here's an oldie but goodie on adding encrypted zip support:
http://www.garagegames.com/community/re ... iew/9896/2

#### Re: How could I hash .mis files?

Hodo33
Posts: 104
Joined: Fri Dec 29, 2017 4:34 pm
What effect of doing a no TORQUE_TOOLS in the engine vs just deleting the tools directory?
I have an issue where I need to use file open write pathcopy etc but that fails using no TORQUE_TOOLS for release. Can I hoist the functions out of fileSystemFunctions.cpp without causing issues or having no tools directory in the scripts cause issues..

#### Re: How could I hash .mis files?

Bloodknight
Posts: 309
Joined: Tue Feb 03, 2015 8:58 pm
limitations of encrypted zip files as well as potential problems in file comparison between client and server are the only unknowns here as far as I can tell, the .mis files are probably checked more adamantly than others, might be worth chasing that through the circular client/server relationship since to the best of my knowledge they are the only shared files between client and server tho i'm sure others know better than i do.

#### Who is online

Users browsing this forum: No registered users and 1 guest