-
Notifications
You must be signed in to change notification settings - Fork 1
/
euro_net.c
53 lines (39 loc) · 1.41 KB
/
euro_net.c
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
51
52
53
#include <stdio.h>
#include <stdbool.h>
#include <SDL2/SDL_net.h>
#include "euro_def.h"
#include "cgdv.h"
#include "defines.h"
extern int network_on;
extern volatile int NetTeams[MAX_USERS], Players[MAX_USERS];
char EUROnetInitialise = FALSE;
//********************************************************************************************************************************
void InitEUROnet() {
if(SDLNet_Init() == -1) {
EUROnetInitialise = false;
printf("Network cannot be initialised.\n%s\n", SDLNet_GetError());
return;
}
EUROnetInitialise = true;
printf("Network initialised okay.\n");
}
//********************************************************************************************************************************
void UnInitEUROnet() {
if(EUROnetInitialise == true) {
SDLNet_Quit();
}
EUROnetInitialise = false;
}
//********************************************************************************************************************************
char CountNumberOfNETstarts() {
char Starts = 0;
for(char i = 0; i < network_on; i++) {
#ifdef IMPLEMENT_ME
if(NetTeams[i] >= 2) {
Starts++;
}
#endif
}
return (char)(network_on - Starts);
}
//********************************************************************************************************************************