Skip to content

Commit

Permalink
change nickname with space (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
FeffyLaffy authored Jun 10, 2022
1 parent 0638274 commit 20f435c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/command/cmd_nick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ namespace command {
ctx.server_peer->send_log(fmt::format("`4Usage: ``{}nickname <nickname>", ctx.prefix));
return;
}

ctx.server_peer->send_variant({ "OnNameChanged", ctx.args[0] }, ctx.local_player->get_net_id());
ctx.server_peer->send_log(fmt::format("Display name changed to {}", ctx.args[0]));
std::string name{ ctx.args.front() };
for (size_t i = 1; i < ctx.args.size(); ++i) {
name += " " + ctx.args[i];
}
ctx.server_peer->send_variant({ "OnNameChanged", name }, ctx.local_player->get_net_id());
ctx.server_peer->send_log(fmt::format("Display name changed to {}", name));
}
}
}

0 comments on commit 20f435c

Please sign in to comment.