/[cvs]/eggdrop1.9/src/core_party.c
ViewVC logotype

Contents of /eggdrop1.9/src/core_party.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Wed Jun 11 08:37:39 2003 UTC (16 years ago) by stdarg
Branch: MAIN
Changes since 1.4: +15 -1 lines
File MIME type: text/x-chdr
* guppy needed something to read on the bathroom
* new approach to create the initial user -- we prompt for the owner's handle
  when the bot starts with -m, and then generate a random password and print
  it out.

1 #include <eggdrop/eggdrop.h>
2 #include "core_config.h"
3
4 static int party_join(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
5 {
6 if (!text || !strlen(text)) {
7 partymember_write(p, "Syntax: join <channel>", -1);
8 return(0);
9 }
10 partychan_join_name(text, p);
11 return(0);
12 }
13
14 static int party_part(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
15 {
16 partychan_t *chan;
17
18 if (!text || !strlen(text)) chan = partychan_get_default(p);
19 else chan = partychan_lookup_name(text);
20 partychan_part(chan, p, "parting");
21 return(0);
22 }
23
24 static int party_quit(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
25 {
26 if (!text) text = "Quit";
27 partymember_write(p, "goodbye!", -1);
28 partymember_delete(p, text);
29 return(0);
30 }
31
32 static int party_msg(int pid, const char *nick, user_t *u, const char *cmd, const char *text)
33 {
34 return(0);
35 }
36
37 static int party_set(int pid, const char *nick, user_t *u, const char *cmd, const char *text)
38 {
39 return(0);
40 }
41
42 static int party_save(int pid, const char *nick, user_t *u, const char *cmd, const char *text)
43 {
44 user_save(core_config.userfile);
45 core_config_save();
46 return(1);
47 }
48
49 static int party_newpass(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
50 {
51 if (!text || strlen(text) < 6) {
52 partymember_write(p, "Please use at least 6 characters.", -1);
53 return(0);
54 }
55 user_set_pass(p->user, text);
56 partymember_printf(p, "Changed password to '%s'", text);
57 return(0);
58 }
59
60 static bind_list_t core_party_binds[] = {
61 {"join", party_join},
62 {"msg", party_msg},
63 {"newpass", party_newpass},
64 {"part", party_part},
65 {"quit", party_quit},
66 {"set", party_set},
67 {"save", party_save},
68 {0}
69 };
70
71 void core_party_init()
72 {
73 bind_add_list("party", core_party_binds);
74 }

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23