@@ -1363,38 +1363,38 @@ void NetworkPopulateCompanyInfo()
if (s->facilities & FACIL_TRAIN) npi->num_station[0]++;
if (s->facilities & FACIL_TRUCK_STOP) npi->num_station[1]++;
if (s->facilities & FACIL_BUS_STOP) npi->num_station[2]++;
if (s->facilities & FACIL_AIRPORT) npi->num_station[3]++;
if (s->facilities & FACIL_DOCK) npi->num_station[4]++;
}
ci = NetworkFindClientInfoFromIndex(NETWORK_SERVER_INDEX);
// Register local company (if not dedicated)
if (ci != NULL && IsValidCompanyID(ci->client_playas))
strecpy(_network_company_info[ci->client_playas].clients, ci->client_name, lastof(_network_company_info[0].clients));
strecpy(_network_company_info[ci->client_playas].clients, ci->client_name, lastof(_network_company_info[ci->client_playas].clients));
FOR_ALL_CLIENTS(cs) {
char client_name[NETWORK_CLIENT_NAME_LENGTH];
NetworkGetClientName(client_name, sizeof(client_name), cs);
ci = DEREF_CLIENT_INFO(cs);
if (ci != NULL && IsValidCompanyID(ci->client_playas)) {
if (!StrEmpty(_network_company_info[ci->client_playas].clients)) {
strecat(_network_company_info[ci->client_playas].clients, ", ", lastof(_network_company_info[0].clients));
strecat(_network_company_info[ci->client_playas].clients, ", ", lastof(_network_company_info[ci->client_playas].clients));
strecat(_network_company_info[ci->client_playas].clients, client_name, lastof(_network_company_info[0].clients));
strecat(_network_company_info[ci->client_playas].clients, client_name, lastof(_network_company_info[ci->client_playas].clients));
// Send a packet to all clients with updated info about this client_index
void NetworkUpdateClientInfo(uint16 client_index)
{
NetworkTCPSocketHandler *cs;
NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(client_index);
if (ci == NULL) return;
@@ -145,25 +145,25 @@ static const char *convert_tofrom_fs(ico
* non-const. Correct implementation is at
* http://www.opengroup.org/onlinepubs/007908799/xsh/iconv.html */
#ifdef HAVE_BROKEN_ICONV
char *inbuf = (char*)name;
#else
const char *inbuf = name;
#endif
char *outbuf = buf;
size_t outlen = sizeof(buf) - 1;
size_t inlen = strlen(name);
strecpy(outbuf, name, lastof(buf));
strecpy(outbuf, name, outbuf + outlen);
iconv(convd, NULL, NULL, NULL, NULL);
if (iconv(convd, &inbuf, &inlen, &outbuf, &outlen) == (size_t)(-1)) {
DEBUG(misc, 0, "[iconv] error converting '%s'. Errno %d", name, errno);
*outbuf = '\0';
/* FIX: invalid characters will abort conversion, but they shouldn't occur? */
return buf;
/** Convert from OpenTTD's encoding to that of the local environment
Status change: