mirror of https://github.com/OpenTTD/OpenTTD
Codechange: [Network] Let server changing a client name use std::string
parent
d70fb74ac6
commit
8b9f1147df
|
@ -724,7 +724,7 @@ DEF_CONSOLE_CMD(ConClientNickChange)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NetworkServerChangeClientName(client_id, client_name.c_str())) {
|
if (!NetworkServerChangeClientName(client_id, client_name)) {
|
||||||
IConsoleError("Cannot give a client a duplicate name");
|
IConsoleError("Cannot give a client a duplicate name");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ void NetworkServerUpdateGameInfo();
|
||||||
void NetworkServerShowStatusToConsole();
|
void NetworkServerShowStatusToConsole();
|
||||||
bool NetworkServerStart();
|
bool NetworkServerStart();
|
||||||
void NetworkServerNewCompany(const Company *company, NetworkClientInfo *ci);
|
void NetworkServerNewCompany(const Company *company, NetworkClientInfo *ci);
|
||||||
bool NetworkServerChangeClientName(ClientID client_id, const char *new_name);
|
bool NetworkServerChangeClientName(ClientID client_id, const std::string &new_name);
|
||||||
|
|
||||||
|
|
||||||
void NetworkServerDoMove(ClientID client_id, CompanyID company_id);
|
void NetworkServerDoMove(ClientID client_id, CompanyID company_id);
|
||||||
|
|
|
@ -1719,7 +1719,7 @@ bool NetworkFindName(char *new_name, const char *last)
|
||||||
* @param new_name the new name for the client
|
* @param new_name the new name for the client
|
||||||
* @return true iff the name was changed
|
* @return true iff the name was changed
|
||||||
*/
|
*/
|
||||||
bool NetworkServerChangeClientName(ClientID client_id, const char *new_name)
|
bool NetworkServerChangeClientName(ClientID client_id, const std::string &new_name)
|
||||||
{
|
{
|
||||||
/* Check if the name's already in use */
|
/* Check if the name's already in use */
|
||||||
for (NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
|
for (NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
|
||||||
|
|
Loading…
Reference in New Issue