MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / pvp

Method pvp

source/game/StarCommandProcessor.cpp:118–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118String CommandProcessor::pvp(ConnectionId connectionId, String const&) {
119 if (!m_universe->isPvp(connectionId)) {
120 m_universe->setPvp(connectionId, true);
121 if (m_universe->isPvp(connectionId))
122 m_universe->adminBroadcast(strf("Player {} is now PVP", m_universe->clientNick(connectionId)));
123 } else {
124 m_universe->setPvp(connectionId, false);
125 if (!m_universe->isPvp(connectionId))
126 m_universe->adminBroadcast(strf("Player {} is a big wimp and is no longer PVP", m_universe->clientNick(connectionId)));
127 }
128
129 if (m_universe->isPvp(connectionId))
130 return "PVP active";
131 else
132 return "PVP inactive";
133}
134
135String CommandProcessor::whoami(ConnectionId connectionId, String const&) {
136 return strf("Server: You are {}. You are {}an Admin",

Callers

nothing calls this directly

Calls 5

strfFunction · 0.85
isPvpMethod · 0.45
setPvpMethod · 0.45
adminBroadcastMethod · 0.45
clientNickMethod · 0.45

Tested by

no test coverage detected