commandcheck.cpp
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:19k
- // CommandCheck.cpp: implementation of the CCommandCheck class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "XmudOS.h"
- #include "CommandCheck.h"
- #include "CmdPlayerLogon.h"
- #include "Common.h"
- extern rmfullglobals myglobs;
- extern CList <TClientConData *,TClientConData* >playersocketlist;
- extern char g_tszPathName[256];
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CCommandCheck::CCommandCheck()
- {
- }
- CCommandCheck::~CCommandCheck()
- {
- }
- void AddTalkMsg(CPlayerInfo *who, CString szMsg)
- {
- char szFile[256];
- EnterCriticalSection(&myglobs.csTalkMsg);
- CTime CurrentTime=CTime::GetCurrentTime();
- sprintf(szFile,"[%s,%s,%s] %sn",//CurrentTime.Format("%Y/%m/%d %H:%M:%S"),
- who->szCName, who->szEName, who->szUserName, szMsg);
- AddRecordMsg( szFile);
- LeaveCriticalSection(&myglobs.csTalkMsg);
- }
- void CCommandCheck::ProcessPlayerCommand(SOCKET hPlayerSocket,
- CStringList *Command,
- char * Result,
- sockaddr_in IPAddr,
- char * UserName,
- char * PlayerName,
- LPVOID &pvPlayer,
- PCLientConData lpConData)
- {
- CCmdPlayerLogon m_CmdPlayerLogon;
- CPlayerInfo *lpPlayerInfo;
- TClientConData * lpClientConData;
- int i,j;
- CString tmpMsg = _T("");
- strcpy(Result,"OK");
- // test +1
- char szTest[256];
- if (!lstrcmp(Command->GetHead(),szUserLogonCmd)){//