-
Notifications
You must be signed in to change notification settings - Fork 0
/
evolution.c
54 lines (37 loc) · 823 Bytes
/
evolution.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
/*
* evolution.c
*
* Created on: Oct 3, 2015
* Author: thor
*/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "inc/server.h"
#include "inc/client.h"
#include "inc/management.h"
#include "inc/action.h"
#include "inc/environment.h"
#include "inc/room.h"
// main loop
int main( int argc, char **argv )
{
printf("Hello world\n");
Management manager = new_manager();
// add actions to the manager
action_add_to_manager( manager );
// add rooms to manager
room_add_to_manager( manager );
Server server = new_server();
if( start_server( server, 5555 ) < 0 ){
return 1;
}
environment_loop( server, manager );
/* ---------------------------------------
* Clean up
*/
close_server( server );
destroy_server( server );
destroy_manager( manager );
return 0;
}