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

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

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


Revision 1.5 - (hide annotations) (download) (as text)
Wed Jun 11 08:37:39 2003 UTC (15 years, 11 months 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 stdarg 1.1 #include <eggdrop/eggdrop.h>
2 stdarg 1.5 #include "core_config.h"
3 stdarg 1.1
4 stdarg 1.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 stdarg 1.3 static int party_quit(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
25 stdarg 1.1 {
26 stdarg 1.3 if (!text) text = "Quit";
27     partymember_write(p, "goodbye!", -1);
28     partymember_delete(p, text);
29 stdarg 1.1 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 stdarg 1.2 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 stdarg 1.5 user_save(core_config.userfile);
45 stdarg 1.2 core_config_save();
46     return(1);
47     }
48    
49 stdarg 1.5 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 stdarg 1.1 static bind_list_t core_party_binds[] = {
61 stdarg 1.4 {"join", party_join},
62 stdarg 1.5 {"msg", party_msg},
63     {"newpass", party_newpass},
64 stdarg 1.4 {"part", party_part},
65 stdarg 1.1 {"quit", party_quit},
66 stdarg 1.2 {"set", party_set},
67     {"save", party_save},
68 stdarg 1.1 {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