Server side messages

General help and assistance forum.
Post Reply
grrfield
 
Posts: 39
Joined: Thu May 05, 2016 7:52 am

Server side messages

#1

Post by grrfield » Thu May 05, 2016 7:59 am

Hi,

I see that on servers hosted on BE or or others as well, sometimes the server sends out a message a regular intervals, with announcements for events or scheduled maintenance and other stuff. Currently i'm hosting a couple of servers on a raspberry pi and i'm trying to figure out how i can make this work for myself. I really have no clue, searched on the interwebs, but with no avail. The only thing I found was the "puke" command, but that relates to scrips within the wad itself. Some help or at least a clue where to look would be very much appreciated.

User avatar
DevilHunter
Zandronum Tester
Posts: 635
Joined: Sun Jun 17, 2012 12:58 am
Location: Alaska, USA
Contact:

Re: Server side messages

#2

Post by DevilHunter » Thu May 05, 2016 10:13 am

Those messages are hardcoded into BestBot's source far as I know. There was this other mod way back when... (maybe in the skulltag era?) where it would have random MOTD's popup on the Screen. And.. I think it was either Merc's 1.9 or SST that had similer messages show up, but I have no clue how that works.

I'm sure someone else here has a way of doing it. OR... you could just deploy the bestbot onto your Server, but that would require having a website, HD space for wads/configs, MySQL exp, and whatnot...

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

Re: Server side messages

#3

Post by Lollipop » Thu May 05, 2016 12:25 pm

Can't you access those server with rcon through automated commandline or similar? That would be the easier option I think. I don't use rcon or commandline commands, so I don't really know much about this, and it also depends on the OS of your RasPI how you are supposed to achieve this.
Some kind of commandline script that runs indefinitely until you terminate it that spits out a message to a server through rcon is my best bet.

User avatar
Sean
IRC Operator
Posts: 982
Joined: Thu Jan 16, 2014 9:09 pm
Location: United Kingdom
Clan: Zandronum
Clan Tag: [Za]
Contact:

Re: Server side messages

#4

Post by Sean » Thu May 05, 2016 8:07 pm

You could make an alias, using the wait command:

Code: Select all

alias globalmsg "wait 126000; say This is a global message; globalmsg"; globalmsg
126000 = 35 * 60 * 60 (an hour)
<capodecima> i dont say any more word without my loyer jenova

grrfield
 
Posts: 39
Joined: Thu May 05, 2016 7:52 am

Re: Server side messages

#5

Post by grrfield » Fri May 06, 2016 6:41 am

Hi, thank you for your suggestions.

The option that sean proposes seems to be the better/easier one to use for my purposes. I got it working, but i only tested it on the client side (when joining my own server that is). I dont even need rcon to do it. But it does not fit my purposes entirely....

To refine it and make it more general i have to get it automatically running at startup of a new server. It should become a server-side thingy. So the following questions arise:
- where do i define this "alias"? Would that be in ./.zandronum/zandronum.ini or do i put it in a .cfg file?
- how do i execute the command at startup (as commandline parameter or do i put it in some exec.cfg file)?

Good you explained the timer mechanic as well....

And to be complete: i run my servers on a raspberry pi, with raspbian. The server version of zandronum (2.1.2) has been compiled by a friend and he sent me the binary. I start a server by running a small shell script that contains all necessary information (iwads, pwads, flags, map rotation). I have such script basically for each pwad i host (250+ and counting). I know it is a bit of a hassle, but i'm looking for better solutions for this as well (i do everything via cmdline, since that graphical gui is a bit too heavy to work with remotely and is consumes too much valuable resources, better spent for my doom servers :)).

the scripts look a bit like this:

Code: Select all

#!/bin/bash
/home/pi/doom/zandronum-server \
-iwad /home/pi/doom/iwads/doom2.wad \

...other params....

+sv_maxplayers 8 \
+dmflags 3227652 \
+dmflags2 8388608 \
+zadmflags 16 \



