Пример #1
0
        private static void OnSendAvatarStreamsToClientMessageReceived(SendAvatarStreamsToClientMessage message)
        {
            AvatarStreamMessage                avatarStreamMessage = new AvatarStreamMessage();
            LogicArrayList <LogicLong>         ids = message.StreamIds;
            LogicArrayList <AvatarStreamEntry> avatarStreamList = new LogicArrayList <AvatarStreamEntry>(ids.Size());

            for (int i = 0; i < ids.Size(); i++)
            {
                AvatarStreamEntry avatarStreamEntry = StreamManager.GetAvatarStream(ids[i]);

                if (avatarStreamEntry != null)
                {
                    avatarStreamList.Add(avatarStreamEntry);
                }
            }

            avatarStreamMessage.SetStreamEntries(avatarStreamList);
            avatarStreamMessage.Encode();

            ServerMessageManager.SendMessage(StreamMessageManager.CreateForwardLogicMessage(avatarStreamMessage, message.SessionId), ServerManager.GetProxySocket(message.SessionId));

            for (int i = 0; i < avatarStreamList.Size(); i++)
            {
                AvatarStreamEntry avatarStreamEntry = avatarStreamList[i];

                if (avatarStreamEntry.IsNew())
                {
                    avatarStreamEntry.SetNew(false);
                    StreamManager.Save(avatarStreamEntry);
                }
            }
        }
Пример #2
0
        private static void OnAvatarStreamSeenMessageReceived(AvatarStreamSeenMessage message)
        {
            AvatarStreamEntry entry = StreamManager.GetAvatarStream(message.AccountId);

            if (entry != null && entry.IsNew())
            {
                entry.SetNew(false);
                StreamManager.Save(entry);
            }
        }