Raised This Month: $ Target: $400
 0% 

rcon commands in a .cfg file?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
speedreeder
Junior Member
Join Date: Dec 2009
Old 02-08-2010 , 10:50   rcon commands in a .cfg file?
Reply With Quote #1

I want to be able to tell my SourceTV relay to start recording a demo via my in game sm_admin menu. I thought that i could write a file called TV_on.cfg that would achieve this. However, when i run this script from the menu nothing happens. Is it possible to run rcon commands from a .cfg file? If not, what should i do in this case?

TV_on.cfg:
Code:
rcon_address relay_ip:27015
rcon_password ****
rcon tv_autorecord 1
speedreeder is offline
RaMMz
Member
Join Date: Nov 2009
Location: Rosario, Argentina
Old 02-08-2010 , 11:42   Re: rcon commands in a .cfg file?
Reply With Quote #2

---------- confused ----------

Last edited by RaMMz; 02-21-2010 at 16:02.
RaMMz is offline
Send a message via ICQ to RaMMz Send a message via MSN to RaMMz Send a message via Yahoo to RaMMz Send a message via Skype™ to RaMMz
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-08-2010 , 11:49   Re: rcon commands in a .cfg file?
Reply With Quote #3

So what I have tested and how I get it work... (I don't know these a lot)

Source dedicated server(game match) + SourceTV(Master)
SourceTV_relay
Spectator

Source dedicated server + SourceTV(Master)
- Spectators and SourceTV_relay can join and there are like clients.
- If only want SourceTV_relay connect SourceTV(Master) and no spectators, we add commands
- This work if SourceTV_relay have own path and not launched same direction in Source dedicated server(game match)+SRCDS.exe
example:
srcds/counter-strike source/srcds.exe -console -game cstrike -tickrate 66 +mp_dynamicpricing 0 +sv_pure 1 +exec banned_user.cfg; exec banned_ip.cfg +map cs_office +maxplayers 31 +fps_max 600
srcds/SourceTV_relay/srcds.exe -game cstrike -console +tv_relay 127.0.0.2:27020
- Work if sourceTV_relay different computer/place than Source dedicated server(game match)
(+tv_relay IP_to_game-match:27020)
Quote:
Source dedicated server(game match) = ...cfg/autoexec.cfg
Code:
//run SourceTV(Master) work in next map
tv_enable 1

//SourceTV(Master) start autom. record demos
tv_autorecord 1

//How many spectators+SourceTV_relay can connect.
//If 0, only SourceTV(Master) in progress and not allowed any spectators+SourceTV_relay.(Recordin only demos)
tv_maxclients 1

tv_password "spectators_not_allowed_here"
tv_relaypassword "SourceTV_relay_can_connect_with_password"
tv_name "My-match-server_SourceTV(Master)"
tv_title "Welcome our fragmasters-server only spectators can see when connected SourceTV(Master)"
SourceTV_relay = ...cfg/autoexec.cfg
Code:
password "SourceTV_relay_can_connect_with_password"
tv_name "Come look our match through SourceTV_relay"
tv_title "Welcome our fragmasters-server"
tv_maxclients "100"
SourceTV_relay connect Source Dedicated Server(game-match) like client
Spectators can't join SourceTV(Master) but can use SourceTV_relay
- Can't send rcon_commands to SourceTV_relay



Quote:
I want to be able to tell my SourceTV relay to start recording a demo via my in game sm_admin menu
- Rcon_commands can send Source Dedicated Server(game-match) + SourceTV(Master) that uses this tv_autorecord 1/0
If I'm not wrong, SourceTV(Master) records demo.dem files and SourceTV_relay can't...
I tried using rcon to SourceTV_relay
rcon tv_record perkule
Only SourceTV Master can record demos.


So I did make adminmenu_custom.txt so try it if work like you said ?
...addons\sourcemod\configs\adminmenu_custom. txt
Code:
"Commands"
{

    "SourceTV"
    {
        "SourceTV autorecord"
        {
            "cmd"            "sm_rcon tv_autorecord #1"
            "admin"            "sm_rcon"
            "execute"        "server"
            "1"
            {
                "type"         "list"
                "title"        "Autorecord on/off"
                "1"            "1"
                "1."        "On (work in next map)"
                "2"            "0"
                "2."        "Off (work in next map)"
            }
        }

        "Stop Record"
        {
            "cmd"            "sm_rcon tv_stoprecord; say Record stop"
            "admin"            "sm_rcon"
            "execute"        "server"
        }

        "Start Record"
        {
            "cmd"            "sm_rcon tv_stoprecord; sm_rcon tv_record #1; say Record"
            "admin"            "sm_rcon"
            "execute"        "server"
            "1"
            {
                "type"         "list"
                "title"        "Record name"
                "1"            "Admin_menu_slot1"
                "2"            "Admin_menu_slot2"
            }
        }
    }
}
Need admin flag "m"(sm_rcon) to get access here. Change other if you want.
(sm_admin) = b
(sm_kick) = c
(sm_ban) = d
(sm_slay) = f

To set order
addons\sourcemod\configs\adminmenu_sorting.tx t
Code:
"Menu"
{
    "PlayerCommands"
    {
        "item"        "sm_slay"
        "item"        "sm_slap"
        "item"        "sm_kick"
        "item"        "sm_ban"
        "item"        "sm_gag"
        "item"        "sm_burn"        
        "item"        "sm_beacon"
        "item"        "sm_freeze"
        "item"        "sm_timebomb"
        "item"        "sm_firebomb"
        "item"        "sm_freezebomb"
    }

    "ServerCommands"
    {
        "item"        "sm_map"
        "item"        "sm_execcfg"
        "item"        "sm_reloadadmins"
    }

    "VotingCommands"
    {
        "item"        "sm_cancelvote"
        "item"        "sm_votemap"
        "item"        "sm_votekick"
        "item"        "sm_voteban"
    }

   "SourceTV"
    {
        "item"        "SourceTV autorecord"
        "item"        "Stop Record"
        "item"        "Start Record"
    }
}
When enable/disable tv_autorecord 1/0 it work after nextmap and stay (so don't forget).
But not work if you have added tv_autorecord 1 in server.cfg (server execute server.cfg after map change)
I added tv_stoprecord to stop recording and tv_record record demos 2 different name. It will overwrite if using same name.

Those tv_autorecord demos (auto-20100208-2100-cs_office.dem) and my-custom-record are saved in root, example ...cstrike/

I have tested also if you record via admin menu (Admin_menu_slot1) and tv_autorecord 1
- It create (after map change) new demo file with auto-name(auto-20100208-2100-cs_office.dem)
- If tv_autorecord 0 it stop recording after map change.

If this myth busted ?
__________________
Do not Private Message @me

Last edited by Bacardi; 02-09-2010 at 07:15. Reason: edit code / more info /typos
Bacardi is offline
speedreeder
Junior Member
Join Date: Dec 2009
Old 02-08-2010 , 13:01   Re: rcon commands in a .cfg file?
Reply With Quote #4

I suppose i could run the cfg client side.

@Bacardi - The SourceTV ip is different from the IP of the game. I'm using a SourceTV relay to take the stress off the game server.
speedreeder is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-09-2010 , 05:18   Re: rcon commands in a .cfg file?
Reply With Quote #5

*I edit my previous post.
And I assume this way.
SourceTV relay don't record demos. Spectators can join there instead SourceTV(Master)
Can't sent rcon commands to SourceTV relay (At least I didn't get it work)
Can send if correct port (default srcds:27015 and sourceTV: 27016)

SourceTV(Master)(tv_enable 1) record demos in game-server. And accept rcon commands
tv_autorecord
tv_record
tv_stoprecord
__________________
Do not Private Message @me

Last edited by Bacardi; 02-09-2010 at 07:19.
Bacardi is offline
speedreeder
Junior Member
Join Date: Dec 2009
Old 02-09-2010 , 09:04   Re: rcon commands in a .cfg file?
Reply With Quote #6

Wow, way to go above and beyond man, thanks so much.
speedreeder is offline
skittles
Junior Member
Join Date: Mar 2005
Location: England
Old 03-18-2010 , 11:57   Re: rcon commands in a .cfg file?
Reply With Quote #7

TV_On.cfg
tv_record <demoname>

Without the <> would have done it via the config

As such TV_Off.cfg would be
tv_stoprecord

You dont need the rcon in a server .cfg
The following commands should be in your server.cfg as they can be called by the server and are not used when recording as such
rcon_address relay_ip:27015
rcon_password ****
skittles is offline
dungeon
Senior Member
Join Date: Sep 2009
Old 03-19-2010 , 14:39   Re: rcon commands in a .cfg file?
Reply With Quote #8

Admin Demo Record is a much easier way. It auto intergrates into your admin menu and works with very little configuration.

That said Barcardis wtechnique does exactly the same thing.
dungeon is offline
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:10.


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