&

User avatar
doomista
Forum Regular
Posts: 147
Joined: Sat Mar 07, 2015 6:58 pm
Location: I've been to hell. Twice

Re: Server side messages

#6

Post by doomista » Fri May 06, 2016 9:14 am

grrfield wrote: And to be complete: i run my servers on a raspberry pi, with raspbian. The server version of zandronum (2.1.2) has been compiled by a friend and he sent me the binary. I start a server by running a small shell script that contains all necessary information (iwads, pwads, flags, map rotation). I have such script basically for each pwad i host (250+ and counting). I know it is a bit of a hassle, but i'm looking for better solutions for this as well (i do everything via cmdline, since that graphical gui is a bit too heavy to work with remotely and is consumes too much valuable resources, better spent for my doom servers :)).
I didn't even realize there's is such thing as server zandro, I am hosting homeserver from the regular executable. Anyways, I do server setup from the script too (win10, batch). Basically the script asks three questions: what the gamemode will be, what the mappack will be and what the weapon mod will be. Since I have around 30 wads to choose about, it's pretty well manageable. But the point is: choosing a gamemode points me to a specifig config and choosing a pwad points me to a specific config. These two are then merged to a special temp config which is then loaded to the zandro. I find this pretty convenient as I have files with small number of lines which can be easily altered and I also don't have to care about all possible combinations since I am merging config files into a very unique mix.

If you restart your server on a daily basis (you probably don't, but it can't hurt, so why not), you can set your motd in the config via script. Since you can take advantage of bash and arrays, it would be pretty easy.

EDIT: Hope you have bash on raspbian. I am not a linux user nor it's fan, I have bash in form of cygwin because of college so I don't have any idea what kind of unix/linux raspbian is

grrfield
 
Posts: 39
Joined: Thu May 05, 2016 7:52 am

Re: Server side messages

#7

Post by grrfield » Fri May 06, 2016 2:31 pm

It took me some time to get it working, but this does the trick (after successfull RCON login that is):

Code: Select all

RCON alias globalmsg "wait 10000;say Visit http://grrfield.duckdns.org; globalmsg"; rcon globalmsg
I guess i just have to create an alias in my ini-file to get it working and by calling an exec.cfg or so, or can i have it in my cfg as well?

User avatar
Sean
IRC Operator
Posts: 982
Joined: Thu Jan 16, 2014 9:09 pm
Location: United Kingdom
Clan: Zandronum
Clan Tag: [Za]
Contact:

Re: Server side messages

#8

Post by Sean » Fri May 06, 2016 2:47 pm

You can have it in your config.
<capodecima> i dont say any more word without my loyer jenova

grrfield
 
Posts: 39
Joined: Thu May 05, 2016 7:52 am

Re: Server side messages

#9

Post by grrfield » Sat May 07, 2016 4:15 pm

Well guys,

thanks for helping me out on that one. Still have to test and tweak some more thoroughly, but i'll get there.

Two more questions though:
- can the "wait" command cause lag to other players (someone was complaining about it). Remember that a Pi is not a real workhorse....
- that "wait" command seems not not work "regular". I mean that the interval sometimes seem to vary noticeable....


thanks

User avatar
Sean
IRC Operator
Posts: 982
Joined: Thu Jan 16, 2014 9:09 pm
Location: United Kingdom
Clan: Zandronum
Clan Tag: [Za]
Contact:

Re: Server side messages

#10

Post by Sean » Sat May 07, 2016 4:51 pm

grrfield wrote: - can the "wait" command cause lag to other players (someone was complaining about it). Remember that a Pi is not a real workhorse....
No
grrfield wrote: - that "wait" command seems not not work "regular". I mean that the interval sometimes seem to vary noticeable....
IIRC there's a bug that makes the wait command wait for twice as long as the value specified.
<capodecima> i dont say any more word without my loyer jenova

Post Reply