mirror of
https://github.com/ytsodacan/Faucet.git
synced 2026-04-23 07:28:07 +00:00
fix: make BroadcastMessage actually send a message to all players
This commit is contained in:
parent
bd24ac2201
commit
436593031f
|
|
@ -182,8 +182,17 @@ std::wstring SDK::GetPlayerName(int index) {
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
void SDK::BroadcastMessage(const std::wstring& message) {
|
void SDK::BroadcastMessage(const std::wstring& message) {
|
||||||
PlayerList* list = GetPlayerList();
|
MinecraftServer* server = GetServer();
|
||||||
if (list) list->sendMessage(L"", message);
|
if (!server) return;
|
||||||
|
|
||||||
|
PlayerList* playerList = server->getPlayers();
|
||||||
|
if (!playerList) return;
|
||||||
|
|
||||||
|
int playerCap = playerList->players.size();
|
||||||
|
for (size_t i = 0; i < playerCap; i++)
|
||||||
|
{
|
||||||
|
playerList->sendMessage(playerList->players[i]->getName(), message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDK::SendMessageToPlayer(const std::wstring& playerName, const std::wstring& message) {
|
void SDK::SendMessageToPlayer(const std::wstring& playerName, const std::wstring& message) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue