-
Notifications
You must be signed in to change notification settings - Fork 0
/
CPacketProcPhase.h
77 lines (68 loc) · 1.95 KB
/
CPacketProcPhase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef H_CLASS_PACKET_PROC_PHASE___
#define H_CLASS_PACKET_PROC_PHASE___
#include "windows.h"
#include "TCHAR.h"
#include <assert.h>
#include "util.h"
#include "../include/define.h"
#include "../include/types.h"
#include "../common/common.h"
#include "PacketMaker.h"
#include "CNetworkSession.h"
#include "CPacketProc.h"
class CPacketProcPhase : public CPacketProc
{
public:
CPacketProcPhase() : CPacketProc()
{
m_eGamePhase = GAME_PHASE_ROOM;
};
virtual ~CPacketProcPhase()
{
};
// 初期化
virtual BOOL Init(CNetworkSession *pNWSess)
{
m_eGamePhase = GAME_PHASE_ROOM;
return CPacketProc::Init(pNWSess);
};
// 初期化
virtual BOOL Init(CNetworkSession *pNWSess, CPacketProcPhase* pPrevPhase)
{
BOOL ret = this->Init(pNWSess);
m_pMasterSession = pPrevPhase->GetMasterSession();
m_nTeamCount = pPrevPhase->GetTeamCount();
m_nStageIndex = pPrevPhase->GetStageIndex();
m_bytRuleFlg = pPrevPhase->GetRuleFlg();
m_nTurnLimit = pPrevPhase->GetTurnLimit();
m_nActTimeLimit = pPrevPhase->GetActTimeLimit();
return ret;
};
virtual E_STATE_GAME_PHASE GetGamePhase() { return m_eGamePhase; };
virtual void SetGamePhase(E_STATE_GAME_PHASE value) { m_eGamePhase = value; };
ptype_session GetMasterSession() { return m_pMasterSession; };
void SetMasterSession(ptype_session sess)
{
sess->master = 1;
sess->game_ready = 0;
m_pMasterSession = sess;
};
int GetTeamCount() { return m_nTeamCount; };
int GetStageIndex() { return m_nStageIndex; };
BYTE GetRuleFlg() { return m_bytRuleFlg; };
int GetTurnLimit() { return m_nTurnLimit; };
int GetActTimeLimit() { return m_nActTimeLimit; };
// 切断処理 / return TRUE/FALSE:送信パケット有り/無し
virtual BOOL DisconnectSession(ptype_session sess);
protected:
// CNetworkSession *p_pNWSess;
// type_queue m_tQueue; // パケット作る用
E_STATE_GAME_PHASE m_eGamePhase;
ptype_session m_pMasterSession;
int m_nTeamCount;
BYTE m_bytRuleFlg;
int m_nStageIndex;
int m_nTurnLimit;
int m_nActTimeLimit;
};
#endif