X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=player_remote.c;fp=player_remote.c;h=7256fbd08548feb7cf7b2d39127bd25b071eeccf;hb=3b1909cad505b859b9c6524498b1969cd018af8c;hp=9e46321fc35e5ea6da930c0ab4977b6278050ab0;hpb=71b7175073e0c764c3c5cb0c7ceee0f8cca09e58;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_remote.c b/player_remote.c index 9e46321..7256fbd 100644 --- a/player_remote.c +++ b/player_remote.c @@ -6,6 +6,7 @@ #include "font.h" #include "gui.h" #include "ent_miniworld.h" +#include "ent_region.h" static i32 k_show_own_name = 0; @@ -285,6 +286,20 @@ static void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ){ player->chat_time = vg.time_real; vg_info( "[%d]: %s\n", chat->client, player->chat ); } + else if( tmp->inetmsg_id == k_inetmsg_region ){ + netmsg_region *region = msg->m_pData; + struct network_player *player = &netplayers.list[ region->client ]; + + u32 l = network_msgstring( + region->loc, msg->m_cbSize, sizeof(netmsg_region), + player->region, NETWORK_REGION_MAX ); + player->region_flags = region->flags; + + if( l ) + player->region_flags |= k_ent_region_flag_hasname; + + player->effect_data.spark.colour = region_spark_colour(region->flags); + } } /* @@ -866,10 +881,14 @@ static void remote_players_imgui_lobby(void){ if( !player->isfriend && !in_same_world ) continue; + + const char *location = in_same_world? "": "another world"; + if( player->region_flags & k_ent_region_flag_hasname ){ + location = player->region; + } ui_rect box = { x, y, width, height }; - remote_player_gui_info( box, player->username, - in_same_world? "": "another world", + remote_player_gui_info( box, player->username, location, player->isfriend, in_same_world ); y += height + gap; }