TV Admin Portal

From ETQWPro Wiki Pages

Jump to: navigation, search
Image:Dialog-information.png

This feature has been added in Promod Version 0.5

Contents

What is it, and why would I need it?

  • Easy to manage Admin GUI for your TV Server
  • Connect your TV Server directly from your Desktop to the Match server.
  • No need of any shell scripts.
  • No additional binaries / server script needed to get it running. Only set 3 cvars in the server cfg!
  • Horrible NetCode (Syntax), i will try to improve this in the next releases.
  • A fully useable Client interface. (windows only at the moment) Interface Example

Server Configuration

You will only have to set 3 cvars, and start the new "server" with a coonsole command.

This console command will be passworded in 0.5 because this feature needs to be tested. If you want to help testing, be sure to Private Message me in #etqwpro @ Quakenet

and i would be happy to share the password with you!

Start your TV Interface in 4 Steps!

  • set tv_adminPass to your fav. password
  • set tv_adminEnable to 1
  • set tv_adminPort to your fav port. Default is 27787
  • spawn a map on the server
  • start the "server" with the command: startTvAdmin <password>
Console Example
]startTvAdmin *******
TV Admin spawned on Port 27787

Client Configuration

There is no client configuration neccessary!

Only download the Client Binaries from HERE (not yet), or write your own Program. For Network Information scroll down!

What can I do with the Client?

  • Connect your server to a matchserver with one click.
  • Saves your last server and matchserver in a simple ini file, to prevent entering this info all over again.
  • History Log of all issued Command.
  • Adjustable cvars
    • Max Viewers
    • Max Players
    • Server Name
    • Private viewer Password
    • Use Password for the TV Server
    • Repeater Password (will get used by other Repeaters that are connecting on your Repeater)
    • Viewer Password
    • Private Viewers
    • Spawn Repeater
    • Repeater Port
    • Repeater Auto Download
    • Switchable Delay between 0 and 90 seconds
  • Ability to use the "say" Command on the server
  • Disconnect from other servers
  • spawn maps on the server
  • Update the client from server
  • Update the server from client

I dont want your Interface, can i build my own one?

Yes you can! But I limited the buffer on the server to 64!

Its a simple TCP Socket that waits for your "call".

The network message MUST look like that if you want to request a cvar value:

password|instruction|cvarID

The network message MUST look like that if you want to set a cvar value:

password|instruction|cvarID|value

The network message MUST look like that if you want to issue a command:

password|instruction|command|params


The password can be as long as you want (rember the buffer issue) and must be followed by a "|".

  • a valid password would be myPassword|

The instruction has to be excatly 3 chars long and must be followed by a "|".

  • a valid instruction would be 000|

The Cvar / Command ID has to be excatly 3 chars long and must be followed by a "|".

  • a valid cvar / command ID would be 000|

Any following chars will be interpreted as params!

  • a valid param would be welcome to our etqwtv Server

The Message must end with a newline \n

Cvar / Command / Instruction Code

All Instructions, Cvars and Commands are identified by three unique numbers.

Instructions:

  • 000 -> Send Command
  • 001 -> Get Cvar
  • 002 -> Set Cvar

Commands:

  • 000 -> Connect to tv
  • 001 -> Disconnect from tv
  • 002 -> Spawn Server
  • 003 -> Say
  • 004 -> Get ViewerCount

Cvars:

  • 000 -> ri_maxViewers
  • 001 -> ri_name
  • 002 -> ri_privateViewers
  • 003 -> ri_useViewerPass
  • 004 -> g_privateViewerPassword
  • 005 -> g_repeaterPassword
  • 006 -> g_viewerPassword
  • 007 -> si_maxPlayers
  • 008 -> net_clientRepeaterDelay
  • 009 -> net_spawnRepeater
  • 010 -> net_repeaterPort
  • 011 -> net_clientRepeaterAutoDownload
  • 012 -> net_repeaterSnapshotDelay

Some examples

You want to say something on the server, and the server password is testPass

 testPass|000|003|Hello to all Viewers, have fun on this TV Server

You want to know the value of the net_clientRepeaterDelay Cvar, and the server password is testPass

 testPass|001|008|

You want to set the value of the g_privateViewerPassword Cvar to "myPass" , and the server password is testPass

 testPass|002|004|myPass

Code Snippets

I wrote the Client in c#, so to help you get into it, here some maybe important Code snippets.

Enums for the cvars


public enum Cvars : int
    {
           CVAR_RI_MAX_VIEWERS                     = 000,
           CVAR_RI_NAME                            = 001,
           CVAR_RI_PRIVATE_VIEWERS                 = 002,
           CVAR_RI_USE_VIERWER_PASS                = 003,
           CVAR_G_PRIVATE_VIEWER_PASS              = 004,
           CVAR_G_REPEATER_PASSWORD                = 005,
           CVAR_G_VIEWER_PASSWORD                  = 006,
           CVAR_SI_MAXPLAYERS                      = 007,
           CVAR_NET_CLIENT_REPEATER_DELAY          = 008,
           CVAR_NET_SPAWN_REPEATER                 = 009,
           CVAR_NET_REPEATER_PORT                  = 010,
           CVAR_NET_CLIENT_REPEATER_AUTO_DOWNLOAD  = 011,
           CVAR_NET_REPEATER_SNAPSHOT_DELAY        = 012,
           NUM_CVARS
       }


Connect to the server and send message


       try {
               System.Net.IPEndPoint ep = new System.Net.IPEndPoint(IPAddress.Parse("yourIP"), Int16.Parse(yourPort));
               socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
               socket.Connect(ep);
               try
               {
                   socket.Send(Encoding.ASCII.GetBytes("Message"));
               }
               catch
               {
               }
           }
           catch (SecurityException ex)
           {
               MessageBox.Show("Server Port not available ->" + ex);
           }
           catch (Exception ex)
           {
               MessageBox.Show("No Route to Host ->" + ex);
           }

Read server message


          byte[] bytes = new byte[64];
           try
           {
               int i = socket.Receive(bytes);
               socket.Close();
           }
           catch 
           {
           }
           return Encoding.ASCII.GetString(bytes);

Personal tools