stoneage8.5/石器时代8.5客户端最新源代码/石器源码/systeminc/netmain.h

98 lines
2.5 KiB
C
Raw Normal View History

2020-06-22 17:49:02 +08:00
#ifndef _NETMAIN_H_
#define _NETMAIN_H_
#include "../systeminc/version.h"
struct gameserver
{
char used;
char ipaddr[127];
char port[64];
char name[64];
2020-06-23 15:27:59 +08:00
#ifdef _SHOW_COUNT // WON ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2020-06-22 17:49:02 +08:00
char count[64];
#endif
#ifdef _SHOWIPSLEEP_
int delay;
#endif
};
struct gamegroup{
char used;
char num;
char startindex;
char name[61];
};
2020-06-23 15:27:59 +08:00
#define SUCCESSFULSTR "successful" // ??????<3F><>?<3F><>?<3F>e??
2020-06-22 17:49:02 +08:00
#define FAILEDSTR "failed"
#define OKSTR "ok"
#define CANCLE "cancle"
#define TIMEOUT (600*1000) // ????????????????????????
//#define NETBUFSIZ (1024*16)
//#define NETBUFSIZ (1024*8)
#define NETBUFSIZ (1024*64) // Robin 2004.05.04
extern char *net_writebuf;
extern char *net_readbuf;
extern int net_readbuflen;
extern int net_writebuflen;
extern unsigned int sockfd;
extern int server_choosed;
extern int init_net;
extern struct gameserver gmsv[];
#ifdef _LOG_MSG
extern char debugLogFileName[];
#endif
typedef int BOOL;
extern BOOL disconnectServerFlag;
extern BOOL oldDisconnectServerFlag;
int getServerInfo( int, char *, short * );
void networkLoop(void);
void networkMycharWalk( int gx , int gy , char *direction );
int initNet(void);
void cleanupNetwork( void );
int appendReadBuf( char *buf , int size );
int appendWriteBuf( int index , char *buf , int size );
int shiftReadBuf( int size );
int shiftWriteBuf( int size );
int getLineFromReadBuf( char *output , int maxlen );
int sendn( unsigned int s , char *buffer , int len );
int getServerInfoByServerName( char *servername , char *hostname , short *port );
// ????????
2020-06-23 15:27:59 +08:00
#define NET_ERRMSG_SOCKLIBERROR "<22><>·<EFBFBD><C2B7>δ׼<CEB4><D7BC><EFBFBD>á<EFBFBD>"
#define NET_ERRMSG_BADNAME "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>ȷ<EFBFBD><C8B7>"
#define NET_ERRMSG_SOCKETERROR "<22>޷<EFBFBD>ִ<EFBFBD><D6B4>socket<65><74>TCP<43><50>"
#define NET_ERRMSG_NOTGETADDR "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>"
#define NET_ERRMSG_NOTCONNECT_S "<22>޷<EFBFBD><DEB7><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD>"
#define NET_ERRMSG_NOTCONNECT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define NET_ERRMSG_CONNECTTIMEOUT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ѵ<EFBFBD><D1B5><EFBFBD>"
#define NET_ERRMSG_LOGINTIMEOUT "<22><><EFBFBD><EFBFBD><EBB4A6>ʱ<EFBFBD><CAB1><EFBFBD>ѵ<EFBFBD><D1B5><EFBFBD>"
#define NET_ERRMSG_CHARLISTTIMEOUT "<22><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ѵ<EFBFBD><D1B5><EFBFBD>"
#define NET_ERRMSG_LOGOUTTIMEOUT "<22>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ѵ<EFBFBD><D1B5><EFBFBD>"
#define NET_ERRMSG_LOGINFAIL "<22>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define NET_ERRMSG_CREATECHARTIMEOUT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ѵ<EFBFBD><D1B5><EFBFBD>"
#define NET_ERRMSG_DELETECHARTIMEOUT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ѵ<EFBFBD><D1B5><EFBFBD>"
#define NET_ERRMSG_VERSIONERROR "<22><><EFBFBD><EFBFBD>ǰ<EFBFBD>İ汾̫<E6B1BE>ɣ<EFBFBD><C9A3><EFBFBD>ʹ<EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>½<EFBFBD><C2BD>"
#define GAMESTATE_ERRMSG_LOGOUTDENY "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܾ<EFBFBD><DCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>dz<EFBFBD><C7B3><EFBFBD>"
2020-06-22 17:49:02 +08:00
#endif