-
Notifications
You must be signed in to change notification settings - Fork 22
/
Network.h
47 lines (29 loc) · 870 Bytes
/
Network.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
#pragma once
class CNetwork
{
public:
CNetwork(SOCKET *sockets, int socketCount);
~CNetwork();
void Think();
void ThinkSocket(SOCKET socket);
CClient *GetClient(WORD index);
WORD GetServerID();
void KickClient(class CClient* pClient);
void KickClient(WORD index);
void KillClient(WORD index);
void SendPacket(SOCKADDR_IN *, void *data, DWORD len);
void SendConnectlessBlob(SOCKADDR_IN *, BlobPacket_s *, DWORD dwFlags, DWORD dwSequence, WORD wTime);
private:
BOOL IsBannedIP(in_addr);
WORD GetClientSlot();
CClient *ValidateClient(WORD, sockaddr_in *);
CClient *FindClientByAccount(const char *);
void ConnectionRequest(sockaddr_in *addr, BlobPacket_s *p);
void ProcessConnectionless(sockaddr_in *, BlobPacket_s *);
SOCKET *m_sockets;
int m_socketCount;
WORD m_wID;
WORD m_freeslot;
WORD m_slotrange;
CClient* m_clients[400];
};