Common.cpp
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:2k
- #include "stdafx.h"
- #include <windows.h>
- #include "Socket.h"
- #include "Common.h"
- #include "WGS.h"
- #include "..XMudClient.h"
- #include "..FacePlate.h"
- #include "..MenuLoadOldPlay.h"
- #define DEFAULT_GAMESERVER_IP "0.0.0.0"
- extern rmfullglobals myglobs;
- extern int g_nGameState;
- extern CMenuLoadOldPlay m_MenuLoadOldPlay;
- extern D3DAppInfo* d3dapp;
- extern SOCKADDR_IN stRSvrName;
- extern int nSrvPort;
- extern CRITICAL_SECTION csMaplist;
- extern BOOL g_bInternConnect;
- extern BOOL bCloseSocket;
- TCHAR szDebugServer[]=DIRECTCONNECT;
- char szSendData[INPUT_SIZE];
- COLORREF colorEnable=RGB(0,255,0),colorDisable=RGB(128,128,255);
- extern SOCKET hLCltForRSvrSock;
- HFONT GetFont(int Height,char *Name,int Weight)
- {
- LOGFONT LogFont;
- HFONT font;
- ZeroMemory(&LogFont,sizeof(LOGFONT));
- LogFont.lfHeight =Height;
- LogFont.lfWidth =0;
- LogFont.lfWeight =Weight;
- LogFont.lfCharSet =CHINESEBIG5_CHARSET;
- LogFont.lfOutPrecision =OUT_STROKE_PRECIS;
- LogFont.lfClipPrecision =CLIP_STROKE_PRECIS;
- LogFont.lfQuality =DEFAULT_QUALITY;
- strcpy(LogFont.lfFaceName,Name);
- font=CreateFontIndirect(&LogFont);
- return font;
- }
- int LinkToWGS()
- {
- stRSvrName.sin_addr.s_addr=GetIPAddr(szDebugServer);
- stRSvrName.sin_family=PF_INET;
- stRSvrName.sin_port=htons(nSrvPort);
- wgs.AddMessage("硈絬い...");
- if(INVALID_SOCKET==
- (hLCltForRSvrSock=InitClient(&stRSvrName,myglobs.hWndMain,WSA_GAME))){
- wgs.AddMessage("既