• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

File read: ini

-=THOR=-

FNG / Fresh Meat
Sep 20, 2011
1,050
50
0
What is the easiest way of reading an ini file (e.g.: ROEngine.ini) from a mutator? I didnt find any I/O api, except for writing.
 

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
You can re-load an ini file by calling ReloadConfig(), but it will just re-load the part belonging to the class from which you call that function. If you want to read from ROEngine.ini, then you probably need to access the data over the ROGameEngine class. Something like:
Code:
var ROGameEngine eng;
eng = ROGameEngine(class'Engine'.static.GetEngine());
Variable eng will then be your access point to the ini file.

More info can be found here [url]http://udn.epicgames.com/Three/ConfigurationFiles.html[/URL]
 

-=THOR=-

FNG / Fresh Meat
Sep 20, 2011
1,050
50
0
Hmm, the problem I see with this approach, is that some variables are still impossible to reach from the class, as explained here:

http://forums.tripwireinteractive.com/showthread.php?t=78454

My ultimate objective is to copy an INI file from a client to the server, for validation purposes (ini tweaks...). Since there are 1000+ variables in ROEngine.ini, it would take a loooong time to code 1 attribute at a time, and since some variables cannot be reached, I would be unable to rebuild a complete INI on the server. I would rather like to transfer the whole file as a string... But atm, the problem is that I didn't find any API that could read a config file in "raw" mode.

I wonder if one of the game DLL contains a FileReader... if it was the case, I could make a DLLBind and use that method... Another option might be to use something else to read, like a kinda "MovieReader", but just read, do not interpret as movie... But so far there's not much documentation about any kind of file reader...
 
Last edited:

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
Those that you can't find in any of the Engine classes are probably coded in native code (C++).

About a file reader, well I think you will need to write native code for that and then use an unreal script class as a wrapper to gain access to the file functions in your native code.
But you should be aware that you will be getting on tricky waters. Unreal script has no direct file access api, because it could be misused to send "personal" data to a server. If such an api would be there, then a freaky server admin could simply write a spy mutator and put it on his server. Then when a player connects, the mutator will be send to the client and the player won't be aware that he is having a mutator on his PC that might be sending any personal files to a server.
 

-=THOR=-

FNG / Fresh Meat
Sep 20, 2011
1,050
50
0
Yeah I'm aware of the potential privacy problems it could create, so that's why I would limit the mutator to the RO2 config files.

Using DLL Export Viewer in the RO2 binaries folder, I found that there is a File class in "wxmsw28u_vc_custom.dll" (or the debug version, "wxmsw28ud_vc_custom.dll"). It allows to read and write. I wonder how hard it would be to DLL bind to it.... but the challenge seems interesting :)

http://docs.wxwidgets.org/2.8/wx_wxfile.html
 
Last edited:

-=THOR=-

FNG / Fresh Meat
Sep 20, 2011
1,050
50
0
Unfortunately it doesn't seem that DLLBind supports constructor calls, so I can't instantiate a wxFile. The underlying static methods, wxOpen, are not exported, or the DLL that contains them is nowhere to be found in the directory, so no chance this way :/. I guess I'll have to do it the hard way, 1 variable at a time...
 
Last edited: