src/network/network_server.cpp
changeset 7060 4b811c8460cf
parent 6952 b19643469024
child 7140 31e79bb57c5b
equal deleted inserted replaced
7059:c6d12e3de0dc 7060:4b811c8460cf
  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++) {