-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMineServer.cpp
More file actions
51 lines (40 loc) · 1016 Bytes
/
MineServer.cpp
File metadata and controls
51 lines (40 loc) · 1016 Bytes
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
// MineServer.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include "ModuleMgr.h"
#include "DataBaseModule.h"
#include "TimeModule.h"
#include "LogModule.h"
#include "ProtocolModule.h"
#include "NetworkModule.h"
#include "LoginModule.h"
int _tmain(int argc, _TCHAR* argv[])
{
ModuleMgr* p_moduleMgr = ModuleMgr::getInstance();
//<!-- 核心模块
p_moduleMgr->registerModule( new TimeModule );
p_moduleMgr->registerModule( new LogModule );
p_moduleMgr->registerModule( new NetworkModule );
//p_moduleMgr->registerModule( new ProtocolModule );
p_moduleMgr->registerModule( new DataBaseModule );
//-->
//<!-- 扩展模块
p_moduleMgr->registerModule( new LoginModule );
//-->
while ( true )
{
printf( "Please input order:\n" );
std::string commend;
std::cin >> commend;
if (commend == "quit")
{
p_moduleMgr->unregisterAll();
break;
}
}
std::cout << "Server Quit Successfully!\nByeBye..." << std::endl;
Sleep( 5000 );
return 0;
}