DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnFriendsAsync()

static void OnlineServices::OnFriendsAsync ( BiosFriendInfoArray friend_list,
EBiosError error )
inlinestaticprotected

См. определение в файле OnlineServices.c строка 265

266 {
267 if ( !ErrorCaught( error ) )
268 {
269 m_FriendsAsyncInvoker.Invoke( friend_list );
270
271 array<string> friends_simple = new array<string>;
272 for ( int i = 0; i < friend_list.Count(); ++i )
273 {
274 string uid = friend_list[i].m_Uid;
275 BiosFriendInfo storedBfi = m_FriendsList[uid];
276 BiosFriendInfo newBfi = friend_list[i];
277
278 if (storedBfi)
279 {
280 if ( !BiosFriendInfo.Compare( storedBfi, newBfi ) )
281 {
282 friends_simple.Insert( newBfi.m_Uid );
283 }
284 m_FriendsList.Set( uid, newBfi );
285 }
286 else
287 {
288 m_FriendsList.Insert( uid, newBfi );
289 friends_simple.Insert( newBfi.m_Uid );
290 }
291 }
292
293 if ( !m_FirstFriendsLoad )
294 {
295 if ( ClientData.m_LastNewPlayers && ClientData.m_LastNewPlayers.m_PlayerList.Count() > 0 )
296 {
297 foreach ( SyncPlayer player : ClientData.m_LastNewPlayers.m_PlayerList )
298 {
299 if ( m_FriendsList.Contains( player.m_UID ) )
300 {
301 NotificationSystem.AddNotification( NotificationType.FRIEND_CONNECTED, NotificationSystem.DEFAULT_TIME_DISPLAYED, player.m_PlayerName + " " + "#ps4_invite_has_joined_your_session" );
302 }
303 }
304 ClientData.m_LastNewPlayers.m_PlayerList.Clear();
305 }
306 }
307 m_FirstFriendsLoad = false;
308 }
309 }
NotificationType
DEPRECATED (moved into NotificationSystem)
Определения NotificationSystem.c:4
string m_Uid
The Uid of the friend.
Определения BiosSocialService.c:6
static ref ScriptInvoker m_FriendsAsyncInvoker
Определения OnlineServices.c:3
static ref map< string, ref BiosFriendInfo > m_FriendsList
Определения OnlineServices.c:20
static bool ErrorCaught(EBiosError error)
Определения OnlineServices.c:82
static bool m_FirstFriendsLoad
Определения OnlineServices.c:24
string m_PlayerName
Определения SyncPlayer.c:11
string m_UID
Keeping for backwards compatability with mods.
Определения SyncPlayer.c:8

Перекрестные ссылки NotificationSystem::AddNotification(), BiosFriendInfo::Compare(), NotificationSystem::DEFAULT_TIME_DISPLAYED, ErrorCaught(), m_FirstFriendsLoad, m_FriendsAsyncInvoker, m_FriendsList, ClientData::m_LastNewPlayers, SyncPlayerList::m_PlayerList, SyncPlayer::m_PlayerName, SyncPlayer::m_UID и BiosFriendInfo::m_Uid.

Используется в BiosSocialService::OnFriendsAsync().