Wesnothd: added a moderator
flag to player info
This commit is contained in:
parent
68e6a2ad30
commit
8ef6fe62ff
3 changed files with 3 additions and 1 deletions
|
@ -114,6 +114,7 @@ user_info::user_info(const config& c)
|
||||||
, state(game_id == 0 ? LOBBY : GAME)
|
, state(game_id == 0 ? LOBBY : GAME)
|
||||||
, registered(c["registered"].to_bool())
|
, registered(c["registered"].to_bool())
|
||||||
, observing(c["status"] == "observing")
|
, observing(c["status"] == "observing")
|
||||||
|
, moderator(c["moderator"].to_bool(false))
|
||||||
{
|
{
|
||||||
update_relation();
|
update_relation();
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,6 +130,7 @@ struct user_info
|
||||||
user_state state;
|
user_state state;
|
||||||
bool registered;
|
bool registered;
|
||||||
bool observing;
|
bool observing;
|
||||||
|
bool moderator;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,10 +33,10 @@ wesnothd::player::player(const std::string& n, simple_wml::node& cfg,
|
||||||
{
|
{
|
||||||
cfg_.set_attr_dup("name", n.c_str());
|
cfg_.set_attr_dup("name", n.c_str());
|
||||||
cfg_.set_attr("registered", registered ? "yes" : "no");
|
cfg_.set_attr("registered", registered ? "yes" : "no");
|
||||||
|
cfg_.set_attr("moderator", moderator ? "yes" : "no");
|
||||||
mark_available();
|
mark_available();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wesnothd::player::set_status(wesnothd::player::STATUS status)
|
void wesnothd::player::set_status(wesnothd::player::STATUS status)
|
||||||
{
|
{
|
||||||
status_ = status;
|
status_ = status;
|
||||||
|
|
Loading…
Add table
Reference in a new issue