🔔 Çevrimdışı bildirim almak ister misiniz?
Bir konuya etiketlendiğinizde, özel mesaj aldığınızda, bir mesajınız alıntılandığında forumda olmasanız bile anlık bildirim almak için lütfen izni verin.
/* Check early for server auto-ops */
if ((modes & CUMODE_o)
&& !(ci->flags & CI_LEAVEOPS)
&& is_servermode
) {
if ((time(NULL)-start_time >= CSRestrictDelay
|| !check_access_if_idented(user, ci, CA_AUTOOP))
&& !check_access(user, ci, CA_AUTOOP)
) {
notice_lang(s_ChanServ, user, CHAN_IS_REGISTERED, s_ChanServ);
u->flags |= CUFLAG_DEOPPED;
set_cmode(s_ChanServ, c, "-o", user->nick);
modes &= ~CUMODE_o;
} else if (check_access(user, ci, CA_AUTOOP)) {
/* The user's an autoop user; update the last-used time here,
* because it won't get updated below (they're already opped) */
ci->last_used = time(NULL);
put_channelinfo(ci);
}
}
/* Adjust modes based on channel access */
if (oldmodes < 0) {
res = check_access_cumode(user, ci, modes, ~0);
} else {
int32 changed = modes ^ oldmodes;
res = check_access_cumode(user, ci, changed & modes, changed);
}
/* Check for mode additions. Only check if join or server mode change,
* unless ENFORCE is set */
/* Note: modes to add = changed modes & off new-modes = res & ~modes */
if ((res & ~modes)
&& (oldmodes < 0 || is_servermode || (ci->flags & CI_ENFORCE))
) {
local_set_cumodes(c, '+', res & ~modes, u);
if ((res & ~modes) & CUMODE_o) {
ci->last_used = time(NULL);
put_channelinfo(ci);
}
}
/* Don't subtract modes from opers or Services admins */
if (is_oper(user) || is_services_admin(user))
return;
/* Check for mode subtractions */
if (res & modes)
local_set_cumodes(c, '-', res & modes, u);
}
/************************************************** ***********************/
/* List of channels currently inhabited */
typedef struct csinhabitdata_ CSInhabitData;
struct csinhabitdata_ {
CSInhabitData *next, *prev;
char chan[CHANMAX];
Timeout *to;
};
static CSInhabitData *inhabit_list = NULL;
/* Tiny helper routine to get ChanServ out of a channel after it went in. */
static void timeout_leave(Timeout *to)
{
CSInhabitData *data = to->data;
send_cmd(s_ChanServ, "PART %s", data->chan);
LIST_REMOVE(data, inhabit_list);
free(data);
}
/* Check whether a user is permitted to be on a channel. If so, return 0;
* else, kickban the user with an appropriate message (could be either
* AKICK or restricted access) and return 1. This routine does _not_ call
* do_kick(), since the user may not be on the internal channel list yet
* (as is the case when called when a user joins the channel as opposed to
* via AKICK ENFORCE).
*/
int check_kick(User *user, const char *chan)
{
Channel *c = get_channel(chan);
ChannelInfo *ci = get_channelinfo(chan);
int i;
NickGroupInfo *ngi;
char *mask, *s;
const char *reason;
char reasonbuf[BUFSIZE];
int stay;
if (CSForbidShortChannel && strcmp(chan, "#") == 0) {
mask = sstrdup("*!*@*");
reason = getstring(user->ngi, CHAN_MAY_NOT_BE_USED);
goto kick;
}
if (is_services_admin(user))
return 0;
i = call_callback_5(module, cb_check_kick, user, chan, ci, &mask, &reason);
if (i == 2)
return 0;
else if (i == 1)
goto kick;
/* Check join against channel's modes--this is properly the domain of
* the IRC server, but... */
if (c) {
if ((c->mode & chanmode_opersonly) && !is_oper(user)) {
mask = create_mask(user, 1);
reason = getstring(user->ngi, CHAN_NOT_ALLOWED_TO_JOIN);
goto kick;
}
}
if (!ci) {
if (CSRegisteredOnly && !is_oper(user)) {
mask = sstrdup("*!*@*");
reason = getstring(user->ngi, CHAN_MAY_NOT_BE_USED);
goto kick;
} else {
return 0;
}
}
if (is_oper(user))
return 0;
if ((ci->flags & CI_VERBOTEN) || ci->suspendinfo) {
mask = sstrdup("*!*@*");
reason = getstring(user->ngi, CHAN_MAY_NOT_BE_USED);
goto kick;
}
if (ci->mlock_on & chanmode_opersonly) {
/* We already know they're not an oper, so kick them off */
mask = create_mask(user, 1);
reason = getstring(user->ngi, CHAN_NOT_ALLOWED_TO_JOIN);
goto kick;
}
if ((ci->mlock_on & chanmode_regonly) && !user_identified(user)) {
/* User must have usermode_reg flags, i.e. be using a registered
* nick and have identified, in order to join a chanmode_regonly
* channel */
mask = create_mask(user, 1);
reason = getstring(user->ngi, CHAN_NOT_ALLOWED_TO_JOIN);
goto kick;
}
if (user_recognized(user))
ngi = user->ngi;
else
ngi = NULL;
ARRAY_FOREACH (i, ci->akick) {
if (!ci->akick[i].mask)
continue;
if (match_usermask(ci->akick[i].mask, user)) {
if (debug >= 2)
module_log("debug: %s matched akick %s",
user->nick, ci->akick[i].mask);
mask = sstrdup(ci->akick[i].mask);
reason = ci->akick[i].reason ? ci->akick[i].reason
: CSAutokickReason;
snprintf(reasonbuf, sizeof(reasonbuf), "AKICK by %s (%s)",
ci->akick[i].who, reason);
reason = reasonbuf;
time(&ci->akick[i].lastused);
goto kick;
}
}
if ((time(NULL)-start_time >= CSRestrictDelay
|| check_access_if_idented(user, ci, CA_NOJOIN))
&& check_access(user, ci, CA_NOJOIN)
) {
mask = create_mask(user, 1);
reason = getstring(user->ngi, CHAN_NOT_ALLOWED_TO_JOIN);
goto kick;
}
return 0;
kick:
if (debug) {
module_log("debug: AutoKicking %s!%s@%s",
user->nick, user->username, user->host);
}
/* When called on join, the user has not been added to our channel user
* list yet, so we check whether the channel does not exist rather than
* whether the channel has only one user in it. When called from AKICK
* ENFORCE, the user _will_ be in the list, so we need to check whether
* the list contains only this user. Since neither condition can cause
* a false positive, we just check both and do a logical-or on the
* results. */
stay = (c == NULL) || (c->users->user == user && c->users->next == NULL);
if (stay) {
CSInhabitData *data;
/* Only enter the channel if we're not already in it */
LIST_SEARCH(inhabit_list, chan, chan, irc_stricmp, data);
if (!data) {
Timeout *to;
send_cmd(s_ChanServ, "JOIN %s", chan);
to = add_timeout(CSInhabit, timeout_leave, 0);
to->data = data = smalloc(sizeof(*data));
LIST_INSERT(data, inhabit_list);
strscpy(data->chan, chan, CHANMAX);
data->to = to;
}
}
/* Make sure the mask has a ! in it */
if (!(s = strchr(mask, '!')) || s > strchr(mask, '@')) {
int len = strlen(mask);
mask = srealloc(mask, len+3);
memmove(mask+2, mask, len+1);
mask[0] = '*';
mask[1] = '!';
}
/* Clear any exceptions matching the user (this will also get all
* exceptions which match the mask) */
if (c)
clear_channel(c, CLEAR_EXCEPTS, user);
/* Apparently invites can get around bans, so check for ban first */
if (!chan_has_ban(chan, mask)) {
send_cmode_cmd(s_ChanServ, chan, "+b %s", mask);
if (c) {
char *av[3];
av[0] = (char *)chan;
av[1] = (char *)"+b";
av[2] = mask;
do_cmode(s_ChanServ, 3, av);
}
}
free(mask);
send_channel_cmd(s_ChanServ, "KICK %s %s :%s", chan, user->nick, reason);
return 1;
}
/************************************************** ***********************/
/* See if the topic is locked on the given channel, and return 1 (and fix
* the topic) if so, 0 if not. */
int check_topiclock(Channel *c, time_t topic_time)
{
ChannelInfo *ci = c->ci;
if (!ci || !(ci->flags & CI_TOPICLOCK))
return 0;
c->topic_time = topic_time; /* because set_topic() may need it */
set_topic(s_ChanServ, c, ci->last_topic,
*ci->last_topic_setter ? ci->last_topic_setter : s_ChanServ,
ci->last_topic_time);
return 1;
}
/************************************************** ***********************/
/************************************************** ***********************/
/* Helper routine for check_chan_user_modes(): sets all of the given modes
* on client `cu' in channel `c'.
*/
static void local_set_cumodes(Channel *c, char plusminus, int32 modes,
struct c_userlist *cu)
{
char buf[3], modestr[BUFSIZE], *s;
buf[0] = plusminus;
buf[2] = 0;
strscpy(modestr, mode_flags_to_string(modes, MODE_CHANUSER),
sizeof(modestr));
s = modestr;
while (*s) {
buf[1] = *s++;
set_cmode(s_ChanServ, c, buf, cu->user->nick);
}
/* Set user's modes now, so check_chan_user_modes() can properly
* determine whether subsequent modes should be set or not */
if (plusminus == '+')
cu->mode |= modes;
else if (plusminus == '-')
cu->mode &= ~modes;
}
/************************************************** ***********************/
/************************************************** ***********************/
int init_check(Module *my_module)
{
module = my_module;
cb_check_modes = register_callback(module, "check_modes");
cb_check_chan_user_modes=register_callback(module, "check_chan_user_modes");
cb_check_kick = register_callback(module, "check_kick");
if (cb_check_modes < 0 || cb_check_chan_user_modes < 0
|| cb_check_kick < 0
) {
module_log("check: Unable to register callbacks");
exit_check();
return 0;
}
return 1;
}
/************************************************** ***********************/
void exit_check()
{
CSInhabitData *inhabit, *tmp;
LIST_FOREACH_SAFE (inhabit, inhabit_list, tmp) {
del_timeout(inhabit->to);
LIST_REMOVE(inhabit, inhabit_list);
free(inhabit);
}
unregister_callback(module, cb_check_kick);
unregister_callback(module, cb_check_chan_user_modes);
unregister_callback(module, cb_check_modes);
}
/************************************************** ***********************/
dosyayı yararlı bir şekle getirmek için ;
Services Sürümün/modules/chanserv/
İçine Check.c Dosyası ile deiştir
Sonra Ftp'ne Logain ol ve
cd
cd Services Sürümün
make
make install
cd
cd Unreal3.2
./unreal restart
cd
cd Services Sürümün
./ircservices
Olarak Servislerini tekrarda getirip Kullanabilirsin, sadece İRCServices - IFServices'ler için.