Jump to content

[Release] Simple Admin Debug Tools (in-game script console & remote log extension)


Axe Cop

Recommended Posts

I could not find any ArmA2 debug tool that worked with Epoch so I developed my own little script and dialog to do just some simple things like execute SQF code on the fly (client and server side via custom remote execution). Also I have added my own little extension (DLL) for remote logging to a separate window on the server, so essentially if you want to log some debug info it pops up in that window and not in the RPT file. That logging extension is optional of course but i use it for debgging myself, not on the live server.

 

Is there any interest in tools like this? I can publish my stuff if any admin or script/mod developer may need something like this.. :)

 

Here a simple screenshot what the debug dialog looks like atm:

EbmWAh8l.jpg

 

you can enter any valid SQF script code in the large text field and then execute it locally on the client or via remote execution on the server, the result of the code is displayed in the lower text field (also the result of remote exec), just to simplify it so you won't have to add a log call or "hint str (1+2+3)" instead of just call "1+2+3" or whatever (and yes you can use this as a calculator lol)

 

some screenshots of the remote log:

wvlhptS.png

 

Zmqzmxk.png

 

I've just added a simple log filter at the bottom, so you are able to filter the log entries to match a specified text in real time.

the number in the bottom right cornor means 9 log entries filters out of 26 log entries overall.

 

this ain't pretty but might help with script debugging a lot.

the code to log something in this example is pretty simple:

format["Refueling %1 with %2 fuel",_name,_fuel] call DT_fnc_log;

this is called in my service point refuel script, just as an example how it can be used (keep in mind the refuel script is client side and the log window on the server). :)

 

 

Download: http://dl.bintray.com/vos/dayz/ArmaDebugTool1.0.zip

 

 

Installation Script Console

  1. copy the files RscDebugDialog.hpp and debug.sqf to your MPMission folder/PBO
  2. open your description.ext file and include the debug dialog at the end of the file like this:
    #include "RscDebugDialog.hpp"
  3. execute the debug.sqf from your init.sqf (at the very bottom it needs to be executed on the client and server)
    execVM "debug.sqf";
  4. you can open the debug console by invoking the function DT_fnc_openDialog yourself or by default just press the minus key on the numpad to open it if you are in-game (key can be changed with DT_openKey variable in the debug.sqf file)
    call DT_fnc_openDialog;

you can now use the debug console in game, be aware the custom remote execution on the server might be tricky if you leave BattlEye enabled because many script values are just blacklisted in the publicvariableval.txt filter file, also you need to add BattlEye exceptions for publicvariable.txt:

!="DT_logMessage" !="DT_remoteExec"

I suggest to just disable BattlEye if you want to make use of the remote execution, since this script is only intended for use on a test server anyway ond not for a live server!

If you want to use this on a live server make sure only admins have access to the script console! :P

 

 

Installation Remote Log Extension (optional)

If you want to use the external log window in combination with my log command DT_fnc_log you need to install the extension first.

By default the log window is displayed on the server only, it can be used on the client but on the server makes more sense I think.

The following steps are only server side!

  1. copy the files jni.dll, jni.conf and ArmaDebugTool.jar in your ArmA:OA installation directory (next to Database.dll and the other Epoch files)
  2. since the extension is written in Java you need to install a 32-bit (x86) Java 7 Runtime Environment (JRE), if you don't already have that on your server
  3. open the jni.conf and change the JAVA_HOME path to your JRE installation if necessary

that should be all, you can now use the DT_fnc_log function on the client or server and it should open a separate window with the first log call.

e.g.

"log text" call DT_fnc_log;
(position player) call DT_fnc_log; // on the client
(count vehicles) call DT_fnc_log; // server or client 

or whatever you want to log, string conversion is done automatically so you can log any value or object.

If there are any problems with calling the ArmaDebugTool.jar or Java-VM there should be a jni.log file next to the jni.dll with error information in it.

Also for performance reasons the log window is limited to 1000 log entries, it will remove the oldest one from the top if you log more messages.

 

 

References

Edited by Axe Cop
Link to comment
Share on other sites

This does sound useful especially when testing scripts.

Especially the server side logger as I find it tedious to constantly have to log into my FTP, download the file, find the error in the 1000s of lines of error that are already spat out on a Taviana server.

I would really appreciate such a tool even if you don't publish it a PM with the tool attached would be great :)

Link to comment
Share on other sites

hey, I might publish it later today.. the "problem" is not that I don't want to publish it here but I have to write some instructions and clean up the code a little and stuff like that you know. :p

if you know what you are doing you can try it yourself, the code for the script console and log functions are already available in my GitHub repository: https://github.com/vos/dayz/tree/master/debug

 

The log extension itself will follow later, since I only have a very simple prototype for that. :D

Link to comment
Share on other sites

added some screenshots of the remote log extension and a simple example on how to use it.

code and instructions will follow soon :)

 

btw the log window could also be displayed on the client instead of the server, but this way you can log things from anywhere no matter if the script is running on the client or server. if you don't have access to the server that might be a solution, but this is intended for a test server anyway.

Link to comment
Share on other sites

  • 2 weeks later...

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
  • Discord

×
×
  • Create New...