]> skyeroc.xyz Git - dgamelaunch/commitdiff
rip out the redundant menu entry now that we can mail in-game
authorJoshua Kwan <joshk@triplehelix.org>
Wed, 31 Dec 2003 02:02:25 +0000 (02:02 +0000)
committerJoshua Kwan <joshk@triplehelix.org>
Wed, 31 Dec 2003 02:02:25 +0000 (02:02 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@14 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c

index 1281c9f8d01663de81f24521eb83f7fe72953a44..f2d85f15e53391bf8bc27c8dfcca0153ed949ab7 100644 (file)
@@ -402,85 +402,6 @@ domailuser (char *username)
        return;
 }
 
-void
-mailuser ()
-{
-       char buf[20], *user = NULL;
-       int error = 2;
-
-       clear ();
-       mvaddstr (1, 1, VER1);
-       mvaddstr (5, 1,
-                                               "To whom would you like to send a message? (Blank entry returns)");
-       mvaddstr (7, 1, "=> ");
-
-       while (error)
-               {
-                       if (error == 1)
-                               mvaddstr (9, 1, "There is no such user. Try again.  ");
-                       else if (error == 3)
-                               mvaddstr (9, 1, "That user is not playing right now.");
-
-                       mvaddstr (7, 1, "=>                     ");
-                       move (7, 4);
-                       getnstr (buf, 20);
-
-                       if (buf && *buf == '\0')
-                               return;
-
-                       if (userexist (buf) != -1)
-                               {
-                                       DIR *ip = opendir (LOC_INPROGRESSDIR);
-                                       struct dirent *dent;
-
-                                       error = 3;                                              /* unless set by loop below, assume not playing */
-
-                                       while ((dent = readdir (ip)) != NULL)
-                                               {
-                                                       char *trname = strdup (dent->d_name);
-                                                       int len =
-                                                               (sizeof (LOC_INPROGRESSDIR) / sizeof (LOC_INPROGRESSDIR[0])) +
-                                                               strlen (dent->d_name);
-                                                       char *fullpath = malloc (len + 1);
-                                                       int fd;
-
-                                                       snprintf (fullpath, len, "%s%s", LOC_INPROGRESSDIR,
-                                                                                               dent->d_name);
-
-                                                       fd = open (fullpath, O_RDONLY);
-                                                       user = strdup (strtok (trname, ":"));
-
-                                                       /* if it's locked, it's in session */
-                                                       if (!strcmp (buf, user))
-                                                               {
-                                                                       /* could lock? unlock and forget about it */
-                                                                       if (flock (fd, LOCK_EX | LOCK_NB) == 0)
-                                                                               {
-                                                                                       flock (fd, LOCK_UN | LOCK_NB);
-                                                                                       continue;
-                                                                               }
-                                                                       else                                    /* no lock, good deal */
-                                                                               {
-                                                                                       error = 0;
-                                                                                       break;
-                                                                               }
-                                                               }
-                                                       close (fd);
-
-                                                       free (user);
-                                                       free (trname);
-                                               }
-
-                                       closedir (ip);
-                               }
-                       else
-                               error = 1;
-               }
-
-       if (error == 0)
-               domailuser (user);
-}
-
 void
 drawmenu ()
 {
@@ -502,10 +423,9 @@ drawmenu ()
                        mvaddstr (VERLINES + 4, 1, "c) Change password");
                        mvaddstr (VERLINES + 5, 1, "o) Edit option file (requires vi use)");
                        mvaddstr (VERLINES + 6, 1, "w) Watch games in progress");
-                       mvaddstr (VERLINES + 7, 1, "m) Contact a current player");
-                       mvaddstr (VERLINES + 8, 1, "p) Play nethack!");
-                       mvaddstr (VERLINES + 9, 1, "q) Quit");
-                       mvaddstr (VERLINES + 11, 1, "=> ");
+                       mvaddstr (VERLINES + 7, 1, "p) Play nethack!");
+                       mvaddstr (VERLINES + 8, 1, "q) Quit");
+                       mvaddstr (VERLINES + 10, 1, "=> ");
                }
        else
                {
@@ -1068,10 +988,6 @@ main (void)
                                        if (loggedin)
                                                editoptions ();
                                        break;
-                               case 'm':
-                                       if (loggedin)
-                                               mailuser ();
-                                       break;
                                case 'q':
                                        endwin ();
                                        exit (1);