Page 1 of 1

Remote GUI

Posted: 13 Jul 2005 03:45
by FoxAlpha
Hi all,
i plan to make a Remote Control GUI for dedicated Server.

I am only at the beginning.

Code: Select all

My little Roadmap
[*]Make a new Window ingame
[*]Ask user for RCon Passwd
[*]Send a little Command to Verify Passwd
Perhaps Pause/Unpause an a little Message
[*]Make the GUI Patch  settings like and add Server related Options.
[*]Make GUI only available if  Network Game and not imgame Server.
Ok and now i have some questions.
I have make a window, thats work.
For the passwd confimation i tried to ask the user per ShowQueryString(), i thing this is a good way. But it doesnt work. It should apear before the GUI comes up and the GUI should only show when the passwd is correct.
Where and in which way must this function be called ?
And where and how can i get the string the user had typed in ?
And at least how can i send a simple command to the Server and check if the command was executed ?

I hope someone could/would help me to make a remote control.
Fox

Edit: Correct some missunderstandings in text

Posted: 13 Jul 2005 11:05
by Korenn
so you want a GUI for dedicated server commands? sounds like eyecandy, not really useful..
You could perhaps write it in Java, so that it's platform independent

but I don't think it's worth all the work just to avoid a little typing...

Posted: 13 Jul 2005 13:59
by FoxAlpha
i try to write it ingame, so it will be plattform indipendent.

And otherwise i have no plan of java so i cant write it in java.

Fox

Posted: 13 Jul 2005 18:02
by Pixel du Rezo
I give some tries to such a thing a couple of days ago, and I'll continue when I'll have more time...
BUt my goal is not to make this GUI ingmae, but to make a PHP class that communicate with the server.

My first attempt shows me that I surely need to patch a little the server side of the game in order to do this.
I'm doing this because I runs some openttd dedicated servers, and it could be great if I could have all the config on on page, with an access from everywhere. So internet is the best solution IMO.

For informations, my servers are the "PaTaPoN" (for at the moment I'm writing).
Now, 1 is running the official 0.4.0.1,
2 are running r2424i4 (1 with pass , the other "public")
1 running a server-side modified r2424i4.

Posted: 14 Jul 2005 23:47
by }T{Reme [Q_G]
Pixel du Rezo wrote:My first attempt shows me that I surely need to patch a little the server side of the game in order to do this.
Are you sure you are doing it right? Sounds more like a bug in your networking code. Networks are pretty transparent... it doesnt care less if your program runs on linux windows mac or whatever language its in (assembler java C python etc), as long as you stick to the protocol. You are using the (experimental) socket library arent you? If not, you should try it.

Do remember PHP scripts are one-shot things... You will need to re-connect every time you want to execute a command on the server. That is... unless you would write some PHP-based daemon... but thats way too advanced for what you are trying to accomplish.

Posted: 15 Jul 2005 00:12
by Hackykid
Well, the problem might have been that ottd doesnt allow someone to send rcon commands unless he joined the game already (iirc). Of course you can fake this joining with your self-written client. but it may be cleaner (better) to have it work without needing to join, which would need some modifications to ottd.

Posted: 15 Jul 2005 00:51
by FoxAlpha
Thats the reason why i am trying to make an ingame GUI. Its A LOT easier, i thing.

For ur way u have to modifie the network protocoll and add some commands and for php and other outgame availability u should integrate a new UDP socket where only rcon commands can post with a little autentication.

And u should make an entry in openttd.cfg where everyone can disable it. Or set it on disable on default.

Foxy

Posted: 15 Jul 2005 06:25
by Pixel du Rezo
}T{Reme [Q_G]> I use the library I found in the "website" part of the SVN. Is there a newer one ?
As Hackykid said, I'm not connected as a player of the game, so I can't send rcon commands to the server... or if I could, I didn't succeed in doing it.
Now, I have a lot of work, so my research on "OTTD remote control" are delayed a little.

Posted: 15 Jul 2005 07:43
by }T{Reme [Q_G]
I dunno if its the right library... I mean this one http://nl2.php.net/manual/en/ref.sockets.php It says you need to re-compile it in but you dont really have to... you can load the module (.so or .dll) at runtime with the dl() command (if your configuration allows it).

Ok.. so the problem is that ottd wont allow you to send rcon commands if your not connected to the game.... isnt that also the solution? Try connecting to the game then. It wont require you to modify ottd itself in any way.