private void bot_OnPublicMessage(NielsRask.FnordBot.User user, string channel, string message) { if (message == "!wordgame") { // Console.WriteLine("someone requested a game"); log.Info("A game was requested on "+channel); if (gameList.ChannelExists( channel ) ) { // game is already running log.Warn("A game is already running."); } else { Wordgame wg = new Wordgame(bot, channel, gameList, wordListPath); gameList.Add( wg ); Thread gameThread = new Thread( new ThreadStart( wg.Start ) ); gameThread.Name = "wordgame_"+channel; gameThread.IsBackground = true; gameThread.Start(); } } else if (message == "!score") { // TODO: list the top10 wordgamers } }
public void Remove( Wordgame game ) { log.Debug("Removing game for channel "+game.Channel); try { List.Remove( game ); } catch (Exception e) { log.Error("Error removing from gamelist",e); } }
public void Add( Wordgame game) { List.Add( game ); }