diff options
| author | Stijn Buys <ingar@osirion.org> | 2008-11-08 12:58:05 +0000 | 
|---|---|---|
| committer | Stijn Buys <ingar@osirion.org> | 2008-11-08 12:58:05 +0000 | 
| commit | dbb28ef3422bf2442e15d75fd52180cfb9b40102 (patch) | |
| tree | 16b9f8bb8b5bfa64f9676e4eed134dbe15299c90 /src/core/player.cc | |
| parent | e3512a1b55e97b2eba62847e6e28065eec24c92f (diff) | |
adds rcon, rconpassword and sv_password
Diffstat (limited to 'src/core/player.cc')
| -rw-r--r-- | src/core/player.cc | 24 | 
1 files changed, 21 insertions, 3 deletions
diff --git a/src/core/player.cc b/src/core/player.cc index f5f28bd..865c859 100644 --- a/src/core/player.cc +++ b/src/core/player.cc @@ -32,7 +32,6 @@ void Player::clear()  	player_name.clear();  	player_dirty = false;  	player_zonechange = false; -	player_rcon = false;  	player_mute = false;  	player_mission_target = 0;  	player_view = 0; @@ -103,11 +102,22 @@ void Player::update_info()  		if (is >> color_second)  			player_color_second.assign(color_second);  	} + +	Cvar *passwd = Cvar::find("rconpassword"); +	if (passwd) { +		player_rconpassword.assign(passwd->str()); +	} else { +		player_rconpassword.clear(); +	}  }  void Player::serialize_client_update(std::ostream & os)  { -	os << " " << player_color << " " << player_color_second << " \"" << player_name << "\""; +	os 	<< player_color << " "  +		<< player_color_second << " " +		<< "\"" << player_name << "\" "  +		<< "\"" << player_rconpassword << "\""; +  }  void Player::receive_client_update(std::istream &is) @@ -122,7 +132,15 @@ void Player::receive_client_update(std::istream &is)  		n += c;  	if (n.size()) -		player_name = n;	 +		player_name.assign(n); +	 +	n.clear(); +	while ( (is.get(c)) && (c != '"')); +	while ( (is.get(c)) && (c != '"')) +		n += c; + +	if (n.size()) +		player_rconpassword.assign(n);  }  void Player::serialize_server_update(std::ostream & os) const  | 
