fight.cpp
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:21k
- // Fight.cpp: implementation of the CFight class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "XmudOS.h"
- #include "MainWnd.h"
- #include "CmdPlayerLogon.h"
- #include "Fight.h"
- #include "mapMapInfo.h"
- #include "npcNpc.h"
- #include "Common.h"
- #include "hash.h"
- extern rmfullglobals myglobs;
- extern char g_tszPathName[256];
- extern int g_iActiveClientNum;
- extern CList <TClientConData *,TClientConData* >playersocketlist;
- extern CList <CBaseMap*,CBaseMap*>maplist;
- extern CList <CFight*,CFight*>killlist;
- extern CList <CFight*,CFight*>fightlist;
- // Spock start
- extern void GetPlayerTitle(CPlayerInfo *lpPlayerInfo);
- #define CSWAIT 2
- #define HBWAIT 5
- // Spock end
- //////////////////////////////////////////////////////////////////////
- static void DoHeartBeat();
- //////////////////////////////////////////////////////////////////////
- BOOL CMainWnd::CreateHeartBeatThread()
- {
- AddRecordMsg("Begin Fight Thread...");
- DWORD ThreadId;
- myglobs.hHeartBeatThreadHandle = CreateThread (NULL,0,HeartBeatThread,NULL,0,&ThreadId);
- if (!myglobs.hHeartBeatThreadHandle)
- {
- AfxMessageBox("Create Fight Thread Failed");
- return FALSE;
- }
- return TRUE;
- }
- // Spock start
- DWORD WINAPI HeartBeatThread (LPVOID WorkContext)
- {
- CFight m_Fight;
- unsigned int timeStart;
- int time = 0;
- char szT[256], szFile[256];
- static char StartTime[256]={""};
- CTime Now;
- Now=CTime::GetCurrentTime();
- sprintf( StartTime,"%s", Now.Format("%m/%d/%H"));
- //纔