Jump to content

[HELP] Resource Protection


Skraund

Recommended Posts

Hello, I made a script that encodes the files: PNG, DFF etc.

For this I used:

teaEncode( base64Encode( data ), key )

fileOpen, fileDelete, fileRead, fileCreate etc.

 

I need the user to download coded files into the cache, decode and load into memory, and then encode again. That is, so that as a result, the resources are coded in the cache and the user could not decode them without a key that is known only to me.

But I'm faced with a problem, I do not know how to make sure that after connecting to the server and downloading the resources, the necessary files are decoded and loaded into memory, and then again coded. Who knows how to crank it?

Edited by Skraund
Link to comment

When client download encoded file, you just need to read data from file and decode it and I dont think you need to modify the file at all. And use that buffer to apply texture or dff.

See engineLoadDFF 

Quote

dff_file / raw_data: The filepath to the DFF file you want to load or whole data buffer of the DFF file.

And also for dxDrawImage can be done using dxCreateTexture

Quote

image: Either a material element or a filepath of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring.Use a texture created with dxCreateTexture to speed up drawing.
 

Basically: read file data using fileRead > decode data > apply texture or model using decoded data > close file

I never try this, but I think it should work. Not sure about GUI image.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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