-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.cpp
45 lines (33 loc) · 978 Bytes
/
Main.cpp
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
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <thread>
#include "RakPeerInterface.h"
#include "MessageIdentifiers.h"
#include "PacketPriority.h"
#include "RakNetVersion.h"
#include "BitStream.h"
#include "Util.h"
#include "Server.h"
#include "consolecommands.h"
#define MAX_CLIENTS 20
#define TPS 20
#define SERVER_NAME "MC++SERVER"
using namespace std;
int playerCount;
int tps[20] = { 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20 };
int main(void)
{
//Hello wurld
printf("Starting %s\n", SERVER_NAME);
printf("RakNet Protocol : %d\n", RAKNET_PROTOCOL_VERSION);
printf("MCPE Version : [%s]%s\n", MCPE_PROTOCOL, MCPE_VERSION);
printf("Maximum player count : %d\n", MAX_CLIENTS);
thread server([] { Packets::InvokeServer(19132, "0.0.0.0", 20, "MC++ testserver"); });
thread CommandHandler([] { ConsoleCommands::HandleCommands(); });
server.join();
CommandHandler.join();
while (1);
}