XMudClient.cpp
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:25k
- #define INITGUID
- #include "stdafx.h"
- #include "XMudClient.h"
- #include "MainWnd.h"
- #include "FacePlate.h"
- #include "CommandCheck.h"
- #include "MainScreen.h"
- #include "wgs/Socket.h"
- #include "wgs/common.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- BOOL bstartrend = FALSE;
- BOOL g_Redraw2dFace[2] = { FALSE,FALSE };
- BOOL g_Redraw3dFace[2] = { FALSE,FALSE };
- BOOL g_Clear3DMessage[2] = { FALSE,FALSE };
- CRITICAL_SECTION csAnimation;
- CRITICAL_SECTION csSrvMsg;
- CRITICAL_SECTION csSend;
- RECT g_rcMainSurfaceSource =
- {
- MAINFACEXPOS,
- MAINFACEYPOS,
- MAINFACEXPOS+MAINFACEWIELD,
- MAINFACEYPOS+MAINFACEHIGH
- };
- BOOL FirstTimeEnter=TRUE;
- BOOL bResizingDisabled = FALSE;
- extern BOOL ShowSystemMessage;
- int g_iCSScreen;
- int g_iCYScreen;
- DEVMODE g_DevMode;
- D3DAppInfo* d3dapp;
- rmfullglobals myglobs;
- char g_tszPathName[256];
- extern LPDIRECT3DRM3 g_lpD3DRM;
- extern BOOL InitResolution(void);
- extern char szSendBuf[];
- extern SOCKET hLCltForRSvrSock;
- SEND_DATA *sendHead=NULL;
- SEND_DATA *sendTail=NULL;
- BOOL Send(SOCKET s, CString str)
- {
- int iLen=str.GetLength();
- SEND_DATA *sendNew;
- if((iLen>0)&&(iLen<INPUT_SIZE))
- {
- if((iLen<128)||(str.Left(2) == _T("$1"))||(str.Left(2) == _T("$5"))||(str.Left(2) == _T("$9")))
- {
- if(NULL!=(sendNew=new SEND_DATA))
- {
- sendNew->hsock=s;
- if(NULL!=(sendNew->lpstrBuf=new char[iLen+2]))
- {
- lstrcpy(sendNew->lpstrBuf,str);
- lstrcat(sendNew->lpstrBuf,"27");
- sendNew->iLen=iLen+2;
- sendNew->next=NULL;
- if(sendTail!=NULL)
- sendTail->next=sendNew;
- else
- sendHead=sendNew;
- sendTail=sendNew;
- }
- else
- delete sendNew;
- }
- }
- }
- if(sendHead!=NULL){
- int nReturn=SendData(sendHead->hsock,sendHead->lpstrBuf,sendHead->iLen);
- if(WS_ERROR==nReturn){
- Msg("硈絬肚癳戈