created a new config constructor...

...that takes a string and creates a config with an empty child with
the name of that string

reorganized the server code (moving things around, renaming)

commented some (unnecessary?) #includes out
This commit is contained in:
Gunter Labes 2007-10-22 22:09:21 +00:00
parent 59b45a142c
commit ef2f4c3fef
5 changed files with 513 additions and 517 deletions

View file

@ -32,11 +32,16 @@ config::config() : values(), children(), ordered_children()
{
}
config::config(const config& cfg) : values(), children(), ordered_children()
config::config(const config& cfg) : values(), children(), ordered_children()
{
append(cfg);
}
config::config(const std::string& child) : values(), children(), ordered_children()
{
add_child(child);
}
config::~config()
{
clear();

View file

@ -46,6 +46,9 @@ public:
config();
config(const config& cfg);
// Create a config with an empty child of name 'child'.
config(const std::string& child);
~config();
config& operator=(const config& cfg);

View file

@ -24,7 +24,7 @@
#include "network.hpp"
#include "network_worker.hpp"
#include "thread.hpp"
#include "util.hpp"
//#include "util.hpp"
#include "wassert.hpp"
#include "SDL_net.h"

View file

@ -637,7 +637,7 @@ void game::add_player(network::connection player, bool observer)
cfg.add_child("start_game");
network::queue_data(cfg, player);
//send observer join of all the observers in the game to player
//send observer join of all the observers in the game to players
for(std::vector<network::connection>::const_iterator ob = observers_.begin(); ob != observers_.end(); ++ob) {
if(*ob != player) {
info = player_info_->find(*ob);

File diff suppressed because it is too large Load diff