00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <string>
00014 #include <map>
00015 #include "../general/communicate.h"
00016
00017 #define state_editor 1
00018 #define state_game 2
00019 #define state_pauzed 3
00020 #define state_winner 4
00021 #define state_finished 5
00022
00023 class server {
00024 private:
00025 int join;
00026 int goal;
00027 unsigned long c_time;
00028 unsigned int turns:10;
00029 unsigned int percentage:7;
00030 unsigned int speed;
00031 unsigned int no_player:10;
00032 std::string central_server;
00033 communicate comm;
00034 channel *c_channel;
00035 communicate cent_comm;
00036 channel *cent_ch;
00037 std::map<std::string, sigc::signal<void, std::string> > commands;
00038 void data_handler(channel *ch);
00039 void client_handler(channel *ch);
00040 void handler(channel *ch);
00041 int state;
00042 void data_session();
00043 void send_tile(pos t);
00044 string export_file;
00045 std::list<std::string> import_files;
00046
00047 public:
00048 server();
00049 void set_import(std::string);
00050 void set_export(std::string);
00051 void move(std::string);
00052 void set_add(std::string type);
00053 void set_number(std::string nr);
00054 void get_refresh(std::string pos);
00055 void ip_addr(std::string host);
00056 void session_set(std::string session);
00057 void log_level(std::string level);
00058 void log_file(std::string logfile);
00059 void do_fork(std::string file);
00060 void test_map(std::string file);
00061 void main_loop();
00062 };