src/network/network_client.cpp
changeset 11156 cf146f346724
parent 10792 95b6eb9fcc9e
child 11161 7d0fac8f14cd
equal deleted inserted replaced
11155:db49ce10b3b5 11156:cf146f346724
   398 {
   398 {
   399 	NetworkClientInfo *ci;
   399 	NetworkClientInfo *ci;
   400 	uint16 index = p->Recv_uint16();
   400 	uint16 index = p->Recv_uint16();
   401 	PlayerID playas = (Owner)p->Recv_uint8();
   401 	PlayerID playas = (Owner)p->Recv_uint8();
   402 	char name[NETWORK_NAME_LENGTH];
   402 	char name[NETWORK_NAME_LENGTH];
   403 	char unique_id[NETWORK_UNIQUE_ID_LENGTH];
       
   404 
   403 
   405 	p->Recv_string(name, sizeof(name));
   404 	p->Recv_string(name, sizeof(name));
   406 	p->Recv_string(unique_id, sizeof(unique_id));
       
   407 
   405 
   408 	if (MY_CLIENT->has_quit) return NETWORK_RECV_STATUS_CONN_LOST;
   406 	if (MY_CLIENT->has_quit) return NETWORK_RECV_STATUS_CONN_LOST;
   409 
   407 
   410 	/* Do we receive a change of data? Most likely we changed playas */
   408 	/* Do we receive a change of data? Most likely we changed playas */
   411 	if (index == _network_own_client_index) _network_playas = playas;
   409 	if (index == _network_own_client_index) _network_playas = playas;
   433 	if (ci != NULL) {
   431 	if (ci != NULL) {
   434 		ci->client_index = index;
   432 		ci->client_index = index;
   435 		ci->client_playas = playas;
   433 		ci->client_playas = playas;
   436 
   434 
   437 		ttd_strlcpy(ci->client_name, name, sizeof(ci->client_name));
   435 		ttd_strlcpy(ci->client_name, name, sizeof(ci->client_name));
   438 		ttd_strlcpy(ci->unique_id, unique_id, sizeof(ci->unique_id));
       
   439 
   436 
   440 		InvalidateWindow(WC_CLIENT_LIST, 0);
   437 		InvalidateWindow(WC_CLIENT_LIST, 0);
   441 
   438 
   442 		return NETWORK_RECV_STATUS_OKAY;
   439 		return NETWORK_RECV_STATUS_OKAY;
   443 	}
   440 	}