Show userids on incoming users [by Mudadmin]
Snippet Posted Wednesday, August 12th @ 11:36:40 PM, by George Greer in the Utils dept.
Added Jan 26, 1997. Click the link below to read it or download it.

From: Mudadmin <mudadmin@unix.aardvarkol.com>

/* ************************************************************************
*  file:  showadd.c                                   Part of CircleMud   *
*  Usage: list a diku playerfile and prints out hosts of your users       *
*  Copyright (C) 1990, 1991 - see 'license.doc' for complete information. *
*  All Rights Reserved                                                    *
************************************************************************* */

#include "../conf.h"
#include "../sysdep.h"

#include "../structs.h"

void show(char *filename)
{
  FILE *fl;
  struct char_file_u player;
/*  struct descriptor_data d; */
  int num = 0;

  if (!(fl = fopen(filename, "r+"))) {
    perror("error opening playerfile");
    exit(1);
  }
  for (;;) {
    fread(&player, sizeof(struct char_file_u), 1, fl);
    if (feof(fl)) {
      fclose(fl);
      exit(1);
    }
    printf("%5d. ID: %5ld %-20s %-40s\n", ++num,

   player.char_specials_saved.idnum, player.name,

   player.host);
  }
}


int main(int argc, char **argv)
{
  if (argc != 2)
    printf("Usage: %s playerfile-name\n", argv[0]);
  else
    show(argv[1]);

  return 0;
}


<< Sentinel Procedure [by Mendar] | Reply | View as text | Threaded | Skill and Spell Listing Command [by T-Rex] >>

 


Related Links
  CircleMUD
download
Related Articles
More by greerga
 
 

CircleMUD Snippets
 
Note: Not all of these snippets will work perfectly with your version of code, so be prepared to fix one or two bugs that may arise, and please let me know what you needed to do to fix it. Sending a corrected version is always welcome.
Finally, if you wish to use any of the snippets from this page, you are more than welcome, just mention the authors in your credits. If you wish to release any of these snippets to the public on another site, contact me FIRST.