(svn r9771) -Feature: (-tte) Add password protected status to 'players' (network server) console command. (mostly dihedral)
authorpeter1138
Wed, 02 May 2007 19:00:59 +0000
changeset 6566 91db7c3ad8d3
parent 6565 96ef0ede4b83
child 6567 54ccb4a60c88
(svn r9771) -Feature: (-tte) Add password protected status to 'players' (network server) console command. (mostly dihedral)
src/console_cmds.cpp
--- a/src/console_cmds.cpp	Wed May 02 18:29:11 2007 +0000
+++ b/src/console_cmds.cpp	Wed May 02 19:00:59 2007 +0000
@@ -1234,13 +1234,16 @@
 
 		if (!p->is_active) continue;
 
+		const NetworkPlayerInfo *npi = &_network_player_info[p->index];
+
 		GetString(buffer, STR_00D1_DARK_BLUE + _player_colors[p->index], lastof(buffer));
-		IConsolePrintF(8, "#:%d(%s) Company Name: '%s'  Year Founded: %d  Money: %d  Loan: %d  Value: %" OTTD_PRINTF64 "d  (T:%d, R:%d, P:%d, S:%d)",
-			p->index + 1, buffer, _network_player_info[p->index].company_name, p->inaugurated_year, p->player_money, p->current_loan, CalculateCompanyValue(p),
-			/* trains      */ _network_player_info[p->index].num_vehicle[0],
-			/* lorry + bus */ _network_player_info[p->index].num_vehicle[1] + _network_player_info[p->index].num_vehicle[2],
-			/* planes      */ _network_player_info[p->index].num_vehicle[3],
-			/* ships       */ _network_player_info[p->index].num_vehicle[4]);
+		IConsolePrintF(8, "#:%d(%s) Company Name: '%s'  Year Founded: %d  Money: %d  Loan: %d  Value: %" OTTD_PRINTF64 "d  (T:%d, R:%d, P:%d, S:%d) %sprotected",
+			p->index + 1, buffer, npi->company_name, p->inaugurated_year, p->player_money, p->current_loan, CalculateCompanyValue(p),
+			/* trains      */ npi->num_vehicle[0],
+			/* lorry + bus */ npi->num_vehicle[1] + npi->num_vehicle[2],
+			/* planes      */ npi->num_vehicle[3],
+			/* ships       */ npi->num_vehicle[4],
+			/* protected   */ StrEmpty(npi->password) ? "un" : "");
 	}
 
 	return true;