亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? channel.c

?? 打魔獸戰(zhàn)網(wǎng)的都知道他是什么
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * Copyright (C) 1998  Mark Baysinger (mbaysing@ucsd.edu) * Copyright (C) 1998,1999,2000  Ross Combs (rocombs@cs.nmsu.edu) * Copyright (C) 2000,2001  Marco Ziech (mmz@gmx.net) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. */#define CHANNEL_INTERNAL_ACCESS#include "common/setup_before.h"#include <stdio.h>#ifdef HAVE_STDDEF_H# include <stddef.h>#else# ifndef NULL#  define NULL ((void *)0)# endif#endif#ifdef STDC_HEADERS# include <stdlib.h>#else# ifdef HAVE_MALLOC_H#  include <malloc.h># endif#endif#ifdef HAVE_STRING_H# include <string.h>#else# ifdef HAVE_STRINGS_H#  include <strings.h># endif#endif#include "compat/strrchr.h"#include "compat/strdup.h"#include "compat/strcasecmp.h"#include <errno.h>#include "compat/strerror.h"#ifdef TIME_WITH_SYS_TIME# include <sys/time.h># include <time.h>#else# ifdef HAVE_SYS_TIME_H#  include <sys/time.h># else#  include <time.h># endif#endif#ifdef HAVE_SYS_TYPES_H# include <sys/types.h>#endif#include "connection.h"#include "common/eventlog.h"#include "common/list.h"#include "message.h"#include "account.h"#include "account_wrap.h"#include "common/util.h"#include "prefs.h"#include "common/token.h"#include "channel.h"#include "irc.h"#include "common/tag.h"#include "common/xalloc.h"#include "common/setup_after.h"static t_list * channellist_head=NULL;static t_channelmember * memberlist_curr=NULL;static int totalcount=0;static int channellist_load_permanent(char const * filename);static t_channel * channellist_find_channel_by_fullname(char const * name);static char * channel_format_name(char const * sname, char const * country, char const * realmname, unsigned int id);extern int channel_set_userflags(t_connection * c);extern t_channel * channel_create(char const * fullname, char const * shortname, char const * clienttag, int permflag, int botflag, int operflag, int logflag, char const * country, char const * realmname, int maxmembers, int moderated, int clanflag, int autoname){    t_channel * channel;        if (!fullname)    {        eventlog(eventlog_level_error,__FUNCTION__,"got NULL fullname");	return NULL;    }    if (fullname[0]=='\0')    {        eventlog(eventlog_level_error,__FUNCTION__,"got empty fullname");	return NULL;    }    if (shortname && shortname[0]=='\0')    {        eventlog(eventlog_level_error,__FUNCTION__,"got empty shortname");	return NULL;    }    if (clienttag && strlen(clienttag)!=4)    {	eventlog(eventlog_level_error,__FUNCTION__,"client tag has bad length (%u chars)",strlen(clienttag));	return NULL;    }        /* non-permanent already checks for this in conn_set_channel */    if (permflag)    {	if ((channel = channellist_find_channel_by_fullname(fullname)))	{	    if ((channel_get_clienttag(channel)) && (clienttag) && (strcmp(channel_get_clienttag(channel),clienttag)==0))	    {	      eventlog(eventlog_level_error,__FUNCTION__,"could not create duplicate permanent channel (fullname \"%s\")",fullname);	      return NULL;	    }	    else if (((channel->flags & channel_flags_allowbots)!=(botflag?channel_flags_allowbots:0)) || 		     ((channel->flags & channel_flags_allowopers)!=(operflag?channel_flags_allowopers:0)) || 		     (channel->maxmembers!=maxmembers) || 		     ((channel->flags & channel_flags_moderated)!=(moderated?channel_flags_moderated:0)) ||		     (channel->logname && logflag==0) || (!(channel->logname) && logflag ==1))	    {		eventlog(eventlog_level_error,__FUNCTION__,"channel parameters do not match for \"%s\" and \"%s\"",fullname,channel->name);		return NULL;	    }	}    }    channel = xmalloc(sizeof(t_channel));        if (permflag)    {	channel->flags = channel_flags_public;	if (clienttag && maxmembers!=-1) /* approximation.. we want things like "Starcraft USA-1" */	    channel->flags |= channel_flags_system;    } else	channel->flags = channel_flags_none;    if (moderated)	channel->flags |= channel_flags_moderated;    if(shortname && (!strcasecmp(shortname, CHANNEL_NAME_KICKED)       || !strcasecmp(shortname, CHANNEL_NAME_BANNED)))	channel->flags |= channel_flags_thevoid;        eventlog(eventlog_level_debug,__FUNCTION__,"creating new channel \"%s\" shortname=%s%s%s clienttag=%s%s%s country=%s%s%s realm=%s%s%s",fullname,	     shortname?"\"":"(", /* all this is doing is printing the name in quotes else "none" in parens */	     shortname?shortname:"none",	     shortname?"\"":")",	     clienttag?"\"":"(",	     clienttag?clienttag:"none",	     clienttag?"\"":")",	     country?"\"":"(",             country?country:"none",	     country?"\"":")",	     realmname?"\"":"(",             realmname?realmname:"none",             realmname?"\"":")");        channel->name = xstrdup(fullname);        if (!shortname)	channel->shortname = NULL;    else	channel->shortname = xstrdup(shortname);        if (clienttag)	channel->clienttag = xstrdup(clienttag);    else	channel->clienttag = NULL;    if (country)	channel->country = xstrdup(country);    else	channel->country = NULL;	    if (realmname)	channel->realmname = xstrdup(realmname);    else        channel->realmname=NULL;	    channel->banlist = list_create();        totalcount++;    if (totalcount==0) /* if we wrap (yeah right), don't use id 0 */	totalcount = 1;    channel->id = totalcount;    channel->maxmembers = maxmembers;    channel->currmembers = 0;    channel->memberlist = NULL;        if (permflag) channel->flags |= channel_flags_permanent;    if (botflag)  channel->flags |= channel_flags_allowbots;    if (operflag) channel->flags |= channel_flags_allowopers;    if (clanflag) channel->flags |= channel_flags_clan;    if (autoname) channel->flags |= channel_flags_autoname;        if (logflag)    {	time_t      now;	struct tm * tmnow;	char        dstr[64];	char        timetemp[CHANLOG_TIME_MAXLEN];		now = time(NULL);		if (!(tmnow = localtime(&now)))	    dstr[0] = '\0';	else	    sprintf(dstr,"%04d%02d%02d%02d%02d%02d",		    1900+tmnow->tm_year,		    tmnow->tm_mon+1,		    tmnow->tm_mday,		    tmnow->tm_hour,		    tmnow->tm_min,		    tmnow->tm_sec);	channel->logname = xmalloc(strlen(prefs_get_chanlogdir())+9+strlen(dstr)+1+6+1); /* dir + "/chanlog-" + dstr + "-" + id + NUL */	sprintf(channel->logname,"%s/chanlog-%s-%06u",prefs_get_chanlogdir(),dstr,channel->id);		if (!(channel->log = fopen(channel->logname,"w")))	    eventlog(eventlog_level_error,__FUNCTION__,"could not open channel log \"%s\" for writing (fopen: %s)",channel->logname,pstrerror(errno));	else	{	    fprintf(channel->log,"name=\"%s\"\n",channel->name);	    if (channel->shortname)		fprintf(channel->log,"shortname=\"%s\"\n",channel->shortname);	    else		fprintf(channel->log,"shortname=none\n");	    fprintf(channel->log,"permanent=\"%s\"\n",(channel->flags & channel_flags_permanent)?"true":"false");	    fprintf(channel->log,"allowbotse=\"%s\"\n",(channel->flags & channel_flags_allowbots)?"true":"false");	    fprintf(channel->log,"allowopers=\"%s\"\n",(channel->flags & channel_flags_allowopers)?"true":"false");	    if (channel->clienttag)		fprintf(channel->log,"clienttag=\"%s\"\n",channel->clienttag);	    else		fprintf(channel->log,"clienttag=none\n");	    	    if (tmnow)		strftime(timetemp,sizeof(timetemp),CHANLOG_TIME_FORMAT,tmnow);	    else		strcpy(timetemp,"?");	    fprintf(channel->log,"created=\"%s\"\n\n",timetemp);	    fflush(channel->log);	}    }    else    {	channel->logname = NULL;	channel->log = NULL;    }        channel->gameOwner = NULL;    channel->gameOwnerIP = 0;    channel->gameType = 0;    channel->gameTournament = 0;    channel->gameOptions = NULL;    list_append_data(channellist_head,channel);        eventlog(eventlog_level_debug,__FUNCTION__,"channel created successfully");    return channel;}extern int channel_destroy(t_channel * channel, t_elem ** curr){    t_elem * ban;        if (!channel)    {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");	return -1;    }        if (channel->memberlist)    {	eventlog(eventlog_level_debug,__FUNCTION__,"channel is not empty, deferring");        channel->flags &= ~channel_flags_permanent; /* make it go away when the last person leaves */	return -1;    }        if (list_remove_data(channellist_head,channel,curr)<0)    {        eventlog(eventlog_level_error,__FUNCTION__,"could not remove item from list");        return -1;    }        eventlog(eventlog_level_info,__FUNCTION__,"destroying channel \"%s\"",channel->name);        LIST_TRAVERSE(channel->banlist,ban)    {	char const * banned;		if (!(banned = elem_get_data(ban)))	    eventlog(eventlog_level_error,__FUNCTION__,"found NULL name in banlist");	else	    xfree((void *)banned); /* avoid warning */	if (list_remove_elem(channel->banlist,&ban)<0)	    eventlog(eventlog_level_error,__FUNCTION__,"unable to remove item from list");    }    list_destroy(channel->banlist);        if (channel->log)    {	time_t      now;	struct tm * tmnow;	char        timetemp[CHANLOG_TIME_MAXLEN];		now = time(NULL);	if ((!(tmnow = localtime(&now))))	    strcpy(timetemp,"?");	else	    strftime(timetemp,sizeof(timetemp),CHANLOG_TIME_FORMAT,tmnow);	fprintf(channel->log,"\ndestroyed=\"%s\"\n",timetemp);		if (fclose(channel->log)<0)	    eventlog(eventlog_level_error,__FUNCTION__,"could not close channel log \"%s\" after writing (fclose: %s)",channel->logname,pstrerror(errno));    }        if (channel->logname)	xfree((void *)channel->logname); /* avoid warning */        if (channel->country)	xfree((void *)channel->country); /* avoid warning */        if (channel->realmname)	xfree((void *)channel->realmname); /* avoid warning */    if (channel->clienttag)	xfree((void *)channel->clienttag); /* avoid warning */        if (channel->shortname)	xfree((void *)channel->shortname); /* avoid warning */    xfree((void *)channel->name); /* avoid warning */        xfree(channel);        return 0;}extern char const * channel_get_name(t_channel const * channel){    if (!channel)    {        eventlog(eventlog_level_warn,__FUNCTION__,"got NULL channel");	return "";    }        return channel->name;}extern char const * channel_get_clienttag(t_channel const * channel){    if (!channel)    {        eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");	return "";    }        return channel->clienttag;}extern t_channel_flags channel_get_flags(t_channel const * channel){    if (!channel)    {        eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");	return channel_flags_none;    }        return channel->flags;}extern int channel_set_flags(t_channel * channel, t_channel_flags flags){    if (!channel)    {        eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");	return -1;    }    channel->flags = flags;        return 0;}extern int channel_get_permanent(t_channel const * channel){    if (!channel)    {        eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");	return 0;    }        return (channel->flags & channel_flags_permanent);}extern unsigned int channel_get_channelid(t_channel const * channel){    if (!channel)    {        eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");	return 0;    }    return channel->id;}extern int channel_set_channelid(t_channel * channel, unsigned int channelid){    if (!channel)    {        eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");	return -1;    }    channel->id = channelid;    return 0;}extern int channel_rejoin(t_connection * conn){  t_channel const * channel;  char const * temp;  char const * chname;  if (!(channel = conn_get_channel(conn)))    return -1;  if (!(temp = channel_get_name(channel)))    return -1;  chname=xstrdup(temp);  conn_set_channel(conn, NULL);  if (conn_set_channel(conn,chname)<0)    conn_set_channel(conn,CHANNEL_NAME_BANNED);  xfree((void *)chname);  return 0;  }extern int channel_add_connection(t_channel * channel, t_connection * connection){    t_channelmember * member;    t_connection *    user;        if (!channel)    {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");	return -1;    }    if (!connection)    {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");	return -1;    }        if (channel_check_banning(channel,connection))    {	channel_message_log(channel,connection,0,"JOIN FAILED (banned)");	return -1;    }    member = xmalloc(sizeof(t_channelmember));    member->connection = connection;    member->next = channel->memberlist;    channel->memberlist = member;    channel->currmembers++;    channel_message_log(channel,connection,0,"JOINED");        message_send_text(connection,message_type_channel,connection,channel_get_name(channel));    if ((!(channel->flags & channel_flags_permanent))         && (!(channel->flags & channel_flags_thevoid))         && (!(channel->flags & channel_flags_clan)) 	&& (channel->currmembers==1) 	&& (account_is_operator_or_admin(conn_get_account(connection),channel_get_name(channel))==0))    {	message_send_text(connection,message_type_info,connection,"you are now tempOP for this channel");	conn_set_tmpOP_channel(connection,(char *)channel_get_name(channel));	channel_update_userflags(connection);    }    if(!(channel_get_flags(channel) & channel_flags_thevoid))        for (user=channel_get_first(channel); user; user=channel_get_next())        {	    message_send_text(connection,message_type_adduser,user,NULL);    	    if (user!=connection)    		message_send_text(user,message_type_join,connection,NULL);        }        /* please don't remove this notice */    if (channel->log)	message_send_text(connection,message_type_info,connection,prefs_get_log_notice());        return 0;}extern int channel_del_connection(t_channel * channel, t_connection * connection){    t_channelmember * curr;    t_channelmember * temp;    t_elem * curr2;        if (!channel)    {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");        return -1;    }    if (!connection)    {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");        return -1;    }        channel_message_log(channel,connection,0,"PARTED");        channel_message_send(channel,message_type_part,connection,NULL);        curr = channel->memberlist;    if (curr->connection==connection)    {        channel->memberlist = channel->memberlist->next;        xfree(curr);    }    else    {        while (curr->next && curr->next->connection!=connection)            curr = curr->next;                if (curr->next)        {            temp = curr->next;            curr->next = curr->next->next;            xfree(temp);        }	else	{	    eventlog(eventlog_level_error,__FUNCTION__,"[%d] connection not in channel member list",conn_get_socket(connection));	    return -1;	}    }    channel->currmembers--;    if (conn_get_tmpOP_channel(connection) && 	strcmp(conn_get_tmpOP_channel(connection),channel_get_name(channel))==0)    {	conn_set_tmpOP_channel(connection,NULL);    }        if (!channel->memberlist && !(channel->flags & channel_flags_permanent)) /* if channel is empty, delete it unless it's a permanent channel */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产乱码精品一区二区三 | 成人毛片在线观看| 精品国产乱码91久久久久久网站| 首页欧美精品中文字幕| 欧美精品丝袜久久久中文字幕| 亚洲自拍偷拍欧美| 欧美日韩免费一区二区三区| 天堂av在线一区| 欧美电视剧免费观看| 国产在线日韩欧美| 中文字幕电影一区| 91丝袜美女网| 日韩国产欧美三级| 精品日韩99亚洲| 高清不卡一区二区在线| 亚洲天堂网中文字| 欧美日韩成人一区| 国产综合久久久久影院| 中文字幕在线不卡| 欧美老肥妇做.爰bbww| 黄网站免费久久| 中文字幕日本乱码精品影院| 欧美视频你懂的| 国产专区欧美精品| 日韩美女视频一区| 日韩欧美国产一区二区三区| 国产aⅴ综合色| 亚洲国产一区二区视频| 精品国产一区二区三区不卡| 91欧美激情一区二区三区成人| 午夜久久久久久| 国产精品久久久久影院| 欧美电影一区二区| 国产成人免费视频一区| 亚洲成人高清在线| 中文字幕av不卡| 日韩亚洲欧美在线观看| 99视频一区二区| 久久精品国产一区二区三区免费看| 国产精品超碰97尤物18| 日韩一级片在线观看| 99免费精品视频| 精品一区二区三区视频| 一区二区三国产精华液| 久久精品日韩一区二区三区| 欧美欧美欧美欧美| 97久久精品人人爽人人爽蜜臀| 日本人妖一区二区| 亚洲资源在线观看| 中文字幕欧美日韩一区| 欧美va在线播放| 欧美另类变人与禽xxxxx| 97成人超碰视| 国产99久久精品| 国产一区在线观看麻豆| 图片区小说区国产精品视频| 国产精品家庭影院| 精品国产百合女同互慰| 欧美性猛交xxxxxxxx| 99免费精品在线观看| 国产成人99久久亚洲综合精品| 日本 国产 欧美色综合| 亚洲第一狼人社区| 亚洲免费观看在线视频| 中文字幕欧美一区| 国产精品久久毛片| 国产精品久久久久久久久果冻传媒| 日韩精品中午字幕| 欧美一级片免费看| 欧美一区二区福利视频| 欧美三级乱人伦电影| 在线免费观看日韩欧美| 色综合天天综合狠狠| 精品视频一区三区九区| 岛国av在线一区| 国产成a人亚洲精品| 国产成人亚洲精品狼色在线| 国内成+人亚洲+欧美+综合在线| 美女精品自拍一二三四| 日日夜夜精品免费视频| 亚洲第一福利一区| 日韩国产欧美一区二区三区| 奇米影视在线99精品| 久久99热国产| 国产酒店精品激情| 国产a精品视频| 99re这里只有精品首页| 色悠久久久久综合欧美99| 色欧美88888久久久久久影院| 99久久99久久免费精品蜜臀| 不卡在线观看av| 色综合天天狠狠| 欧美性猛交一区二区三区精品| 欧美日韩视频在线第一区 | 精品国一区二区三区| 久久奇米777| 国产精品天干天干在观线| 国产精品毛片大码女人| 亚洲欧美乱综合| 五月婷婷久久综合| 韩国v欧美v日本v亚洲v| 成人毛片在线观看| 欧美亚洲自拍偷拍| 日韩欧美成人激情| 国产精品美女久久福利网站| 亚洲综合一区二区三区| 日本女人一区二区三区| 国产乱人伦精品一区二区在线观看 | 欧美成人欧美edvon| 久久久综合视频| 一区二区免费在线播放| 琪琪一区二区三区| 波多野结衣亚洲一区| 欧美日韩一区二区三区在线 | 国产伦理精品不卡| 99久久免费精品高清特色大片| 欧美日韩一本到| 久久久久久久网| 亚洲成av人综合在线观看| 国产真实乱对白精彩久久| 日本乱人伦aⅴ精品| 欧美成人一区二区三区在线观看 | 久久久影视传媒| 一区二区三国产精华液| 黄色日韩三级电影| 欧美综合一区二区三区| 久久久亚洲综合| 视频一区二区中文字幕| 成人听书哪个软件好| 日韩欧美久久久| 一区二区在线电影| 亚洲免费观看高清| 国产一区二区在线影院| 欧美色图12p| 亚洲视频一区在线| 国产福利一区二区三区视频| 欧美区视频在线观看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 日韩精品三区四区| 色呦呦国产精品| 欧美国产一区在线| 九九九久久久精品| 9191精品国产综合久久久久久| 中文字幕亚洲成人| 国产精品亚洲第一区在线暖暖韩国 | 亚洲综合视频在线| 成人免费毛片aaaaa**| 日韩一级视频免费观看在线| 亚洲一区二区美女| 91网站最新地址| 亚洲天堂网中文字| 成人免费看视频| 国产欧美日韩亚州综合| 久久99精品视频| 精品少妇一区二区三区日产乱码| 亚洲自拍偷拍综合| 91福利精品第一导航| 中文字幕中文字幕在线一区| 国产福利91精品一区| 精品久久久久香蕉网| 免费成人结看片| 717成人午夜免费福利电影| 亚洲线精品一区二区三区八戒| 91在线视频播放地址| 国产精品久久久久桃色tv| 国产精品一区二区三区四区| 欧美变态tickling挠脚心| 日韩av高清在线观看| 欧美精品自拍偷拍| 天堂成人国产精品一区| 日韩欧美一区二区免费| 日本三级韩国三级欧美三级| 欧美一区二区视频在线观看2020| 三级亚洲高清视频| 这里只有精品99re| 奇米777欧美一区二区| 欧美videofree性高清杂交| 久久 天天综合| 2024国产精品| 成人小视频在线观看| 国产精品不卡视频| 欧洲另类一二三四区| 午夜久久福利影院| 精品少妇一区二区三区日产乱码| 国产一区二区三区不卡在线观看| 久久久天堂av| 99这里都是精品| 亚洲第一av色| 精品黑人一区二区三区久久| 国产99久久久国产精品免费看 | 美国精品在线观看| www久久精品| 91免费小视频| 婷婷丁香久久五月婷婷| 日韩三级高清在线| 国产精品99久久久久久久女警| 国产精品久久久久影院色老大 | 日韩美女久久久| 欧美老肥妇做.爰bbww| 国产精品2024|