Permalink
Browse files

add dota autoupdate cpp

  • Loading branch information...
1 parent 26a0eac commit dca39f6cea8944b27bea775096bc7bd7fa1f0a77 @apocalypse committed Jan 12, 2010
Showing with 24 additions and 1 deletion.
  1. +1 −1 TODO
  2. +23 −0 dota_autoupdate.cpp
View
2 TODO
@@ -3,4 +3,4 @@
- add IRC chat capability
- fix !unhost so all rootadmins can do it regardless of game owner?
- add clan shamans as rootadmin?
--
+- make sure default !acc privilege for new users is correct
View
23 dota_autoupdate.cpp
@@ -0,0 +1,23 @@
+#define DOTA_AUTOUPDATE 1
+#define DOTA_AUTOUPDATE_CMD "dota_update.pl"
+
+bool CheckDOTAUpdate() {
+ int i;
+ if ( ! system( NULL ) ) {
+ // Hmpf, we cannot execute commands!
+ return FALSE;
+ }
+
+ i = system( DOTA_AUTOUPDATE_CMD );
+ if ( i == 0 ) {
+ // exitval of 0 means successfully updated, all others is error
+
+ // Hmpf, issue a "!load dota"
+
+ // Hmpf, announce dota update in channel!
+
+ return TRUE;
+ }
+
+ return FALSE;
+}

0 comments on commit dca39f6

Please sign in to comment.