New feature to send command every n minutes?

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

New feature to send command every n minutes?

Postby Somnus » 13 Aug 2009, 13:14

I would like Winboard to send a command like "date" to the ICC/FICS servers every 30 minutes so I am not logged out for inactivity.

Anyone know how I would accomplish this?

Peter Skinner
Somnus
 
Posts: 54
Joined: 26 Dec 2004, 03:12
Location: Edmonton, Alberta, Canada

Re: New feature to send command every n minutes?

Postby H.G.Muller » 13 Aug 2009, 14:47

I have considered adding such a "keepAlife" option to WinBoard, but when I proposed it people pointed out the danger that this might lead to banning of WinBoard as an interface with certain ICS operators. These operators do not enforce their time-out policies just to annoy users, and would probably not like people to subvert them.

It seems that it is possible to acheive the same effect by running scripts to invok WinBoard, however.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: New feature to send command every n minutes?

Postby Somnus » 13 Aug 2009, 19:10

As a tournament manager on FICS, there is no issue sending the date command every 30 mins or so.

BabasChess (The interface) has this option and it is not banned on FICS. ICC has the noautologout feature that when set will allow you to stay connected/idle for days if needed. I would just like this enabled in Winboard. Frankly I hate all other interfaces. Winboard is simple, configurable, and lightweight. Does everything I need except a few minor things.

Can I somehow set up for my right click options to prompt a dialogue box?

As in tell (person) and a dialogue box would appear then send the tell to the person?

Peter.
Somnus
 
Posts: 54
Joined: 26 Dec 2004, 03:12
Location: Edmonton, Alberta, Canada

Re: New feature to send command every n minutes?

Postby H.G.Muller » 13 Aug 2009, 21:25

I never used the right-click myself, but why would you want a dialog box to send a tell? You can type that simply in the ICS input field, not? XBoard needs a separate ICS type-in box because there are no separate input and output fields in the ICS interaction window, but WinBoard does not need it.

