-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
131 lines (110 loc) · 3.36 KB
/
main.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#ifndef H_MAIN___
#define H_MAIN___
// ===================================================================
// main.h
// 画面管理クラス動作テスト(with ファイル分割)・ヘッダー
// ===================================================================
#include <windows.h>
#include <time.h>
#include <winsock.h>
#include <stdio.h>
#define _CRTDBG_MAP_ALLOC
#define _CRTDBG_MAPALLOC
#include <crtdbg.h>
#include "../include/define.h"
#include "util.h"
#include "dxerr9.h"
#include "CDlgMain.h"
#pragma comment(lib, "wsock32.lib")
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#include "ext.h"
#include "../include/types.h"
#if USE_LUA
#include <lua.hpp>
#include "tolua++.h"
#include "tolua_glue/thg_glue.h"
#include "LuaHelper.h"
#endif
#include "CIniFile.h"
#include "../common/CPacketQueue.h"
#include "../common/common.h"
#include "CNetworkSession.h"
#include "CPacketProc.h"
#include "CPacketProcPhase.h"
#include "CPacketProcAuth.h"
#include "CPacketProcChat.h"
#include "CPacketProcRoom.h"
#include "CPacketProcLoad.h"
#include "CPacketProcMain.h"
#include "CPacketProcResult.h"
#include "CSyncProc.h"
#include "CSyncRoom.h"
#include "CSyncLoad.h"
#include "CSyncMain.h"
#include "resource.h"
#ifdef _DEBUG
#pragma comment(lib, "util_d.lib")
#pragma comment(lib, "IniFile_d.lib")
#else
#pragma comment(lib, "util.lib")
#pragma comment(lib, "IniFile.lib")
#endif
/* =================================== */
/* ===== 外部参照グローバル変数 ===== */
/* =================================== */
class CSyncMain;
/* =================================== */
/* ===== 外部参照関数プロトタイプ===== */
/* =================================== */
extern CPacketQueue* g_pPacketQueue;
extern CNetworkSession* g_pNetSess;
extern CPacketProcAuth* g_pPPAuth;
extern CPacketProcChat* g_pPPChat;
extern CPacketProcRoom* g_pPPRoom;
extern CPacketProcLoad* g_pPPLoad;
extern CPacketProcMain* g_pPPMain;
extern CPacketProcResult* g_pPPResult;
extern CPacketProcPhase* g_pPPPhase;
extern CSyncRoom* g_pSyncRoom;
extern CSyncLoad* g_pSyncLoad;
extern CSyncMain* g_pSyncMain;
extern int g_nMaxSendPacketOneLoop;
/* =================================== */
/* ===== Lua 参照関数プロトタイプ===== */
/* =================================== */
/* =================================== */
/* ===== プロトタイプ宣言 ===== */
/* =================================== */
BOOL InitSystem(HINSTANCE hInst);
void EndProgram();
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
BOOL CALLBACK DlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM lp);
BOOL InitSystem(HINSTANCE hInst);
DWORD __stdcall Thread_PacketReceiver(PVOID param);
DWORD __stdcall Thread_Synchronizer(LPVOID param);
DWORD __stdcall Thread_PacketSender(PVOID param);
int NewUserSession(fd_set *rfds, int nTcpSock, CNetworkSession *pNWSess, pptype_session ppSess);
int ErrorUserSession(int nConnectSocket, fd_set *efds, int nRecvSize, CNetworkSession *pNWSess, ptype_session sess);
void DisconnectSession(ptype_session sess);
BOOL PacketProc(CNetworkSession *pNWSess, BYTE* msg, ptype_session sess, INT msgsize);
void PacketEnqueue();
void MoveMainstage(ptype_session sess);
enum E_COPYDATA_RESULT_GAME_STATE:BYTE
{
gsNone,
gsRoom,
gsGame,
};
typedef struct TWM_COPYDATA
{
BYTE client_num;
BYTE live_num;
E_COPYDATA_RESULT_GAME_STATE state;
char vtype;
WORD vy;
BYTE vm;
BYTE vd;
} type_wmCopyData;
#endif