src/network/network_server.cpp
branchnoai
changeset 9629 66dde6412125
parent 9628 b5c2449616b5
child 9631 8a2d1c2ceb88
equal deleted inserted replaced
9628:b5c2449616b5 9629:66dde6412125
  1088 
  1088 
  1089 		// Display the message locally (so you know you have sent it)
  1089 		// Display the message locally (so you know you have sent it)
  1090 		if (ci != NULL && show_local) {
  1090 		if (ci != NULL && show_local) {
  1091 			if (from_index == NETWORK_SERVER_INDEX) {
  1091 			if (from_index == NETWORK_SERVER_INDEX) {
  1092 				char name[NETWORK_NAME_LENGTH];
  1092 				char name[NETWORK_NAME_LENGTH];
  1093 				StringID str = IsValidPlayer(ci_to->client_playas) ? GetPlayer(ci_to->client_playas)->name_1 : (uint16)STR_NETWORK_SPECTATORS;
  1093 				StringID str = IsValidPlayer(ci_to->client_playas) ? STR_COMPANY_NAME : STR_NETWORK_SPECTATORS;
       
  1094 				SetDParam(0, ci_to->client_playas);
  1094 				GetString(name, str, lastof(name));
  1095 				GetString(name, str, lastof(name));
  1095 				NetworkTextMessage(action, GetDrawStringPlayerColor(ci_own->client_playas), true, name, "%s", msg);
  1096 				NetworkTextMessage(action, GetDrawStringPlayerColor(ci_own->client_playas), true, name, "%s", msg);
  1096 			} else {
  1097 			} else {
  1097 				FOR_ALL_CLIENTS(cs) {
  1098 				FOR_ALL_CLIENTS(cs) {
  1098 					if (cs->index == from_index) {
  1099 					if (cs->index == from_index) {
  1257 		memset(&_network_player_info[p->index], 0, sizeof(NetworkPlayerInfo));
  1258 		memset(&_network_player_info[p->index], 0, sizeof(NetworkPlayerInfo));
  1258 		_network_player_info[p->index].months_empty = months_empty;
  1259 		_network_player_info[p->index].months_empty = months_empty;
  1259 		ttd_strlcpy(_network_player_info[p->index].password, password, sizeof(_network_player_info[p->index].password));
  1260 		ttd_strlcpy(_network_player_info[p->index].password, password, sizeof(_network_player_info[p->index].password));
  1260 
  1261 
  1261 		// Grap the company name
  1262 		// Grap the company name
  1262 		SetDParam(0, p->name_1);
  1263 		SetDParam(0, p->index);
  1263 		SetDParam(1, p->name_2);
  1264 		GetString(_network_player_info[p->index].company_name, STR_COMPANY_NAME, lastof(_network_player_info[p->index].company_name));
  1264 		GetString(_network_player_info[p->index].company_name, STR_JUST_STRING, lastof(_network_player_info[p->index].company_name));
       
  1265 
  1265 
  1266 		// Check the income
  1266 		// Check the income
  1267 		if (_cur_year - 1 == p->inaugurated_year) {
  1267 		if (_cur_year - 1 == p->inaugurated_year) {
  1268 			// The player is here just 1 year, so display [2], else display[1]
  1268 			// The player is here just 1 year, so display [2], else display[1]
  1269 			for (i = 0; i < lengthof(p->yearly_expenses[2]); i++) {
  1269 			for (i = 0; i < lengthof(p->yearly_expenses[2]); i++) {
  1276 		}
  1276 		}
  1277 
  1277 
  1278 		// Set some general stuff
  1278 		// Set some general stuff
  1279 		_network_player_info[p->index].inaugurated_year = p->inaugurated_year;
  1279 		_network_player_info[p->index].inaugurated_year = p->inaugurated_year;
  1280 		_network_player_info[p->index].company_value = p->old_economy[0].company_value;
  1280 		_network_player_info[p->index].company_value = p->old_economy[0].company_value;
  1281 		_network_player_info[p->index].money = p->money64;
  1281 		_network_player_info[p->index].money = p->player_money;
  1282 		_network_player_info[p->index].performance = p->old_economy[0].performance_history;
  1282 		_network_player_info[p->index].performance = p->old_economy[0].performance_history;
  1283 	}
  1283 	}
  1284 
  1284 
  1285 	// Go through all vehicles and count the type of vehicles
  1285 	// Go through all vehicles and count the type of vehicles
  1286 	FOR_ALL_VEHICLES(v) {
  1286 	FOR_ALL_VEHICLES(v) {