Remote GUI

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
FoxAlpha
Engineer
Engineer
Posts: 85
Joined: 06 May 2005 18:19
Location: Germany
Contact:

Remote GUI

Post 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
Last edited by FoxAlpha on 13 Jul 2005 14:03, edited 1 time in total.
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post 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...
FoxAlpha
Engineer
Engineer
Posts: 85
Joined: 06 May 2005 18:19
Location: Germany
Contact:

Post 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
Pixel du Rezo
Engineer
Engineer
Posts: 22
Joined: 11 May 2005 09:10
Location: Rueil-Malmaison (IdF, France)

Post 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.
}T{Reme [Q_G]
Route Supervisor
Route Supervisor
Posts: 389
Joined: 04 Feb 2004 23:24
Contact:

Post 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.
Siggy not gonna work unless someone allows javascripting...
User avatar
Hackykid
Traffic Manager
Traffic Manager
Posts: 157
Joined: 22 Nov 2004 16:04
Location: Eindhoven de Gekste!!! (ongeveer ;P)
Contact:

Post 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.
DopeFish Lives!!!
FoxAlpha
Engineer
Engineer
Posts: 85
Joined: 06 May 2005 18:19
Location: Germany
Contact:

Post 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
Pixel du Rezo
Engineer
Engineer
Posts: 22
Joined: 11 May 2005 09:10
Location: Rueil-Malmaison (IdF, France)

Post 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.
}T{Reme [Q_G]
Route Supervisor
Route Supervisor
Posts: 389
Joined: 04 Feb 2004 23:24
Contact:

Post 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.
Siggy not gonna work unless someone allows javascripting...
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 13 guests