nikitafloy Posted April 14, 2015 Share Posted April 14, 2015 Hello. I am interested in a way to prevent theft of models (cars, skins) from the server. With what is this possible? What commands? Are there any examples? (In recent years, learned about teaEncode / Decode) Sorry for the translation. Thank you. Link to comment
xXMADEXx Posted April 14, 2015 Share Posted April 14, 2015 You could use teaEncode/teaDecode, but it would be better to come up with your own algorithm for this, because it would a heavy use for the client to have to encode/decode a txd of dff string every time, because they're rather large strings. You should write something this to the dff and txd files: fdsjak actualTxdDffContents dfkadsl and then use string.sub to get the actual contents of the file Example functions: function hideRealContents ( str ) return "dfdaskf"..str.."fkjdsak"; end function getRealContents ( str ) return string.sub ( str, 7, string.len ( str ) - 7 ); end Link to comment
Mr.unpredictable. Posted April 14, 2015 Share Posted April 14, 2015 I am working on a project like this. an application which can encript your models t and you can set password to decrypt it. but i'm facing a lot of problem while doing that. If i finish it, I'll release it. Link to comment
nikitafloy Posted May 5, 2015 Author Share Posted May 5, 2015 You could use teaEncode/teaDecode, but it would be better to come up with your own algorithm for this, because it would a heavy use for the client to have to encode/decode a txd of dff string every time, because they're rather large strings. You should write something this to the dff and txd files: fdsjak actualTxdDffContents dfkadsl and then use string.sub to get the actual contents of the file Example functions: function hideRealContents ( str ) return "dfdaskf"..str.."fkjdsak"; end function getRealContents ( str ) return string.sub ( str, 7, string.len ( str ) - 7 ); end Do u mean it? function getRealContents ( str ) return string.sub ( str, 7, string.len ( str ) - 7 ) end local str = "dfdask" .. "data/elegy.txd" .. "fkjdsak" local str1 = "dfdask" .. "data/elegy.dff" .. "fkjdsak" function replaceModel() txd = engineLoadTXD(getRealContents(str), 562 ) engineImportTXD(txd, 562) dff = engineLoadDFF(getRealContents(str1), 562 ) engineReplaceModel(dff, 562) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) Link to comment
Atton Posted May 16, 2015 Share Posted May 16, 2015 There is no pain free way to make this kind of thing work. But if you are going to use tea then try striping away the base64 layer on the file. Link to comment
Dealman Posted May 16, 2015 Share Posted May 16, 2015 Do u mean it? No, he means to edit the .txd of .dff file itself. With a program such as N++ or whatnot. Link to comment
ALw7sH Posted May 16, 2015 Share Posted May 16, 2015 You should create your own encryption system if someone here give you an idea everyone gonna now how did you encrypt them and they'll know how to decrypt them Link to comment
Atton Posted May 16, 2015 Share Posted May 16, 2015 You should create your own encryption systemif someone here give you an idea everyone gonna now how did you encrypt them and they'll know how to decrypt them You might be able to use xor to make it harder for noobs to mess with files. Link to comment
WhoAmI Posted May 16, 2015 Share Posted May 16, 2015 What about getting content of .txd and .dff file server-side, and while player connects trigger it to clientside and load them as 'raw_data'? engineLoadTXD engineLoadDFF Link to comment
WhoAmI Posted May 16, 2015 Share Posted May 16, 2015 (edited) I've made something server Files = { -- id model, txd path, dff path { 0, "test.txd", "test.dff" } }; Content = { }; addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, v in pairs ( Files ) do local id, txd, dff = unpack ( v ); Content [ id ] = { }; -- getting content of TXD local txdFile = File ( txd, true ); if txdFile then local content = txdFile:read ( txdFile:getSize ( ) ); Content [ id ] [ "txd" ] = content; end -- getting content of DFF local dffFile = File ( dff, true ); if dffFile then local content = dffFile:read ( dffFile:getSize ( ) ); Content [ id ] [ "dff" ] = content; end end end ); addEvent ( "server:getContent", true ) addEventHandler ( "server:getContent", root, function ( ) triggerClientEvent ( source, "client:applyContent", source, Content ); end ); client addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "server:getContent", localPlayer ); end ); addEvent ( "client:applyContent", true ); addEventHandler ( "client:applyContent", root, function ( Content ) for model, c in pairs ( Content ) do local txd, dff = c["txd"], c["dff"]; local loadedTXD = EngineTXD ( txd ); local loadedDFF = EngineDFF ( dff ); if loadedTXD and loadedDFF then loadedTXD:import ( model ); loadedDFF:replace ( model ); end end end ); I really don't know if it will work, but you can try. To make it work you have to turn on OOP in meta. Edited May 16, 2015 by Guest Link to comment
ALw7sH Posted May 16, 2015 Share Posted May 16, 2015 addEvent ( "server:getContent", true ) addEventHandler ( "server:getContent", root, function ( ) triggerClientServer ( source, "client:applyContent", source, Content ); end ); triggerClientServer Link to comment
nikitafloy Posted July 17, 2015 Author Share Posted July 17, 2015 I've made somethingserver Files = { -- id model, txd path, dff path { 0, "test.txd", "test.dff" } }; Content = { }; addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, v in pairs ( Files ) do local id, txd, dff = unpack ( v ); Content [ id ] = { }; -- getting content of TXD local txdFile = File ( txd, true ); if txdFile then local content = txdFile:read ( txdFile:getSize ( ) ); Content [ id ] [ "txd" ] = content; end -- getting content of DFF local dffFile = File ( dff, true ); if dffFile then local content = dffFile:read ( dffFile:getSize ( ) ); Content [ id ] [ "dff" ] = content; end end end ); addEvent ( "server:getContent", true ) addEventHandler ( "server:getContent", root, function ( ) triggerClientEvent ( source, "client:applyContent", source, Content ); end ); client addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "server:getContent", localPlayer ); end ); addEvent ( "client:applyContent", true ); addEventHandler ( "client:applyContent", root, function ( Content ) for model, c in pairs ( Content ) do local txd, dff = c["txd"], c["dff"]; local loadedTXD = EngineTXD ( txd ); local loadedDFF = EngineDFF ( dff ); if loadedTXD and loadedDFF then loadedTXD:import ( model ); loadedDFF:replace ( model ); end end end ); I really don't know if it will work, but you can try. To make it work you have to turn on OOP in meta. Dont work. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now