|
| | Guilds (Database &database, Redis &redis) |
| absl::StatusOr< Membership > | Of (uint32_t player) |
| | The guild the character is in, or a NotFound error for none.
|
| absl::StatusOr< Membership > | Create (const std::string &world, uint32_t player, const std::string &name) |
| absl::StatusOr< Membership > | Invite (uint32_t from, uint32_t player) |
| absl::StatusOr< Membership > | Accept (uint32_t player) |
| absl::Status | Decline (uint32_t player) |
| | The player says no to the guild that asked, so that another can ask.
|
| absl::StatusOr< Left > | Leave (uint32_t player) |
| | The player leaves their guild, as LeaveGuild says, in a transaction.
|
| absl::StatusOr< Changed > | SetRank (uint32_t from, uint32_t player, protocol::Rank rank) |
| absl::StatusOr< Changed > | Kick (uint32_t from, uint32_t player) |
| absl::StatusOr< Membership > | Disband (uint32_t from) |
| absl::StatusOr< std::vector< protocol::GuildMember > > | Roster (uint32_t guild) |
| absl::StatusOr< War > | AskToWar (const std::string &world, uint32_t from, const std::string &name) |
| absl::StatusOr< std::vector< War > > | Wars (const std::string &world) |
Guilds and who's in them, in MySQL. A guild is in one world, as its characters are, and a character is in one guild at most. Unlike a player, whose own world saves them, a guild changes for players other than the one who acts, so it isn't in Redis: each change is a transaction. Only the invitations and the asks to war, which run out, are in Redis.
Definition at line 64 of file guilds.h.
| absl::StatusOr< Membership > nanommo::Guilds::Accept |
( |
uint32_t | player | ) |
|
The player joins the guild that asked them, as a member. A NotFound error says nobody asked, or that it's run out, or the guild is gone, AlreadyExists that they're in a guild, and ResourceExhausted that the guild is full.
Definition at line 243 of file guilds.cc.
| absl::StatusOr< War > nanommo::Guilds::AskToWar |
( |
const std::string & | world, |
|
|
uint32_t | from, |
|
|
const std::string & | name ) |
The leader asks the guild of that name in the world, whatever its case, to war, and it returns the two, with no id, as the war hasn't started. Or when that guild asked theirs first, a minute ago at most, it's a yes, and it returns the war, which starts now. A NotFound error says there's no guild of that name, or the one who asks is in none, PermissionDenied that they don't lead it, InvalidArgument that it's their own, AlreadyExists that they've asked it already, and FailedPrecondition that either guild is at war.
Definition at line 457 of file guilds.cc.
| absl::StatusOr< Membership > nanommo::Guilds::Invite |
( |
uint32_t | from, |
|
|
uint32_t | player ) |
Asks the player to join the guild of the one who asks, which an officer or the leader can do. A NotFound error says the one who asks is in no guild, a PermissionDenied one that they're a member, and AlreadyExists that a guild has asked the player, a minute ago at most, and they haven't answered. Returns the guild asked to join.
Definition at line 219 of file guilds.cc.
| absl::StatusOr< Changed > nanommo::Guilds::Kick |
( |
uint32_t | from, |
|
|
uint32_t | player ) |
Takes a player out of the guild of the one who asks, whose rank has to be above theirs: the leader removes officers and members, and officers members. A PermissionDenied error says it isn't, NotFound that the player isn't in their guild, and FailedPrecondition that it's at war.
Definition at line 349 of file guilds.cc.
| absl::StatusOr< std::vector< protocol::GuildMember > > nanommo::Guilds::Roster |
( |
uint32_t | guild | ) |
|
Who's in the guild, the highest rank first, and by name, as MySQL has them: their levels are a few seconds behind a world's, and none of them online, which only a world knows.
Definition at line 425 of file guilds.cc.