game.cpp File Reference

#include "../global.hpp"
#include "../game_config.hpp"
#include "../log.hpp"
#include "../map.hpp"
#include "game.hpp"
#include "player.hpp"
#include <algorithm>
#include <iostream>
#include <memory>
#include <cassert>
#include <sstream>

Include dependency graph for server/game.cpp:

Go to the source code of this file.

Namespaces

namespace  chat_message

Defines

#define ERR_GAME   LOG_STREAM(err, mp_server)
#define WRN_GAME   LOG_STREAM(warn, mp_server)
#define LOG_GAME   LOG_STREAM(info, mp_server)
#define DBG_GAME   LOG_STREAM(debug, mp_server)

Functions

static void chat_message::truncate_message (const simple_wml::string_span &str, simple_wml::node &message)
 game::game (player_map &players, const network::connection host, const std::string name)
 game::~game ()
bool game::allow_observers () const
bool game::is_observer (const network::connection player) const
bool game::is_muted_observer (const network::connection player) const
bool game::is_player (const network::connection player) const
std::string describe_turns (int turn, const simple_wml::string_span &num_turns)
void game::start_game (const player_map::const_iterator starter)
bool game::take_side (const player_map::const_iterator user)
 Figures out which side to take and tells that side to the game owner.
void game::update_side_data ()
 Resets the side configuration according to the scenario data.
void game::transfer_side_control (const network::connection sock, const simple_wml::node &cfg)
void game::send_change_controller (const size_t side_num, const player_map::const_iterator newplayer, const bool player_left)
 Send [change_controller] message to tell all clients the new controller's name.
void game::transfer_ai_sides ()
void game::notify_new_host ()
bool game::describe_slots ()
bool game::player_is_banned (const network::connection sock) const
 Checks whether the connection's ip address is banned.
void game::mute_all_observers ()
void game::mute_observer (const simple_wml::node &mute, const player_map::const_iterator muter)
 Mute an observer or give a message of all currently muted observers if no name is given.
network::connection game::kick_member (const simple_wml::node &kick, const player_map::const_iterator kicker)
 Kick a member by name.
network::connection game::ban_user (const simple_wml::node &ban, const player_map::const_iterator banner)
 Ban a user by name.
void game::process_message (simple_wml::document &data, const player_map::iterator user)
bool game::is_legal_command (const simple_wml::node &command, bool is_player)
bool game::process_turn (simple_wml::document &data, const player_map::const_iterator user)
 Handles [end_turn], repackages [commands] with private [speak]s in them and sends the data.
bool game::end_turn ()
void game::add_player (const network::connection player, bool observer)
bool game::remove_player (const network::connection player, const bool disconnect)
 Removes a user from the game.
void game::send_user_list (const network::connection exclude) const
void game::load_next_scenario (const player_map::const_iterator user) const
 A member asks for the next scenario to advance to.
void game::send_data (simple_wml::document &data, const network::connection exclude) const
void game::send_to_one (simple_wml::document &data, const network::connection sock) const
void game::send_data_team (simple_wml::document &data, const simple_wml::string_span &team, const network::connection exclude) const
void game::send_data_observers (simple_wml::document &data, const network::connection exclude) const
bool game::is_on_team (const simple_wml::string_span &team, const network::connection player) const
void game::send_observerjoins (const network::connection sock) const
 Send [observer] tags of all the observers in the game to the user or everyone if none given.
void game::send_observerquit (const player_map::const_iterator observer) const
void game::send_history (const network::connection sock) const
void game::record_data (simple_wml::document *data)
void game::set_description (simple_wml::node *desc)
void game::set_termination_reason (const std::string &reason)
void game::add_players (const game &other_game, const bool observer)
const user_vector game::all_game_users () const
std::string game::debug_player_info () const
player_map::const_iterator game::find_user (const simple_wml::string_span &name) const
 Find a user by name.
void game::send_and_record_server_message (const char *message, const network::connection exclude)
void game::send_server_message_to_all (const char *message, network::connection exclude) const
void game::send_server_message (const char *message, network::connection sock, simple_wml::document *docptr) const

Variables

const size_t chat_message::max_message_length = 256


Define Documentation

#define DBG_GAME   LOG_STREAM(debug, mp_server)

#define ERR_GAME   LOG_STREAM(err, mp_server)

#define LOG_GAME   LOG_STREAM(info, mp_server)

#define WRN_GAME   LOG_STREAM(warn, mp_server)

Definition at line 31 of file server/game.cpp.


Function Documentation

std::string @269::describe_turns ( int  turn,
const simple_wml::string_span num_turns 
) [static]

Definition at line 104 of file server/game.cpp.

References simple_wml::string_span::begin(), buf, and simple_wml::string_span::end().

Referenced by game::end_turn().


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs