• Does anybody know how game server hosting control panels work? (e.g tcadmin)
    6 replies, posted
Hi guys, I've wanted to know for a long time how these type of control panels allow you to monitor the servers? Since I don't have a copy of tcadmin I can't review or look how it does it, so I can only try to work it out. My thoughts for this at the moment is that you enter the SSH details of the server box, be it a VPS or a dedicated box and it registers it to its database. You then also have to register (to the database again) the details of your actual game server (the SRCDS) on the server box like the directory the server is in the start up commands and such. Then I'm a little lost. I think the web server some how SSHs into the box and executes a command to start the server?? How does the web server know if the ssh command was successful? How can the web panel query the server to see if the server is online? Any information on the ways these systems work would be appreciated!
A few work the way you described in your post (SSH to the server and run commands) and others require an agent running on the server which the control panel communicates with. There are plenty of less popular (than tcadmin) open source control panels you can use or browse the source of on github and other open source repositories. [url]https://github.com/search?utf8=%E2%9C%93&q=game+panel[/url]
Interesting question, it's not all that difficult, you can make it as difficult as you want it. The simplest thing you can come up with is having a process that "manages" all your servers. Forget about user accounts, forget about anything really, just think of a process that keeps track of what "servers" it is running and allows them to be stopped or started. Even then, there are several approaches. You could fire up a process (such as srcds.exe) and store it's PID, so you can check if it's still up, or you can kill it when you want. Another option is running the server application within your other process, as a child process. That way, your manager can use the stdin and stdout of the server process, thus being able to control it. If your manager has some way of taking commands, you can i.e. execute console commands without having RCon enabled. I have been thinking of rolling my own hosting panel because all the ones out there look shit to me. I'm not saying they are shit, I'm not saying I'm better than the people who created them, but there are just a lot of things that I get annoyed about when using / looking at other hosting panels. I see writing one as a learning experience, portfolio work and if I ever get to writing one, I'll sure as hell opensource it without restrictions.
[QUOTE=Cyberuben;49356844]Interesting question, it's not all that difficult, you can make it as difficult as you want it. The simplest thing you can come up with is having a process that "manages" all your servers. Forget about user accounts, forget about anything really, just think of a process that keeps track of what "servers" it is running and allows them to be stopped or started. Even then, there are several approaches. You could fire up a process (such as srcds.exe) and store it's PID, so you can check if it's still up, or you can kill it when you want. Another option is running the server application within your other process, as a child process. That way, your manager can use the stdin and stdout of the server process, thus being able to control it. If your manager has some way of taking commands, you can i.e. execute console commands without having RCon enabled. I have been thinking of rolling my own hosting panel because all the ones out there look shit to me. I'm not saying they are shit, I'm not saying I'm better than the people who created them, but there are just a lot of things that I get annoyed about when using / looking at other hosting panels. I see writing one as a learning experience, portfolio work and if I ever get to writing one, I'll sure as hell opensource it without restrictions.[/QUOTE] Something like would work great with Screen or tmux on linux, then you can grab output, and input stuff with commands
[QUOTE=andreblue;49358521]Something like would work great with Screen or tmux on linux, then you can grab output, and input stuff with commands[/QUOTE] I don't think you even need screen or tmux. C++ has fork(), NodeJS has child_process, I'm sure other languages have other options.
[QUOTE=Cyberuben;49358608]I don't think you even need screen or tmux. C++ has fork(), NodeJS has child_process, I'm sure other languages have other options.[/QUOTE] Ya, but screen and tmux would mean you could mostly control it will shell commands, which means you could drive it with php
[QUOTE=andreblue;49358927]Ya, but screen and tmux would mean you could mostly control it will shell commands, which means you could drive it with php[/QUOTE] I would argue against that. PHP isn't a running process, it's a file that gets executed, then execution stops. Nodejs or C++ applications (and countless other languages) would be a better choice. Websockets in PHP work, but it's far from optimal
Sorry, you need to Log In to post a reply to this thread.