I agree that sending a person "tells" on an ICS is a pain (especially if you ar admin and have to communicate with a number of persons simultaneously!). But my "grand-design" for improving this is to have additional pop-up windows which are dedicated to communicating with a single person (or channel). WinBoard would defer all messages coming from that CS handle to this window (just like it diverts the opponent's engine kibitz to the Engine-Output window), and anything you would type in the input field o that window would automatically be prefixed with "tell MrX " and sent to the ICS. It should be possible to open as many of those windows as you like, and then enter the name of your discussion partner in a text-edit field in that window. That way you would be able to have more organized discussions.

The keepAlive thing is complicated by the fact that the current WB code supports only a single "scheduled event", which is also used for making the clock tick. So it would be a bit difficult to schedule an event across games. Of course the games would keep the conection alive by itself. It will be a bit tricky to find all places where a game could end, to schedule a keepAlive event. Perhaps hiding it in StopClocks() would work. An alternative would be to not use the timer at all, but note the time passed since the last SendToIcs() for any incoming signal from the ICS, and send a new keepAlive message if more than 30 min had passed. This would not work on a totally deserted ICS, though.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: New feature to send command every n minutes?

Postby Michel » 14 Aug 2009, 06:38

The keepAlive thing is complicated by the fact that the current WB code supports only a single "scheduled event"


Really. It seems this should be fixed ASAP then. Writing a scheduler is completely trivial. Just keep an array of events and set the timeout on the first one that should occur.

My own FICS bot icsdroneng has this so it has no problems sending keepalives interleaved with other events.

http://alpha.uhasselt.be/Research/Algeb ... g-release/

I'll take the opportunity to make some publicity for icsdroneng. Just fire it up. Set the options. Execute "daemonize" and forget about it. It will keep running silently in the background. It will even relogin in case of network problems (or if you resume from suspend). It will autojoin tournaments if instructed to do so. Its options remain fully configurable at run time through tell commands.

Currently icsdrone writes the interesting events to a text file which you can view in a webbrowser. This works rather well. Every morning I have a look at it from home. In the future I plan to give icsdroneng its own webinterface.

My account TogaII has been online since June 19 (with several relogins). It has played 2345 games since then. I am also running a guest
which has played 33593 (mostly lightning) games since it was started.

This is the manpage

http://alpha.uhasselt.be/Research/Algeb ... ERVIEW.txt
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: New feature to send command every n minutes?

Postby H.G.Muller » 14 Aug 2009, 08:56

Michel wrote:Really. It seems this should be fixed ASAP then. Writing a scheduler is completely trivial. Just keep an array of events and set the timeout on the first one that should occur.


Well, "completely trivial" is a relative notion. Completely trivial is when I would just have had to add:

Code: Select all
if(appData.keepAlive) ScheduleDelayedEvent(KeepAlive, appData.keepAlive*60*1000);


For all I know the current code might actually depend for correctness in some cases on a new event cancelling the previous one, so this would have to be figured out as well, and replaced by explicit cancelling.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: New feature to send command every n minutes?

Postby Michel » 14 Aug 2009, 09:24

if(appData.keepAlive) ScheduleDelayedEvent(KeepAlive, appData.keepAlive*60*1000);


Well that's just an interface isn't it? The implementation does not matter. I do

create_timer(&(runData.pingTimer),PINGINTERVAL,SendPing,NULL);


which is just as easy. I think it is really important to be able to create timers effortlessly (of course they can be abused easily to hide race conditions but that is another issue).

For all I know the current code might actually depend for correctness in some cases on a new event deleting the previous one, so this would have to be figured out as well, and replaced by explicit cancelling.


Since I inherited an icdrone with the same limitations I have a function which cancels all timers at the creation of a new event, except those I know that should not be cancelled (like ping). In that way the code I have not rewritten continuous to work unmodified.
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: New feature to send command every n minutes?

Postby Eric Mullins » 14 Aug 2009, 17:27

Michel wrote:http://alpha.uhasselt.be/Research/Algebra/Toga/icsdroneng-release/

I'll take the opportunity to make some publicity for icsdroneng. Just fire it up. Set the options. Execute "daemonize" and forget about it. It will keep running silently in the background. It will even relogin in case of network problems (or if you resume from suspend). It will autojoin tournaments if instructed to do so. Its options remain fully configurable at run time through tell commands.


Icsdrone is a great project, one that I recommend occasionally. There are Windows users who prefer to daemonize, but they are a miniority. Most prefer to see the GUI and bot all wrapped together, and that's not a bad way of doing things for Windows users who typically shut down every night, or who aren't on very much.

I don't know about icsdrone-ng, but the version I use is totally untested outside of FICS, and I have suspicions that working elsewhere might be problematic. I personally don't need support beyond FICS, but others do.
Eric Mullins
 
Posts: 47
Joined: 28 Aug 2008, 04:54
Location: Albuquerque, NM

Re: New feature to send command every n minutes?

Postby H.G.Muller » 15 Aug 2009, 13:56

The alpha version that is on my website now implementes the keep-alive, but the chat windows do not completely work yet.

http://home.hccnet.nl/h.g.muller/winboard.zip

The command-line option -keepAlive M makes WB send a "date" command to the ICS every M minutes (after the last move you played, so it only starts working after you played a game).
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: New feature to send command every n minutes?

Postby matematiko » 28 Aug 2009, 04:47

Hi all:

I recomended to a friend to use this version of WinBoard
http://home.hccnet.nl/h.g.muller/winboard.zip
because he was looking for a way to maintain his connection alive, although I have no tested this, he reports the current version found in that link gives the error:
Code: Select all
Unrecognized argument /keepalive


Did something change? Was this functionality removed?

Thanks,
One that does not live to serve, does not deserve to live.
matematiko
 
Posts: 219
Joined: 07 Dec 2008, 17:11
Location: Texas

Re: New feature to send command every n minutes?

Postby H.G.Muller » 28 Aug 2009, 05:12

capital A
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: New feature to send command every n minutes?

Postby matematiko » 28 Aug 2009, 21:36

Silly mistake.....sorry for the trouble.....and thanks a lot.
One that does not live to serve, does not deserve to live.
matematiko
 
Posts: 219
Joined: 07 Dec 2008, 17:11
Location: Texas

Re: New feature to send command every n minutes?

Postby netiad » 17 Sep 2010, 04:37

okay, I know this is a super old post but I can see that this feature was added to the official winboard and I have a suggestion on how it should be changed.

Let me first say that I really like this option as it has kept me from having to reopen winboard several times.

With that being said if the goal is to keep the user "alive" so that he doesn't get logged out automatically by sending a date command every M minutes, then if the user shows some type of activity the counter that counts up to M minutes before the date is sent should be reset to zero.

The reason is that while I am actively chatting in a channel or playing a game I don't need the date command to keep me alive. This will keep the date replies from cluttering up the chat window during activity.
netiad
 
Posts: 16
Joined: 16 Sep 2010, 03:02


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 18 guests