Raised This Month: $51 Target: $400
 12% 

Query/Manage SRCDS from Web


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 04-11-2018 , 18:18   Query/Manage SRCDS from Web
Reply With Quote #1

Hi guys,

I'm trying to create a rent/booking system for a few warservers using SourceQuery.
I've got all things up and running, but noticed that the rcon set using SourceQuery, or any other method other than just the editing CFG-files, are just session-stored and removed on changelevel.

I've tried to use host_writeconfig to create a config which SourceQuery writes to, and then serverconfig will exec that config... but the command "host_writeconfig" does not seam to work in SRCDS(?)

Anyone here got an idea of how I could manage this? .. or maybe even a better way of doing this?
__________________
CAOSK-ESPORTS.COM
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-11-2018 , 18:29   Re: Query/Manage SRCDS from Web
Reply With Quote #2

Quote:
Originally Posted by Schpraaankiii View Post
I've got all things up and running, but noticed that the rcon set using SourceQuery, or any other method other than just the editing CFG-files, are just session-stored and removed on changelevel
One of your config files is overwriting them, remove the cvars in question from all config files automatically executed on map change and your rcon-set values will persist (you can use autoexec to only set things on first start).
__________________
asherkin is offline
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 04-12-2018 , 05:43   Re: Query/Manage SRCDS from Web
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
One of your config files is overwriting them, remove the cvars in question from all config files automatically executed on map change and your rcon-set values will persist (you can use autoexec to only set things on first start).
Thank you,
But now I've found another issue.. Maybe you know a way around this...
If I use SourceQuery to change the RCON when someone rent the server, the player himself can use the RCON to change rcon_password, which would then make the web fail when it tries to use the previous rcon from the database. Is there a way to somehow log when the rcon is changed or somehow give a client rcon but not access to change rcon_password?
__________________
CAOSK-ESPORTS.COM
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 04-12-2018 , 06:12   Re: Query/Manage SRCDS from Web
Reply With Quote #4

Quote:
Originally Posted by Schpraaankiii View Post
But now I've found another issue.. Maybe you know a way around this...
If I use SourceQuery to change the RCON when someone rent the server, the player himself can use the RCON to change rcon_password, which would then make the web fail when it tries to use the previous rcon from the database.
If you are giving someone full access to the server, that's literally what happens.

Quote:
Originally Posted by Schpraaankiii View Post
Is there a way to somehow log when the rcon is changed or somehow give a client rcon but not access to change rcon_password?
If you also run MetaMod and/or SourceMod, you could of course try creating a plugin that fits your need 100%, such as by attempting to "lock" the password and prevent changes, however, with rcon access, he/she would still be able to unload the plugin and thereby prevent it's tasks from working.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 04-12-2018 , 07:21   Re: Query/Manage SRCDS from Web
Reply With Quote #5

Quote:
Originally Posted by arne1288 View Post
If you are giving someone full access to the server, that's literally what happens.
Well yeah ofc, but maybe there's a way to log their actions to be able to undo them at a later point(?)
Maybe dublicate the config when the server is rented and then execute the duplicate when the time has passed or something(?)

But then again, if they change RCON, the webserver would not have access to query and execute that config...

Quote:
Originally Posted by arne1288 View Post
If you also run MetaMod and/or SourceMod, you could of course try creating a plugin that fits your need 100%, such as by attempting to "lock" the password and prevent changes, however, with rcon access, he/she would still be able to unload the plugin and thereby prevent it's tasks from working.
Sadly these servers cannot run any mods. They need to be qualified to host larger tournaments and such.
__________________
CAOSK-ESPORTS.COM
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 04-12-2018 , 07:31   Re: Query/Manage SRCDS from Web
Reply With Quote #6

Quote:
Originally Posted by Schpraaankiii View Post
Well yeah ofc, but maybe there's a way to log their actions to be able to undo them at a later point(?)
Maybe dublicate the config when the server is rented and then execute the duplicate when the time has passed or something(?)

But then again, if they change RCON, the webserver would not have access to query and execute that config...
1. Set a rcon password in server.cfg / etc. Let's name this "Default RCON".
2. When they rent the server, change "Default RCON" into some random generated RCON, and remember that random generated RCON, which is the one you give to your "client", who rents the server.
3. Once the rent period is up, if neither the last generated RCON nor the "Default RCON" works, you can then (if you use Linux with the srcds_run wrapper, at least), kill the relevant srcds_linux process, which would make the wrapper auto re-start the server, and after this auto re-start, the rcon will be become "Default RCON" again.

Next time someone rents it, you obviously just continue the same procedure by giving them a new random generated RCON, and make your system change the rcon_password into that one.

Quote:
Originally Posted by Schpraaankiii View Post
Sadly these servers cannot run any mods. They need to be qualified to host larger tournaments and such.
And sadly, without any kind of plugins, you're quite limited with options.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 04-12-2018 , 10:02   Re: Query/Manage SRCDS from Web
Reply With Quote #7

I think I'll create a small java app that checks for the datetime within the MySQL DB and then just kills the servers if the time has passed. Watchdog (Batchscript) and/or Wrappers (depending on OS) will then restart the server with the default rcon which is set in autoexec. This solution shouldn't require anything but Java om the hostmachine. For now that will have to do.
__________________
CAOSK-ESPORTS.COM
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode