-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetwork.h
More file actions
36 lines (25 loc) · 670 Bytes
/
Copy pathNetwork.h
File metadata and controls
36 lines (25 loc) · 670 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
#pragma once
#include <Ogre.h>
#include "BaseApplication.h"
enum NetworkState{GAME_SINGLE,GAME_CLIENT,GAME_SERVER};
class Network {
public:
Network(int,BaseApplication *);
void waitForConnection(int);
void searchForConnection(int, std::string);
void writeSendBuffer(char *);
bool sendPacket(int len=0);
bool receivePacket();
bool closeConnections();
BaseApplication* baseapp;
bool connected;
void setState(int);
NetworkState curState;
int clientsockfd;
int serversockfd;
char buffer[256];
char toSendPacket[256];
bool sendPacketReady;
char toRecPacket[256];
void printpacket(char *);
};