Merge: Codechange: Use null pointer literal instead of the NULL macro
This commit is contained in:
@@ -71,7 +71,7 @@ struct PacketWriter : SaveFilter {
|
||||
* Create the packet writer.
|
||||
* @param cs The socket handler we're making the packets for.
|
||||
*/
|
||||
PacketWriter(ServerNetworkGameSocketHandler *cs) : SaveFilter(NULL), cs(cs), current(NULL), total_size(0), packets(NULL)
|
||||
PacketWriter(ServerNetworkGameSocketHandler *cs) : SaveFilter(nullptr), cs(cs), current(nullptr), total_size(0), packets(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@ struct PacketWriter : SaveFilter {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(this->mutex);
|
||||
|
||||
if (this->cs != NULL) this->exit_sig.wait(lock);
|
||||
if (this->cs != nullptr) this->exit_sig.wait(lock);
|
||||
|
||||
/* This must all wait until the Destroy function is called. */
|
||||
|
||||
while (this->packets != NULL) {
|
||||
while (this->packets != nullptr) {
|
||||
Packet *p = this->packets->next;
|
||||
delete this->packets;
|
||||
this->packets = p;
|
||||
@@ -97,7 +97,7 @@ struct PacketWriter : SaveFilter {
|
||||
* Begin the destruction of this packet writer. It can happen in two ways:
|
||||
* in the first case the client disconnected while saving the map. In this
|
||||
* case the saving has not finished and killed this PacketWriter. In that
|
||||
* case we simply set cs to NULL, triggering the appending to fail due to
|
||||
* case we simply set cs to nullptr, triggering the appending to fail due to
|
||||
* the connection problem and eventually triggering the destructor. In the
|
||||
* second case the destructor is already called, and it is waiting for our
|
||||
* signal which we will send. Only then the packets will be removed by the
|
||||
@@ -107,7 +107,7 @@ struct PacketWriter : SaveFilter {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(this->mutex);
|
||||
|
||||
this->cs = NULL;
|
||||
this->cs = nullptr;
|
||||
|
||||
this->exit_sig.notify_all();
|
||||
lock.unlock();
|
||||
@@ -128,7 +128,7 @@ struct PacketWriter : SaveFilter {
|
||||
*/
|
||||
bool HasPackets()
|
||||
{
|
||||
return this->packets != NULL;
|
||||
return this->packets != nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +140,7 @@ struct PacketWriter : SaveFilter {
|
||||
|
||||
Packet *p = this->packets;
|
||||
this->packets = p->next;
|
||||
p->next = NULL;
|
||||
p->next = nullptr;
|
||||
|
||||
return p;
|
||||
}
|
||||
@@ -148,23 +148,23 @@ struct PacketWriter : SaveFilter {
|
||||
/** Append the current packet to the queue. */
|
||||
void AppendQueue()
|
||||
{
|
||||
if (this->current == NULL) return;
|
||||
if (this->current == nullptr) return;
|
||||
|
||||
Packet **p = &this->packets;
|
||||
while (*p != NULL) {
|
||||
while (*p != nullptr) {
|
||||
p = &(*p)->next;
|
||||
}
|
||||
*p = this->current;
|
||||
|
||||
this->current = NULL;
|
||||
this->current = nullptr;
|
||||
}
|
||||
|
||||
void Write(byte *buf, size_t size) override
|
||||
{
|
||||
/* We want to abort the saving when the socket is closed. */
|
||||
if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);
|
||||
if (this->cs == nullptr) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);
|
||||
|
||||
if (this->current == NULL) this->current = new Packet(PACKET_SERVER_MAP_DATA);
|
||||
if (this->current == nullptr) this->current = new Packet(PACKET_SERVER_MAP_DATA);
|
||||
|
||||
std::lock_guard<std::mutex> lock(this->mutex);
|
||||
|
||||
@@ -187,7 +187,7 @@ struct PacketWriter : SaveFilter {
|
||||
void Finish() override
|
||||
{
|
||||
/* We want to abort the saving when the socket is closed. */
|
||||
if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);
|
||||
if (this->cs == nullptr) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);
|
||||
|
||||
std::lock_guard<std::mutex> lock(this->mutex);
|
||||
|
||||
@@ -230,9 +230,9 @@ ServerNetworkGameSocketHandler::~ServerNetworkGameSocketHandler()
|
||||
if (_redirect_console_to_client == this->client_id) _redirect_console_to_client = INVALID_CLIENT_ID;
|
||||
OrderBackup::ResetUser(this->client_id);
|
||||
|
||||
if (this->savegame != NULL) {
|
||||
if (this->savegame != nullptr) {
|
||||
this->savegame->Destroy();
|
||||
this->savegame = NULL;
|
||||
this->savegame = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,12 +240,12 @@ Packet *ServerNetworkGameSocketHandler::ReceivePacket()
|
||||
{
|
||||
/* Only allow receiving when we have some buffer free; this value
|
||||
* can go negative, but eventually it will become positive again. */
|
||||
if (this->receive_limit <= 0) return NULL;
|
||||
if (this->receive_limit <= 0) return nullptr;
|
||||
|
||||
/* We can receive a packet, so try that and if needed account for
|
||||
* the amount of received data. */
|
||||
Packet *p = this->NetworkTCPSocketHandler::ReceivePacket();
|
||||
if (p != NULL) this->receive_limit -= p->size;
|
||||
if (p != nullptr) this->receive_limit -= p->size;
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta
|
||||
|
||||
this->GetClientName(client_name, lastof(client_name));
|
||||
|
||||
NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, NULL, STR_NETWORK_ERROR_CLIENT_CONNECTION_LOST);
|
||||
NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, nullptr, STR_NETWORK_ERROR_CLIENT_CONNECTION_LOST);
|
||||
|
||||
/* Inform other clients of this... strange leaving ;) */
|
||||
FOR_ALL_CLIENT_SOCKETS(new_cs) {
|
||||
@@ -365,7 +365,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendCompanyInfo()
|
||||
|
||||
/* Add the local player (if not dedicated) */
|
||||
const NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(CLIENT_ID_SERVER);
|
||||
if (ci != NULL && Company::IsValidID(ci->client_playas)) {
|
||||
if (ci != nullptr && Company::IsValidID(ci->client_playas)) {
|
||||
strecpy(clients[ci->client_playas], ci->client_name, lastof(clients[ci->client_playas]));
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendCompanyInfo()
|
||||
((ServerNetworkGameSocketHandler*)csi)->GetClientName(client_name, lastof(client_name));
|
||||
|
||||
ci = csi->GetInfo();
|
||||
if (ci != NULL && Company::IsValidID(ci->client_playas)) {
|
||||
if (ci != nullptr && Company::IsValidID(ci->client_playas)) {
|
||||
if (!StrEmpty(clients[ci->client_playas])) {
|
||||
strecat(clients[ci->client_playas], ", ", lastof(clients[ci->client_playas]));
|
||||
}
|
||||
@@ -438,7 +438,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendError(NetworkErrorCode err
|
||||
|
||||
DEBUG(net, 1, "'%s' made an error and has been disconnected. Reason: '%s'", client_name, str);
|
||||
|
||||
NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, NULL, strid);
|
||||
NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, nullptr, strid);
|
||||
|
||||
FOR_ALL_CLIENT_SOCKETS(new_cs) {
|
||||
if (new_cs->status > STATUS_AUTHORIZED && new_cs != this) {
|
||||
@@ -467,12 +467,12 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendNewGRFCheck()
|
||||
const GRFConfig *c;
|
||||
uint grf_count = 0;
|
||||
|
||||
for (c = _grfconfig; c != NULL; c = c->next) {
|
||||
for (c = _grfconfig; c != nullptr; c = c->next) {
|
||||
if (!HasBit(c->flags, GCF_STATIC)) grf_count++;
|
||||
}
|
||||
|
||||
p->Send_uint32 (grf_count);
|
||||
for (c = _grfconfig; c != NULL; c = c->next) {
|
||||
for (c = _grfconfig; c != nullptr; c = c->next) {
|
||||
if (!HasBit(c->flags, GCF_STATIC)) this->SendGRFIdentifier(p, &c->ident);
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
|
||||
if (last_packet) {
|
||||
/* Done reading, make sure saving is done as well */
|
||||
this->savegame->Destroy();
|
||||
this->savegame = NULL;
|
||||
this->savegame = nullptr;
|
||||
|
||||
/* Set the status to DONE_MAP, no we will wait for the client
|
||||
* to send it is ready (maybe that happens like never ;)) */
|
||||
@@ -619,17 +619,17 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
|
||||
|
||||
/* Find the best candidate for joining, i.e. the first joiner. */
|
||||
NetworkClientSocket *new_cs;
|
||||
NetworkClientSocket *best = NULL;
|
||||
NetworkClientSocket *best = nullptr;
|
||||
FOR_ALL_CLIENT_SOCKETS(new_cs) {
|
||||
if (new_cs->status == STATUS_MAP_WAIT) {
|
||||
if (best == NULL || best->GetInfo()->join_date > new_cs->GetInfo()->join_date || (best->GetInfo()->join_date == new_cs->GetInfo()->join_date && best->client_id > new_cs->client_id)) {
|
||||
if (best == nullptr || best->GetInfo()->join_date > new_cs->GetInfo()->join_date || (best->GetInfo()->join_date == new_cs->GetInfo()->join_date && best->client_id > new_cs->client_id)) {
|
||||
best = new_cs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Is there someone else to join? */
|
||||
if (best != NULL) {
|
||||
if (best != nullptr) {
|
||||
/* Let the first start joining. */
|
||||
best->status = STATUS_AUTHORIZED;
|
||||
best->SendMap();
|
||||
@@ -950,9 +950,9 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_JOIN(Packet *p)
|
||||
|
||||
this->status = STATUS_NEWGRFS_CHECK;
|
||||
|
||||
if (_grfconfig == NULL) {
|
||||
if (_grfconfig == nullptr) {
|
||||
/* Behave as if we received PACKET_CLIENT_NEWGRFS_CHECKED */
|
||||
return this->Receive_CLIENT_NEWGRFS_CHECKED(NULL);
|
||||
return this->Receive_CLIENT_NEWGRFS_CHECKED(nullptr);
|
||||
}
|
||||
|
||||
return this->SendNewGRFCheck();
|
||||
@@ -1036,7 +1036,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_MAP_OK(Packet *
|
||||
|
||||
this->GetClientName(client_name, lastof(client_name));
|
||||
|
||||
NetworkTextMessage(NETWORK_ACTION_JOIN, CC_DEFAULT, false, client_name, NULL, this->client_id);
|
||||
NetworkTextMessage(NETWORK_ACTION_JOIN, CC_DEFAULT, false, client_name, nullptr, this->client_id);
|
||||
|
||||
/* Mark the client as pre-active, and wait for an ACK
|
||||
* so we know he is done loading and in sync with us */
|
||||
@@ -1093,7 +1093,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(Packet
|
||||
|
||||
NetworkClientInfo *ci = this->GetInfo();
|
||||
|
||||
if (err != NULL) {
|
||||
if (err != nullptr) {
|
||||
IConsolePrintF(CC_ERROR, "WARNING: %s from client %d (IP: %s).", err, ci->client_id, this->GetClientIP());
|
||||
return this->SendError(NETWORK_ERROR_NOT_EXPECTED);
|
||||
}
|
||||
@@ -1159,7 +1159,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_ERROR(Packet *p
|
||||
|
||||
DEBUG(net, 2, "'%s' reported an error and is closing its connection (%s)", client_name, str);
|
||||
|
||||
NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, NULL, strid);
|
||||
NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, nullptr, strid);
|
||||
|
||||
FOR_ALL_CLIENT_SOCKETS(new_cs) {
|
||||
if (new_cs->status > STATUS_AUTHORIZED) {
|
||||
@@ -1171,7 +1171,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_ERROR(Packet *p
|
||||
|
||||
if (errorno == NETWORK_ERROR_DESYNC) {
|
||||
// have the server and all clients run some sanity checks
|
||||
NetworkSendCommand(0, 0, 0, CMD_DESYNC_CHECK, NULL, NULL, _local_company, 0);
|
||||
NetworkSendCommand(0, 0, 0, CMD_DESYNC_CHECK, nullptr, nullptr, _local_company, 0);
|
||||
}
|
||||
|
||||
return this->CloseConnection(NETWORK_RECV_STATUS_CONN_LOST);
|
||||
@@ -1191,7 +1191,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_QUIT(Packet *p)
|
||||
|
||||
this->GetClientName(client_name, lastof(client_name));
|
||||
|
||||
NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, NULL, STR_NETWORK_MESSAGE_CLIENT_LEAVING);
|
||||
NetworkTextMessage(NETWORK_ACTION_LEAVE, CC_DEFAULT, false, client_name, nullptr, STR_NETWORK_MESSAGE_CLIENT_LEAVING);
|
||||
|
||||
FOR_ALL_CLIENT_SOCKETS(new_cs) {
|
||||
if (new_cs->status > STATUS_AUTHORIZED && new_cs != this) {
|
||||
@@ -1271,7 +1271,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
if ((ClientID)dest == CLIENT_ID_SERVER) {
|
||||
ci = NetworkClientInfo::GetByClientID(from_id);
|
||||
/* Display the text locally, and that is it */
|
||||
if (ci != NULL) {
|
||||
if (ci != nullptr) {
|
||||
NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
|
||||
|
||||
if (_settings_client.network.server_admin_chat) {
|
||||
@@ -1293,7 +1293,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
if (from_id == CLIENT_ID_SERVER) {
|
||||
ci = NetworkClientInfo::GetByClientID(from_id);
|
||||
ci_to = NetworkClientInfo::GetByClientID((ClientID)dest);
|
||||
if (ci != NULL && ci_to != NULL) {
|
||||
if (ci != nullptr && ci_to != nullptr) {
|
||||
NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), true, ci_to->client_name, msg, data);
|
||||
}
|
||||
} else {
|
||||
@@ -1310,10 +1310,10 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
/* If this is false, the message is already displayed on the client who sent it. */
|
||||
bool show_local = true;
|
||||
/* Find all clients that belong to this company */
|
||||
ci_to = NULL;
|
||||
ci_to = nullptr;
|
||||
FOR_ALL_CLIENT_SOCKETS(cs) {
|
||||
ci = cs->GetInfo();
|
||||
if (ci != NULL && ci->client_playas == (CompanyID)dest) {
|
||||
if (ci != nullptr && ci->client_playas == (CompanyID)dest) {
|
||||
cs->SendChat(action, from_id, false, msg, data);
|
||||
if (cs->client_id == from_id) show_local = false;
|
||||
ci_to = ci; // Remember a client that is in the company for company-name
|
||||
@@ -1327,17 +1327,17 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
|
||||
ci = NetworkClientInfo::GetByClientID(from_id);
|
||||
ci_own = NetworkClientInfo::GetByClientID(CLIENT_ID_SERVER);
|
||||
if (ci != NULL && ci_own != NULL && ci_own->client_playas == dest) {
|
||||
if (ci != nullptr && ci_own != nullptr && ci_own->client_playas == dest) {
|
||||
NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
|
||||
if (from_id == CLIENT_ID_SERVER) show_local = false;
|
||||
ci_to = ci_own;
|
||||
}
|
||||
|
||||
/* There is no such client */
|
||||
if (ci_to == NULL) break;
|
||||
if (ci_to == nullptr) break;
|
||||
|
||||
/* Display the message locally (so you know you have sent it) */
|
||||
if (ci != NULL && show_local) {
|
||||
if (ci != nullptr && show_local) {
|
||||
if (from_id == CLIENT_ID_SERVER) {
|
||||
char name[NETWORK_NAME_LENGTH];
|
||||
StringID str = Company::IsValidID(ci_to->client_playas) ? STR_COMPANY_NAME : STR_NETWORK_SPECTATORS;
|
||||
@@ -1367,7 +1367,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
NetworkAdminChat(action, desttype, from_id, msg, data, from_admin);
|
||||
|
||||
ci = NetworkClientInfo::GetByClientID(from_id);
|
||||
if (ci != NULL) {
|
||||
if (ci != nullptr) {
|
||||
NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas),
|
||||
(desttype == DESTTYPE_BROADCAST_SS && from_id == CLIENT_ID_SERVER), ci->client_name, msg, data);
|
||||
}
|
||||
@@ -1440,7 +1440,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_SET_NAME(Packet
|
||||
|
||||
if (this->HasClientQuit()) return NETWORK_RECV_STATUS_CONN_LOST;
|
||||
|
||||
if (ci != NULL) {
|
||||
if (ci != nullptr) {
|
||||
/* Display change */
|
||||
if (NetworkFindName(client_name, lastof(client_name))) {
|
||||
NetworkTextMessage(NETWORK_ACTION_NAME_CHANGE, CC_DEFAULT, false, ci->client_name, client_name);
|
||||
@@ -1603,7 +1603,7 @@ void NetworkUpdateClientInfo(ClientID client_id)
|
||||
NetworkClientSocket *cs;
|
||||
NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(client_id);
|
||||
|
||||
if (ci == NULL) return;
|
||||
if (ci == nullptr) return;
|
||||
|
||||
DEBUG(desync, 1, "client: date{%08x; %02x; %02x}; %02x; %04x", _date, _date_fract, _tick_skip_counter, (int)ci->client_playas, client_id);
|
||||
|
||||
@@ -1724,7 +1724,7 @@ bool NetworkFindName(char *new_name, const char *last)
|
||||
}
|
||||
/* Check if it is the same as the server-name */
|
||||
ci = NetworkClientInfo::GetByClientID(CLIENT_ID_SERVER);
|
||||
if (ci != NULL) {
|
||||
if (ci != nullptr) {
|
||||
if (strcmp(ci->client_name, new_name) == 0) found_name = false; // name already in use
|
||||
}
|
||||
|
||||
@@ -1755,7 +1755,7 @@ bool NetworkServerChangeClientName(ClientID client_id, const char *new_name)
|
||||
}
|
||||
|
||||
ci = NetworkClientInfo::GetByClientID(client_id);
|
||||
if (ci == NULL) return false;
|
||||
if (ci == nullptr) return false;
|
||||
|
||||
NetworkTextMessage(NETWORK_ACTION_NAME_CHANGE, CC_DEFAULT, true, ci->client_name, new_name);
|
||||
|
||||
@@ -1790,7 +1790,7 @@ void NetworkServerSetCompanyPassword(CompanyID company_id, const char *password,
|
||||
static void NetworkHandleCommandQueue(NetworkClientSocket *cs)
|
||||
{
|
||||
std::unique_ptr<CommandPacket> cp;
|
||||
while ((cp = cs->outgoing_queue.Pop()) != NULL) {
|
||||
while ((cp = cs->outgoing_queue.Pop()) != nullptr) {
|
||||
cs->SendCommand(cp.get());
|
||||
}
|
||||
}
|
||||
@@ -1975,7 +1975,7 @@ void NetworkServerShowStatusToConsole()
|
||||
NetworkClientSocket *cs;
|
||||
FOR_ALL_CLIENT_SOCKETS(cs) {
|
||||
NetworkClientInfo *ci = cs->GetInfo();
|
||||
if (ci == NULL) continue;
|
||||
if (ci == nullptr) continue;
|
||||
uint lag = NetworkCalculateLag(cs);
|
||||
const char *status;
|
||||
|
||||
@@ -2142,7 +2142,7 @@ void ServerNetworkGameSocketHandler::GetClientName(char *client_name, const char
|
||||
{
|
||||
const NetworkClientInfo *ci = this->GetInfo();
|
||||
|
||||
if (ci == NULL || StrEmpty(ci->client_name)) {
|
||||
if (ci == nullptr || StrEmpty(ci->client_name)) {
|
||||
seprintf(client_name, last, "Client #%4d", this->client_id);
|
||||
} else {
|
||||
strecpy(client_name, ci->client_name, last);
|
||||
@@ -2173,12 +2173,12 @@ void NetworkPrintClients()
|
||||
|
||||
/**
|
||||
* Perform all the server specific administration of a new company.
|
||||
* @param c The newly created company; can't be NULL.
|
||||
* @param ci The client information of the client that made the company; can be NULL.
|
||||
* @param c The newly created company; can't be nullptr.
|
||||
* @param ci The client information of the client that made the company; can be nullptr.
|
||||
*/
|
||||
void NetworkServerNewCompany(const Company *c, NetworkClientInfo *ci)
|
||||
{
|
||||
assert(c != NULL);
|
||||
assert(c != nullptr);
|
||||
|
||||
if (!_network_server) return;
|
||||
|
||||
@@ -2186,18 +2186,18 @@ void NetworkServerNewCompany(const Company *c, NetworkClientInfo *ci)
|
||||
_network_company_states[c->index].password[0] = '\0';
|
||||
NetworkServerUpdateCompanyPassworded(c->index, false);
|
||||
|
||||
if (ci != NULL) {
|
||||
/* ci is NULL when replaying, or for AIs. In neither case there is a client. */
|
||||
if (ci != nullptr) {
|
||||
/* ci is nullptr when replaying, or for AIs. In neither case there is a client. */
|
||||
ci->client_playas = c->index;
|
||||
NetworkUpdateClientInfo(ci->client_id);
|
||||
NetworkSendCommand(0, 0, 0, CMD_RENAME_PRESIDENT, NULL, ci->client_name, c->index, 0);
|
||||
NetworkSendCommand(0, 0, 0, CMD_RENAME_PRESIDENT, nullptr, ci->client_name, c->index, 0);
|
||||
}
|
||||
|
||||
/* Announce new company on network. */
|
||||
NetworkAdminCompanyInfo(c, true);
|
||||
|
||||
if (ci != NULL) {
|
||||
/* ci is NULL when replaying, or for AIs. In neither case there is a client.
|
||||
if (ci != nullptr) {
|
||||
/* ci is nullptr when replaying, or for AIs. In neither case there is a client.
|
||||
We need to send Admin port update here so that they first know about the new company
|
||||
and then learn about a possibly joining client (see FS#6025) */
|
||||
NetworkServerSendChat(NETWORK_ACTION_COMPANY_NEW, DESTTYPE_BROADCAST, 0, "", ci->client_id, c->index + 1);
|
||||
|
Reference in New Issue
Block a user