Просмотр исходного кода

* Add more output from cmd_play

Bryan Drewery 16 лет назад
Родитель
Сommit
b0b21c7095
1 измененных файлов с 12 добавлено и 1 удалено
  1. 12 1
      src/mod/irc.mod/cmdsirc.c

+ 12 - 1
src/mod/irc.mod/cmdsirc.c

@@ -1969,11 +1969,22 @@ static void cmd_play(int idx, char *par)
   bd::Stream stream;
   stream.loadFile(par);
   bd::String str;
+  size_t lines =0 ;
   while (stream.tell() < stream.length()) {
     str = stream.getline().chomp();
-    if (str.length())
+    if (str.length()) {
       privmsg(chan->name, str.c_str(), DP_PLAY);
+      ++lines;
+    }
   }
+  dprintf(idx, "Playing %d lines from %s to %s\n", lines, par, chan->dname);
+  long time_to_play = 0;
+  if (lines < 10)
+    time_to_play = 3;
+  else
+    time_to_play = 3 + ((lines - 10) / 2);
+
+  dprintf(idx, "Estimated time-to-play: %li seconds\n", time_to_play);
 }
 
 static cmd_t irc_dcc[] =