]> jfr.im git - irc/gameservirc.git/commitdiff
Some old devel stuff
authorkainazzzo <redacted>
Tue, 20 Apr 2004 15:30:22 +0000 (15:30 +0000)
committerkainazzzo <redacted>
Tue, 20 Apr 2004 15:30:22 +0000 (15:30 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@168 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/TODO
gameserv/gameserv.cpp
gameserv/sockhelp.cpp
gameserv/tcpclient.cpp

index 66882b1e6ac37e978bd0569e0e89e0cb8e1dd807..7d7daad54974d09cf6bc7adc45cad5919f8e4a0f 100644 (file)
@@ -12,9 +12,9 @@ X = Finsihed
     that way the game has a point no matter how many monsters
        are done!
 
-- Idle time events - mobbed by the goblin gang (timestamp on each 
-    player, periodic checks (config file entry), if (time(NULL) - 
-    player->idlesince >= maxidletime) then (event())
+- Idle time events - mobbed by the goblin gang 
+       X (timestamp on each player, periodic checks (config file entry), 
+       X if (time(NULL) - player->idlesince >= maxidletime) then (event())
 
 * Random forest quotes when you search the forest
 
@@ -26,6 +26,7 @@ X = Finsihed
 
 * Add admin version of the logout command which allows them to logout 
     anyone
+
 * Rejoin the bot if kicked/killed
 
 * Notice on database updates
index d578986d8279ee248609714e3f07b24dbe7b0efa..68168b6232df39614d9cdfbf66eeeb173cc0503c 100644 (file)
@@ -2818,7 +2818,29 @@ void timeOutEvent(Player *p)
        }
     }
     else if (!player_fight(user))
+    {
+       // Place fun stuff here :)
+       int randnum = 1 + rand() % 100; // 1-100
+
+        if (randnum < 50)
+        {
+           #define GSN(s) notice(s_GameServ, nick, s)
+           #define GSN2(s, f) notice(s_GameServ, nick, s, f)
+           int stolen = ((35 + rand() % 66)/100) * user->stats->gold;
+
+           GSN("You stop for a moment to rest on the "\
+            "street corner. All of a sudden, you "\
+            "are ambushed from all sides by a hoarde "\
+            "of knife wielding thugs.");
+           GSN2("The thugs beat you into utter submission "\
+           "and steal %d gold from you!", stolen);
+           user->stats->gold -= stolen;
+       }
+
+
+       // Always log out the user
        logout(user);
+    }
 }
 
 void do_reset(char *u)
index f679c781aa1661597238af54d82602ea48ff66a6..1536767efd1706cfa3e785a407281e63a440107b 100644 (file)
@@ -23,19 +23,14 @@ int atoport(char *service, char *proto)
 {
   int port;
   long int lport;
-  struct servent *serv;
   char *errpos;
 
-  /* First try to read it from /etc/services */
-  serv = getservbyname(service, proto);
-  if (serv != NULL)
-    port = serv->s_port;
-  else { /* Not in services, maybe a number? */
     lport = strtol(service,&errpos,0);
     if ( (errpos[0] != 0) || (lport < 1) || (lport > 65535) )
       return -1; /* Invalid port address */
+
     port = htons(lport);
-  }
+
   return port;
 }
 
index 4220155c6482ea6084ee29d473c421b026b7ca83..e5cfcba6d6ee0915dd81b1e819a3876b17e0bf6b 100644 (file)
@@ -96,7 +96,6 @@ int main(int argc, char *argv[])
         perror("Could not turn into a daemon");
         exit(2);
     }
-
   init_masters();
   load_gs_dbase();