aboutsummaryrefslogtreecommitdiff
path: root/src/communication.hh
blob: a54f704a94dfce3960dbbc7a72bb6064aa876404 (plain) (blame)
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
#ifndef TIBIA_COMMUNICATION_HH_
#define TIBIA_COMMUNICATION_HH_ 1

#include "common.hh"
#include "connections.hh"

struct TWaitinglistEntry {
    TWaitinglistEntry *Next;
    char Name[30];
    uint32 NextTry;
    bool FreeAccount;
    bool Newbie;
    bool Sleeping;
};

void GetCommunicationThreadStack(int *StackNumber, void **Stack);
void AttachCommunicationThreadStack(int StackNumber);
void ReleaseCommunicationThreadStack(int StackNumber);
void InitCommunicationThreadStacks(void);
void ExitCommunicationThreadStacks(void);

void InitLoadHistory(void);
bool LagDetected(void);
void NetLoad(int Amount, bool Send);
void NetLoadSummary(void);
void NetLoadCheck(void);

bool WriteToSocket(TConnection *Connection, uint8 *Buffer, int Size);
bool SendLoginMessage(TConnection *Connection, int Type, char *Message, int WaitingTime);

#endif //TIBIA_COMMUNICATION_HH_