/[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.6 - (hide annotations) (download) (as text)
Fri Jun 13 03:35:15 2003 UTC (15 years, 10 months ago) by stdarg
Branch: MAIN
Changes since 1.5: +10 -10 lines
File MIME type: text/x-chdr
* Added 'flags' param back to bind
* Partyline fixes/expansion
* Scripts can use 'bind' before the correct module is loaded

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 stdarg 1.6 static int party_msg(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
33 stdarg 1.1 {
34     return(0);
35     }
36    
37 stdarg 1.6 static int party_set(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
38 stdarg 1.2 {
39     return(0);
40     }
41    
42 stdarg 1.6 static int party_save(partymember_t *p, const char *nick, user_t *u, const char *cmd, const char *text)
43 stdarg 1.2 {
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.6 {NULL, "join", party_join},
62     {NULL, "msg", party_msg},
63     {NULL, "newpass", party_newpass},
64     {NULL, "part", party_part},
65     {NULL, "quit", party_quit},
66     {"n", "set", party_set},
67     {"n", "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