Jump to content

Using engineLoadCOL/TXD/DFF with string


SDraw

Recommended Posts

Yes, title is dumb. Yes, someone will start to complain "Why do you need it?","You can do it with 'file<>' functions" and etc. But let me explain this.

Just imagine, you made awesome terrain/city/(whatever) model, but you don't want others to use it. Solution? Encryption. There are a lot of methods of encryption (even you can make own).

So, now you have encrypted model. And then pain in the ass starts. Decryption.

You open encrypted file, read it all, decrypt data, save it to temporary file, use engineLoad<>. Ooops, temporary file is decrypted. Someone smart can use it.

1. Ok, let's delete file after importing. Do you think now your model is safe after that? Wrong. It's possible to prevent file deletion and successfully steal model.

2. Let's modify algorithm and put temporary file in random folder. Harder to locate temporary file, but still possible to steal.

3. We can remove encyption and rename file(s) as md5 hash without file type. Still not good. Why? DFF and TXD are connected with textures names, so it's simple to read all files and find similar textures. You can add more problems for thief and always create models with same textures names (wall.dff -> tex0,tex1,tex2; grass-> tex0; etc.), but it won't help. A bit of manual sorting and awesome model(s) is(/are) stolen.

As you see, there is no perfect way to prevent model stealing. And I suggest to improve import functions:

col engineLoadCOL ( string col_file, [ bool is_string = false ] ) 
dff engineLoadDFF ( string dff_file, int model_id, [ bool is_string = false ] ) 
txd engineLoadTXD ( string txd_file [, bool filteringEnabled = true, bool is_string = false ] ) 

Why? Just think. Get it? No? It's sad then.

P.s. I can't create request on BT. It says "Access denied".

Link to comment

Actually, the suggestion makes a lot of sense, even without considerations like "what it is useful for". It's more universal than loading from file because it not only can be used to replicate the same loading from file, but also do more. Whereas doing vice-versa (creating a file, writing the data and loading from that file) is more of a workaround way because it involves the task which is logically not necessary (writing the data from memory to file just to read it back from file to memory) and needlessly slower.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...