aboutsummaryrefslogtreecommitdiff
path: root/src/login.h
blob: b3e60a0e7eaeb35982c2b9310fecba99232b3344 (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
32
33
#ifndef LOGIN_H
#define LOGIN_H
enum login_state {
  LoggedOut,
  EnterPassword,
  WantMakeAccount,
  MakePassword,
  MakeConfirmPassword,
  Complete
};

typedef struct player {
  int xp;
  int hp;
  int max_hp;
  int level;
  int location_id;

  char *pw_hash;
  char *name;
} player_t;

typedef struct player_conn {
  int conn;
  enum login_state state;
  player_t plr;
} playerc_t;

int step_login(playerc_t *player, int conn_fd);

void handle_player(int conn_fd);

#endif