aboutsummaryrefslogtreecommitdiff
path: root/src/login.h
blob: 6d4cc3ddb31889f07f3b0712f9d4901ea43f6aea (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
#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 *name[];
} player_t;

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

int step_login(playerc_t *player, int conn_fd);

void handle_player(int conn_fd);

#endif