?? cfightzone.h
字號:
////////////////////////////////////////////////////////////////////////////////////////
//
// CFIGHTZONE_H 2004斥 2巋 27老 陛
//
// by Mun Sung-hun (badajoa2002@hotmail.net)
// Copyright(C) 2004
//
//
////////////////////////////////////////////////////////////////////////////////////////
#ifndef CFIGHTZONE_H
#define CFIGHTZONE_H
#include "SafeMap.h"
#include "MemPool.h"
#include "PlayerInfo.h"
// 版扁 輛豐饒 府妮 矯埃 20檬饒 府妮 等促.
const int DEF_RECALLTIME = 20 ;
#define DEF_GAMESTARTTIME 0
#define DEF_GAMEENDTIME 1
#define DEF_GAMETIME 2
#define DEF_OBSERVER 10
class CMatch ;
typedef CMatch * _LPCMATCH;
class CFightZone{
public:
CFightZone();
~CFightZone();
_FIGHTZONE lpZoneInfor ;
_LPCMATCH m_lpMatch ; // 版扁 傅農
CXPtrList * m_lpListPlayer; // 立加 client 府膠飄
WORD nLayer ; // 葷捧厘 甘 Layer
WORD wSeq ; // 葷捧厘 絆蠟 鍋齲
DWORD dwMapSEQ ; // 葷捧厘 甘 SEQ
int nPlayer ; // 葷捧厘俊 立加茄 牢盔
DWORD dwReserveTime; // 葷捧厘 抗距 矯埃
DWORD dwTime ; // 葷捧厘 促瀾 畔 抗瀝 矯埃
short sTeamCount ; // 評狼 箭磊
WORD wTime ; // 葷捧厘 葷儈 矯埃(MAX 30 盒) 辨靛傈籃 (MAX 60盒)
BYTE UsePotion ; // 拱距 葷儈 啊瓷 咯何
BYTE Prize ; // 搗撈唱 拱扒 芭綽 葷捧牢瘤
BYTE Team ; // 俺牢傈, 頗萍傈, 辨靛傈
BYTE Type ; // 版扁 鷗澇 (飯歹, 疇富)
bool bIsStartMatch ;
bool bIsFightStart ;
bool bIsFightEnd ;
bool bIsHidden ;
short sMasterCount ; // 付膠磐狼 箭磊
char cTeamName [DEF_MAXTEAM][20] ; // 評狼 林厘 撈撫
short KilledCount [DEF_MAXTEAM] ;
short MemberCount [DEF_MAXTEAM] ;
short sMaxMember [DEF_MAXTEAM] ;
bool bTeamJoin [DEF_MAXTEAM] ;
void Send_GameEndMsg(short sWinTeam) ;
void Send_NoticeMsg(char *) ;
void Send_Msg(_LPSOCKET_FD lpSocketFd,char *) ;
void Send_NoticeMsgAndChangeMode(char * ,bool bIsStarGame) ;
void SendAll_Packet(_LPZEMIPACKET ) ;
void SendAll_PacketAndChangeMode(_LPZEMIPACKET, bool bIsStarGame ) ;
void SendToLobbyAll() ;
void GameEnd() ;
void GameStart();
void Send_Score() ;
void Send_PVPInfor();
void Send_Time(BYTE nTime = DEF_GAMESTARTTIME ) ;
void CheckProtectTime();
short sCountKilled() ;
short sCountMember() ;
void Clear() ;
} ;
typedef CFightZone * _LPCFIGHTZONE;
class CMatch
{
public:
CMatch();
~CMatch();
_LPCFIGHTZONE m_lpFightZone ;
DWORD m_dwMatchSEQ ;
BYTE Rule ; // 版扁逢 (Normal, KillCount ,killMaster , Masterkillcount)
DWORD MasterHandle[DEF_MAXTEAM] ;
short sWinTeam;
public:
void CheckWinTeam() ;
void CheckWinTeamForLogout() ;
bool bIsLoseTeam(PlayerInfo * lpPlayer) ;
bool bIsLogoutTeam(PlayerInfo * lpPlayer) ;
bool bCheckLocation(int nLayer,int x, int y) ;
void JoinTeam(_LPSOCKET_FD, int nTeam) ;
void LogOutTeam(_LPSOCKET_FD, int nTeam) ;
void Clear() ;
};
typedef CMatch * _LPCMATCH;
class CFightzoneManager
{
public:
CFightzoneManager();
CFightzoneManager(bool bIsMapServer);
~CFightzoneManager();
CMemPool<CFightZone> * lpFightzonePool;
CMemPool<CMatch> * lpMatchPool;
SafeMap * lpMapFightZone;
SafeMap * lpMapMatch;
WORD wFightZoneSeq ;
WORD nLobbyLayer ;
DWORD dwLobbyMapSEQ ;
WORD nHiddenLobbyLayer ;
DWORD dwHiddenLobbyMapSEQ ;
DWORD m_dwTimeTick ;
_POINT LobbyPoint ;
bool m_bIsMapServer;
bool bLoginZone(_LPSOCKET_FD lpSocketFD,DWORD dwMatchSeq, int nTeam, int x, int y ) ;
bool bIsTeleportZone(_LPSOCKET_FD lpSocketFD,DWORD dwMatchSeq) ;
bool bTeleportZone(_LPSOCKET_FD lpSocketFD,_POINT p, DWORD nMatchSeq, int nTeam) ;
void MatchReserve(_LPZW_FIGHTZONERESERVE) ;
void SetLobby(short nLayer,DWORD dwMapSeq, _POINT p ,bool bIsHidden = false) ;
void Register(_FIGHTZONE * lpZoneInfor,DWORD dwMapID ,int nlayer,int nPKMode = 0) ;
WORD wGetList(char * lpData) ;
void GetHiddenFightZone(DWORD &dwMatchSeq , DWORD &dwMapSeq, _POINT & p);
void CheckTick() ;
void PlayerDead(PlayerInfo * ,char * lpAttackerName) ;
void PlayerLogout(PlayerInfo * ,bool bForceLogout = false) ;
bool bCheckRevive(PlayerInfo * ,_POINT &,bool & bIsHidden ) ;
bool bGet_MatchInfor(DWORD dwMatchHandle, _LPZW_FIGHTZONERESERVE lpPacket) ;
void MatchEnd(DWORD dwMatchHandle) ;
_LPCMATCH Find_Match(DWORD dwHandle)
{
return (_LPCMATCH) lpMapMatch->Find(dwHandle) ;
}
_LPCFIGHTZONE Find_FightZone(DWORD dwHandle)
{
return (_LPCFIGHTZONE) lpMapFightZone->Find(dwHandle) ;
}
};
typedef CFightzoneManager * _LPCFIGHTZONEMANAGER ;
#endif //CFIGHTZONE_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -