⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 connection.h

📁 打魔兽战网的都知道他是什么
💻 H
📖 第 1 页 / 共 2 页
字号:
/* * Copyright (C) 1998,1999,2000,2001  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. */#ifndef INCLUDED_CONNECTION_TYPES#define INCLUDED_CONNECTION_TYPES#ifdef CONNECTION_INTERNAL_ACCESS#ifdef JUST_NEED_TYPES# ifdef TIME_WITH_SYS_TIME#  include <sys/time.h>#  include <time.h># else#   if HAVE_SYS_TIME_H#    include <sys/time.h>#   else#    include <time.h>#   endif# endif# include "game.h"# include "common/queue.h"# include "channel.h"# include "account.h"# include "quota.h"# include "character.h"# include "versioncheck.h"# include "anongame.h"# include "realm.h"# include "common/tag.h"# include "common/elist.h"# include "common/packet.h"# include "common/rcm.h"#else# define JUST_NEED_TYPES# ifdef TIME_WITH_SYS_TIME#  include <sys/time.h>#  include <time.h># else#   if HAVE_SYS_TIME_H#    include <sys/time.h>#   else#    include <time.h>#   endif# endif# include "game.h"# include "common/queue.h"# include "channel.h"# include "account.h"# include "quota.h"# include "character.h"# include "versioncheck.h"# include "anongame.h"# include "realm.h"# include "common/tag.h"# include "common/elist.h"# include "common/packet.h"# include "common/rcm.h"# undef JUST_NEED_TYPES#endif#endiftypedef enum{    conn_class_init,    conn_class_bnet,    conn_class_file,    conn_class_bot,    conn_class_telnet,    conn_class_irc,     /* Internet Relay Chat */    conn_class_wol,     /* Westwood Online */    conn_class_d2cs_bnetd,    conn_class_w3route,    conn_class_none} t_conn_class;typedef enum{    conn_state_empty,    conn_state_initial,    conn_state_connected,    conn_state_loggedin,    conn_state_destroy,    conn_state_bot_username,    conn_state_bot_password,    conn_state_untrusted,    conn_state_pending_raw} t_conn_state;#ifdef CONNECTION_INTERNAL_ACCESStypedef enum{  conn_flags_welcomed		= 0x01,  conn_flags_udpok		= 0x02,  conn_flags_joingamewhisper	= 0x04,  conn_flags_leavegamewhisper	= 0x08,  conn_flags_echoback		= 0x10  } t_conn_flags;#endiftypedef struct connection#ifdef CONNECTION_INTERNAL_ACCESS{    struct {	int			tcp_sock;	unsigned int		tcp_addr;	unsigned short		tcp_port;	int			udp_sock;	unsigned int		udp_addr;	unsigned short		udp_port;	unsigned int		local_addr;	unsigned short		local_port;	unsigned int		real_local_addr;	unsigned short		real_local_port;	int			fdw_idx;    } socket; /* IP and socket specific data */    struct {	t_conn_class		class;	t_conn_state		state;	unsigned int		sessionkey;	unsigned int		sessionnum;	unsigned int		secret; /* random number... never sent over net unencrypted */	unsigned int		flags;	unsigned int		latency;	t_account *		account;	struct {	    t_tag			archtag;	    t_tag			gamelang;	    t_clienttag			clienttag;	    char const *		clientver;	    unsigned long		versionid; /* AKA bnversion */	    unsigned long		gameversion;	    unsigned long		checksum;	    char const *		country;	    int				tzbias;	    char const *		host;	    char const *		user;	    char const *		clientexe;	    char const *		owner;	    char const *		cdkey;	    t_versioncheck *		versioncheck; /* equation and MPQ file used to validate game checksum */	} client; /* client program specific data */	struct {	    t_queue *		outqueue;  /* packets waiting to be sent */	    unsigned int	outsize;   /* amount sent from the current output packet */	    unsigned int	outsizep;	    t_packet *		inqueue;   /* packet waiting to be processed */	    unsigned int	insize;    /* amount received into the current input packet */	} queues; /* network queues and related data */	struct {	    t_channel *		channel;	    char const *	tmpOP_channel;	    char const *	tmpVOICE_channel;	    char const *	away;	    char const * 	dnd;	    t_account * *	ignore_list;	    unsigned int	ignore_count;	    t_quota		quota;	    time_t		last_message;	    char const *	lastsender; /* last person to whisper to this connection */	    struct {		char const *		ircline; /* line cache for IRC connections */		unsigned int		ircping; /* value of last ping */		char const *		ircpass; /* hashed password for PASS authentication */	    } irc; /* irc chat specific data */	} chat; /* chat and messages specific data */	t_game *		game;	const char *		loggeduser;   /* username as logged in or given (not taken from account) */	struct connection *	bound; /* matching Diablo II auth connection */	t_elist			timers; /* cached list of timers for cleaning */	/* FIXME: this d2/w3 specific data could be unified into an union */	struct {	    t_realm *			realm;	    t_rcm_regref		realm_regref;	    t_character *		character;	    char const *		realminfo;	    char const *		charname;	} d2;	struct {	    char const *		w3_playerinfo; /* ADDED BY UNDYING SOULZZ 4/7/02 */	    time_t			anongame_search_starttime;   /* [zap-zero] 20020527 - matching w3route connection for game connection /    matching game connection for w3route connection */   /* FIXME: this "optimization" is so confusing leading to many possible bugs */	    struct connection *	routeconn;	    t_anongame *	anongame;	} w3;	struct {	    int ingame;				        /* Are we in a game channel? */	    	    int codepage;	    int locale;	    int gameType;	    	    char const * apgar;			    /* WOL User Password (encrypted) */	    char const * gameOptions;		/* Game Options */	} wol;	int			cr_time;	/* Pass fail count for bruteforce protection */	unsigned int		passfail_count;	/* connection flag substituting some other values */	t_conn_flags		cflags;   } protocol;}#endift_connection;#endif/*****/#ifndef JUST_NEED_TYPES

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -