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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? irc.c

?? 打魔獸戰網的都知道他是什么
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * Copyright (C) 2001  Marco Ziech (mmz@gmx.net) * Copyright (C) 2005  Bryan Biedenkapp (gatekeep@gmail.com) * * 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. */#include "common/setup_before.h"#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# ifdef HAVE_MEMORY_H#  include <memory.h># endif#endif#include "compat/strdup.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#include "common/irc_protocol.h"#include "common/packet.h"#include "common/eventlog.h"#include "connection.h"#include "common/bn_type.h"#include "common/field_sizes.h"#include "common/addr.h"#include "common/version.h"#include "common/queue.h"#include "common/list.h"#include "common/bnethash.h"#include "common/bnethashconv.h"#include "common/tag.h"#include "message.h"#include "account.h"#include "account_wrap.h"#include "channel.h"#include "irc.h"#include "prefs.h"#include "server.h"#include "tick.h"#include "message.h"#include "command_groups.h"#include "common/util.h"#include "common/xalloc.h"#include "common/setup_after.h"typedef struct {    char const * nick;    char const * user;    char const * host;} t_irc_message_from;static char ** irc_split_elems(char * list, int separator, int ignoreblank);static int irc_unget_elems(char ** elems);static char * irc_message_preformat(t_irc_message_from const * from, char const * command, char const * dest, char const * text);extern int irc_send_cmd(t_connection * conn, char const * command, char const * params){    t_packet * p;    char data[MAX_IRC_MESSAGE_LEN+1];    int len;    char const * ircname = server_get_hostname();     char const * nick;        if (!conn) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");	return -1;    }    if (!command) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL command");	return -1;    }    if (!(p = packet_create(packet_class_raw))) {	eventlog(eventlog_level_error,__FUNCTION__,"could not create packet");	return -1;    }    nick = conn_get_loggeduser(conn);    if (!nick)    	nick = "";    	    /* snprintf isn't portable -> check message length first */    if (params) {        len = 1+strlen(ircname)+1+strlen(command)+1+strlen(nick)+1+strlen(params)+2;	if (len > MAX_IRC_MESSAGE_LEN) {	    eventlog(eventlog_level_error,__FUNCTION__,"message to send is too large (%d bytes)",len);	    return -1;	}	else	    sprintf(data,":%s %s %s %s\r\n",ircname,command,nick,params);    } else {        len = 1+strlen(ircname)+1+strlen(command)+1+strlen(nick)+1+2;    	if (len > MAX_IRC_MESSAGE_LEN) {	    eventlog(eventlog_level_error,__FUNCTION__,"message to send is too large (%d bytes)",len);	    return -1;	}	else	sprintf(data,":%s %s %s\r\n",ircname,command,nick);    }    packet_set_size(p,0);    packet_append_data(p,data,len);    // eventlog(eventlog_level_debug,__FUNCTION__,"[%d] sent \"%s\"",conn_get_socket(conn),data);    conn_push_outqueue(conn,p);    packet_del_ref(p);    return 0;}extern int irc_send(t_connection * conn, int code, char const * params){    char temp[4]; /* '000\0' */        if (!conn) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");	return -1;    }    if ((code>999)||(code<0)) { /* more than 3 digits or negative */	eventlog(eventlog_level_error,__FUNCTION__,"invalid message code (%d)",code);	return -1;    }    sprintf(temp,"%03u",code);    return irc_send_cmd(conn,temp,params);}extern int irc_send_cmd2(t_connection * conn, char const * prefix, char const * command, char const * postfix, char const * comment){    t_packet * p;    char data[MAX_IRC_MESSAGE_LEN+1];    int len;        if (!conn) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");	return -1;    }    if (!prefix)    {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL prefix");	return -1;    }    if (!command) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL command");	return -1;    }    if (!postfix)    {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL postfix");	return -1;    }        if (!(p = packet_create(packet_class_raw))) {	eventlog(eventlog_level_error,__FUNCTION__,"could not create packet");	return -1;    }    if (comment) {        len = 1+strlen(prefix)+1+strlen(command)+1+strlen(postfix)+2+strlen(comment)+1+2;    	if (len > MAX_IRC_MESSAGE_LEN) {	    eventlog(eventlog_level_error,__FUNCTION__,"message to send is too large (%d bytes)",len);	    return -1;	}	else	    sprintf(data,":%s %s %s :%s\r\n",prefix,command,postfix,comment);    } else {        len = 1+strlen(prefix)+1+strlen(command)+1+strlen(postfix)+1+2;    	if (len > MAX_IRC_MESSAGE_LEN) {	    eventlog(eventlog_level_error,__FUNCTION__,"message to send is too large (%d bytes)",len);	    return -1;	}	else	sprintf(data,":%s %s %s\r\n",prefix,command,postfix);    }    packet_set_size(p,0);    packet_append_data(p,data,len);    // eventlog(eventlog_level_debug,__FUNCTION__,"[%d] sent \"%s\"",conn_get_socket(conn),data);    conn_push_outqueue(conn,p);    packet_del_ref(p);    return 0;}extern int irc_send_ping(t_connection * conn){    t_packet * p;    char data[MAX_IRC_MESSAGE_LEN];        if (!conn) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");	return -1;    }    if (!(p = packet_create(packet_class_raw))) {	eventlog(eventlog_level_error,__FUNCTION__,"could not create packet");	return -1;    }    if((conn_get_wol(conn) == 1))        return 0;    conn_set_ircping(conn,get_ticks());    if (conn_get_state(conn)==conn_state_bot_username)    	sprintf(data,"PING :%u\r\n",conn_get_ircping(conn)); /* Undernet doesn't reveal the servername yet ... neither do we */    else if ((6+strlen(server_get_hostname())+2+1)<=MAX_IRC_MESSAGE_LEN)    	sprintf(data,"PING :%s\r\n",server_get_hostname());    else    	eventlog(eventlog_level_error,__FUNCTION__,"maximum message length exceeded");    eventlog(eventlog_level_debug,__FUNCTION__,"[%d] sent \"%s\"",conn_get_socket(conn),data);    packet_set_size(p,0);    packet_append_data(p,data,strlen(data));    conn_push_outqueue(conn,p);    packet_del_ref(p);    return 0;}extern int irc_send_pong(t_connection * conn, char const * params){    t_packet * p;    char data[MAX_IRC_MESSAGE_LEN];        if (!conn) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");	return -1;    }    if ((1+strlen(server_get_hostname())+1+4+1+strlen(server_get_hostname())+((params)?(2+strlen(params)):(0))+2+1) > MAX_IRC_MESSAGE_LEN) {	eventlog(eventlog_level_error,__FUNCTION__,"max message length exceeded");	return -1;    }    if (!(p = packet_create(packet_class_raw))) {	eventlog(eventlog_level_error,__FUNCTION__,"could not create packet");	return -1;    }        if (params)    	sprintf(data,":%s PONG %s :%s\r\n",server_get_hostname(),server_get_hostname(),params);    else    	sprintf(data,":%s PONG %s\r\n",server_get_hostname(),server_get_hostname());    eventlog(eventlog_level_debug,__FUNCTION__,"[%d] sent \"%s\"",conn_get_socket(conn),data);    packet_set_size(p,0);    packet_append_data(p,data,strlen(data));    conn_push_outqueue(conn,p);    packet_del_ref(p);    return 0;}extern int irc_authenticate(t_connection * conn, char const * passhash){    t_hash h1;    t_hash h2;    t_account * a;    char const * temphash;    char const * username;    char const * tempapgar;    if (!conn) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");	return 0;    }    if (!passhash) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL passhash");	return 0;    }    username = conn_get_loggeduser(conn);    if (!username) {	/* redundant sanity check */	eventlog(eventlog_level_error,__FUNCTION__,"got NULL conn->protocol.loggeduser");	return 0;    }    a = accountlist_find_account(username);    if (!a) {    	irc_send_cmd(conn,"NOTICE",":Authentication failed."); /* user does not exist */	return 0;    }    if (connlist_find_connection_by_account(a) && prefs_get_kick_old_login()==0) {            irc_send_cmd(conn,"NOTICE",":Authentication rejected (already logged in) ");    }    else if (account_get_auth_lock(a)==1) {            irc_send_cmd(conn,"NOTICE",":Authentication rejected (account is locked) ");     }    else    {     	if((conn_get_wol(conn) == 1)) {    	    temphash = account_get_wol_apgar(a);    	    tempapgar = conn_wol_get_apgar(conn);    	        	    if(temphash == NULL) {        		account_set_wol_apgar(a,tempapgar);        		temphash = account_get_wol_apgar(a);    	    }    	        	    if(tempapgar == NULL) {                irc_send_cmd(conn,"NOTICE",":Authentication failed."); /* bad APGAR */                conn_increment_passfail_count(conn);                return 0;            }    	        	    if(strcmp(temphash,tempapgar) == 0) {                conn_login(conn,a,username);    	        conn_set_state(conn,conn_state_loggedin);        	    conn_set_clienttag(conn,CLIENTTAG_WWOL_UINT); /* WWOL hope here is ok */        		return 1;    	    }    	    else {        		conn_increment_passfail_count(conn);        		return 0;    	    }    	}        hash_set_str(&h1,passhash);        temphash = account_get_pass(a);	        hash_set_str(&h2,temphash);        if (hash_eq(h1,h2)) {            conn_login(conn,a,username);            conn_set_state(conn,conn_state_loggedin);            conn_set_clienttag(conn,CLIENTTAG_IIRC_UINT); /* IIRC hope here is ok */            irc_send_cmd(conn,"NOTICE",":Authentication successful. You are now logged in.");	    return 1;        } else {            irc_send_cmd(conn,"NOTICE",":Authentication failed."); /* wrong password */	    conn_increment_passfail_count(conn);        }    }    return 0;}extern int irc_welcome(t_connection * conn){    char temp[MAX_IRC_MESSAGE_LEN];    time_t temptime;    char const * tempname;    char const * temptimestr;    char const * filename;    FILE *fp;    char * line, * formatted_line;    char send_line[MAX_IRC_MESSAGE_LEN];    char motd_failed = 0;        if (!conn) {	eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");	return -1;    }    tempname = conn_get_loggeduser(conn);    if ((34+strlen(tempname)+1)<=MAX_IRC_MESSAGE_LEN)        sprintf(temp,":Welcome to the %s IRC Network %s",prefs_get_irc_network_name(), tempname);    else        sprintf(temp,":Maximum length exceeded");    irc_send(conn,RPL_WELCOME,temp);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲第一在线综合网站| 成人午夜免费av| 粉嫩av一区二区三区在线播放| 91在线精品一区二区三区| 欧美一区中文字幕| 亚洲精品日韩一| 国产xxx精品视频大全| 欧美一区二区三区视频免费播放| 国产精品欧美综合在线| 免费一级片91| 欧美日韩大陆一区二区| 国产精品三级视频| 精品一区二区精品| 欧美久久久影院| 怡红院av一区二区三区| 国产成人av资源| 久久综合九色综合欧美亚洲| 肉肉av福利一精品导航| 91福利精品第一导航| 国产精品久久三区| 国产成人自拍在线| 久久一日本道色综合| 久久狠狠亚洲综合| 欧美xxxxxxxx| 久久99精品久久久久婷婷| 4438成人网| 天天av天天翘天天综合网| 欧美日韩中字一区| 亚洲午夜激情av| 欧美日韩免费在线视频| 亚洲午夜三级在线| 欧美日韩夫妻久久| 男女视频一区二区| 精品久久99ma| 国产在线精品一区二区夜色 | 成人av午夜影院| 久久精品日产第一区二区三区高清版| 欧美aⅴ一区二区三区视频| 日韩欧美中文一区| 国产中文字幕一区| 欧美国产精品一区二区| 国产精品一二三区| 中文字幕一区二区在线观看 | 日韩欧美国产精品一区| 欧美a级一区二区| 精品美女在线观看| 国产精品香蕉一区二区三区| 国产精品国产三级国产普通话三级| 大陆成人av片| 一卡二卡欧美日韩| 欧美一区二区三区视频在线 | 免费人成在线不卡| wwww国产精品欧美| 成人黄色在线看| 亚洲福利电影网| 26uuu欧美日本| 99re热视频这里只精品| 五月婷婷激情综合| 国产日韩高清在线| 在线观看视频91| 激情综合网激情| 日韩美女啊v在线免费观看| 欧美美女bb生活片| 国产精品91xxx| 亚洲国产一区二区三区| 精品国产凹凸成av人网站| av在线不卡观看免费观看| 日韩在线观看一区二区| 国产午夜三级一区二区三| 欧美在线观看一区二区| 精品一区二区久久久| 亚洲影视在线播放| 久久久精品蜜桃| 欧美喷潮久久久xxxxx| 成人午夜电影网站| 免费高清在线视频一区·| 国产精品成人一区二区三区夜夜夜 | 欧美亚男人的天堂| 国产在线麻豆精品观看| 午夜精品久久久久久久久久久 | 一区二区三区中文字幕电影| 精品久久一二三区| 欧洲精品一区二区| 成人精品一区二区三区四区 | 久久精品视频在线看| 欧美男生操女生| 91视频在线看| 韩国中文字幕2020精品| 亚洲成人资源在线| 国产精品护士白丝一区av| 日韩一区二区三区三四区视频在线观看 | 国产欧美日韩在线| 欧美日韩激情一区二区| 99精品视频在线播放观看| 国产乱码一区二区三区| 婷婷六月综合亚洲| 一区二区欧美精品| 中文字幕在线一区免费| 久久亚洲春色中文字幕久久久| 欧美一区午夜精品| 欧美伦理影视网| 欧美性大战久久久| 一本一本大道香蕉久在线精品 | 国产一区欧美一区| 蜜臀av国产精品久久久久| 国产福利一区二区三区视频在线| 婷婷中文字幕综合| 亚洲一区二区在线免费观看视频| 中文字幕av资源一区| 国产欧美一区二区精品性| 久久精品综合网| 久久精品水蜜桃av综合天堂| 久久久一区二区| 中文字幕av一区 二区| 国产精品人成在线观看免费| 国产精品久久久久精k8| 亚洲欧美影音先锋| 亚洲欧美偷拍三级| 亚洲人一二三区| 亚洲精品成人在线| 亚洲大片在线观看| 亚洲mv大片欧洲mv大片精品| 亚洲电影视频在线| 日韩电影免费在线观看网站| 偷拍一区二区三区| 精品一区二区在线观看| 国产一区二区成人久久免费影院| 国产永久精品大片wwwapp| 国产成人精品免费在线| 不卡一区中文字幕| 色999日韩国产欧美一区二区| 91麻豆国产在线观看| 在线中文字幕一区| 日韩欧美自拍偷拍| 国产日韩欧美在线一区| 中文字幕亚洲一区二区av在线| 亚洲欧美日韩久久| 蜜臀av性久久久久av蜜臀妖精| 国产真实乱子伦精品视频| 99免费精品在线观看| 欧美午夜不卡视频| 精品久久国产老人久久综合| 国产亚洲精品精华液| 亚洲男人的天堂在线aⅴ视频| 一级女性全黄久久生活片免费| 日韩精品色哟哟| 成人综合激情网| 色屁屁一区二区| 中文字幕一区二区在线播放| 亚洲高清视频在线| 国产综合色精品一区二区三区| 91麻豆精品在线观看| 69堂国产成人免费视频| 国产精品视频免费看| 无码av免费一区二区三区试看| 国产一区二区女| 欧美日韩一区二区三区四区五区| 欧美一卡二卡三卡| 中文字幕在线不卡一区| 免费观看久久久4p| 91麻豆精东视频| 久久久www成人免费无遮挡大片| 亚洲综合区在线| 国产精品18久久久久久久久| 欧美日韩精品福利| 国产精品美女一区二区三区| 青娱乐精品视频在线| 91在线视频18| 久久精品视频一区二区三区| 日本美女视频一区二区| 91视视频在线直接观看在线看网页在线看 | 久久精品男人天堂av| 婷婷综合另类小说色区| av一二三不卡影片| 久久久影视传媒| 免费三级欧美电影| 欧美亚洲一区二区三区四区| 欧美国产精品劲爆| 奇米影视一区二区三区| 欧美在线短视频| 亚洲欧美国产77777| 国产成人av一区二区| 日韩欧美综合一区| 日本成人中文字幕| 91精品国产入口| 亚洲第一福利一区| 91久久免费观看| ●精品国产综合乱码久久久久| 韩国av一区二区三区四区| 欧美一区二区观看视频| 日韩精品久久久久久| 欧美日韩日日夜夜| 亚洲成av人片一区二区| 欧美日韩一区精品| 亚洲第一电影网| 6080午夜不卡| 久久99精品网久久| 久久免费国产精品| 国产精品一卡二卡| 亚洲国产成人在线|