channel.c

./lib/function/channel.c · 1.1 KB

From the archive h7v3.0a.tar.gz

Download the archive   « Back to the archive contents

/***********************************************************
 * THE CHANNEL DAEMON
 * v1.0 Angel Aug '96
 * ..pretty simple, hu?!
 * Other work is done inside player.c ..but its not much 
 */


status chat_channel(string channel, string message, status silently) {
  int i;
  object *user;


  user = users();
  if(!channel) channel = "OOC";
  if(!message) message = "mumbles";

  for(i=0; i<sizeof(user); i++) {
    if(user[i]->query_channel(channel))
      if(!user[i]->query_edit())
        if(!silently)
          tell_object(user[i], "["+ capitalize(channel)+"] "+message+"\n");
        else
          tell_object(user[i], message+"\n");
  }
  return 1;
}


varargs valid_channel(string str) {
  string *channels;

  if(str == "ooc") str = "OOC";
  /* players channels */
  channels = ({
    "OOC", 
  });

  /* wizardly levels */
  if((int)this_player()->query_security_level())
    channels += ({ "wiz", "lpc", });

  if(!str) return channels;
  if((int)this_player()->query_security_level()) return 1;

  return (member_array(str, channels) != -1) ? 1 : 0;
}

Site Stats

Snippets: 1791
Codebases: 571