Moved some structures around so they're accessible by both cli and serv

This commit is contained in:
Warwick 2023-08-15 16:19:09 +01:00
parent 61c57edc70
commit 599bc76379
4 changed files with 23 additions and 11 deletions

View file

@ -2,8 +2,7 @@
#include "world.h"
#include <error.h>
typedef enum { NORTH, EAST, SOUTH, WEST } move_directions;
#include <world_structures.h>
// Returns pointer to new room based on current room and direction If room
// doesn't exist returns NULL

View file

@ -7,15 +7,8 @@
#include <stdio.h>
#include <stdlib.h>
// Define what a room is.
typedef struct room {
char* name;
char* description;
struct room* north;
struct room* east;
struct room* south;
struct room* west;
} Room;
#include <world_structures.h>
// Creator and destructor for the world
Room* wrld__create();

View file

@ -23,3 +23,8 @@ int msg__accept_cli_connection(int server_sockfd);
// Handle logins
void msg__handle_login(int *con_sockfd);
void msg__login_req(int *con_sockfd, char *usernm, char *passwd);
// send and recive commands
void msg__handle_command(int *con_sockfd);
void msg__command_req(int *con_sockfd, char *usernm, char *passwd);

View file

@ -0,0 +1,15 @@
#pragma once
// Make world structures accessible to both server and client
// Define moveable directions
typedef enum { NORTH, EAST, SOUTH, WEST } move_directions;
// Define what a room is.
typedef struct room {
char* name;
char* description;
struct room* north;
struct room* east;
struct room* south;
struct room* west;
} Room;