back to index

Dragon King now has the ability to interact with external programs. This can be used for anything other developers can think of but for now, the only app that is designed for this communication is johnny5 (the controls viewer program). So for the benefit of my users, this section will use the viewer as it’s example.



Ok if you open up your frontend.ini you’ll see the following new section:

[Communication Options]
There is too much to Document about remote communication here. Visit the Online docs for info.
Note: Even if this is set to off, you can force launch an app in mode 2 by pressing uilaunch.
**-1=Off
**0=winsock(TCP)
**1=winsock(udp)
**2=Shell
**3=WriteText

CommunicationMode=-1

Port=
RemoteIp=
CommunicationAppPath=
communicationAppEXE=

WaitUntil=1000
TextPathandName=
DataToSend=

As you notice there are 3 types of communication. The first two are simply place holders. They are currently broken but will be useful for communication over a lan or the internet. This means you can use dk “dail out” to other apps on your lan or whatever you can dream up. But for now they are broken so just ignore them. Port and remote ip are two settings that only apply for winsock modes. So we can ignore them. The com app path and exe are obvious. They are the path and name of the application you wish to talk to. It is ignored in modes 0 and 1. In mode 2 it is used to launch the app initially when dk starts and to close it again when dk exits. For the shell mode it is used to constantly close and reopen the app when the current selected game changes. The wait until value is the time, in milliseconds, after the list has stopped before the data is sent. I recommend a minimum of a 1000 delay (one second) for any application. The text path and name is used exclusively for the text mode. In text mode a text file is written whenever you have new data. You code your app to constantly check this text file for changes and react accordingly. This is useful for “always on” local applications. The data to send is our bread and butter. We can send various info about the currently selected game in the form of a “command line like” string. Check the “Command line Tags” section of the documentation for a list of all available options. One more thing, which is important to how we will use the options. You’ll notice within dk that there is a new function in the keyboard menu. The “External App” key will launch the external app and send it data even if the communication mode is turned off. This is what we are going to do. This way we can look at the viewer on a key press and exit out of the app manually.



Ok finally to are example….. we want the following variables to have the following values.

CommunicationMode=-1

CommunicationAppPath=d:\pathtoviewer\
communicationAppEXE=johnny5.exe

DataToSend= %#0 –clone %#4

Of course replace “d:\pathtoviewer” with wherever you installed johnny5.



That’s all that is required to make the viewer launcher at the press of a key. Now when you are in dk you can press “external app” key and get a fullscreen layout of the games controls.



Note to Developers:

We are sending the “rom name” and the “clone of” data in the listinfo.dat This is how you should do it in your fe as well. Don’t use a clone name for the rom name and not include a parent name (cloneof). It will work, but it’s far less accurate as the viewer will assume it’s a parent rom. Also of note is when a rom doesn’t have a “clone of” value (this means it’s a parent rom) dk internally sets the “cloneof” value equal to the rom value. You should probably do this as well.

 

 back to index

 


Copyright © 2007 Howard Casto. All Rights Reserved.