-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlobby.h
More file actions
80 lines (59 loc) · 1.76 KB
/
Copy pathlobby.h
File metadata and controls
80 lines (59 loc) · 1.76 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include "settings.h"
#include "terminvaders.h"
#include "server.h"
struct user_t {
int id;
int status;
char username[NAME_LEN + 1];
};
typedef struct user_t user_t;
struct multiplayergame_t {
int id;
int status;
int slots_total;
int slots_filled;
int players[MAX_SLOTS];
char name[NAME_LEN + 1];
int mode;
};
typedef struct multiplayergame_t multiplayergame_t;
void dispmultiframe();
int game();
void drawgame(int);
void printgame(int,int,multiplayergame_t);
int join_popup (multiplayergame_t*);
int create_popup ();
void help_popup ();
void game_wait(int);
int lobby();
void serverlogin();
int confirm_request(char*);
/* notes:
display all palyers in game
also the whitespace at the bottom; bottom entry should be disp at bottom
multiplayer button -> name and server entry -> the mainscreen
also make the invite / accept thign actualy.
*/
// 'lobby' shud rly be 'game'!!
/*
if u create a game
u go to a popup
select name, number of players, a mode
then go to a "waiting" screeen
and u can confirm/ reject invites
when players are full u just start game (as soon as u confirm last plaer)
after game over, quit to LOBBY
every 3 secconds make a call to server to get user invo for lobby
"so when connecting to the server (after hitting multiplayer on main menu + inputting server name in a box but before the lobby is displayed) you call int sockfd = make_connection(char* server_name); which is defined in network.h"
then to get user info, keep sockfd somewhere
then
transmit(sockfd, CMD_CONNECT, user_name); to tell server ur username
transmit(sockfd, CMD_USERS, NULL) to get a user LIST
*/