public void OnBubbleMessageReceived(Session session, Message message) { if(SessionBubbleDictionary.ContainsKey(session)) { RemoteBubble bubble = SessionBubbleDictionary[session]; } }
public void OnBubbleDisconnected(Session session) { if(SessionBubbleDictionary.ContainsKey(session)) { RemoteBubble bubble = SessionBubbleDictionary[session]; RemoveBubble(bubble); } }
public void OnBubbleConnected(Session session, Message message) { AttachRequestMessage attachRequestMessage = (AttachRequestMessage)message; RemoteBubble bubble = new RemoteBubble( attachRequestMessage.SourceBubbleFragment.BubbleId, attachRequestMessage.SourceBubbleFragment.BubbleName, attachRequestMessage.SourceBubbleFragment.BubbleAssetCacheUrl, attachRequestMessage.SourceBubbleFragment.OwnerId, attachRequestMessage.SourceBubbleFragment.BubbleAddress, attachRequestMessage.SourceBubbleFragment.BubblePort, attachRequestMessage.SourceBubbleFragment.BubbleCenter.X, attachRequestMessage.SourceBubbleFragment.BubbleCenter.Y, attachRequestMessage.SourceBubbleFragment.BubbleCenter.Z, attachRequestMessage.SourceBubbleFragment.BubbleRange, attachRequestMessage.SourceBubbleFragment.BubblePerceptionRange, attachRequestMessage.SourceBubbleFragment.BubbleRealTime, session); AddBubble(bubble); }
public void RemoveBubble(RemoteBubble bubble) { SessionBubbleDictionary.Remove(bubble.Session); IdBubbleDictionary.Remove(bubble.BubbleId); Bubbles.Remove(bubble); }
public void AddBubble(RemoteBubble bubble) { SessionBubbleDictionary.Add(bubble.Session,bubble); IdBubbleDictionary.Add(bubble.BubbleId, bubble); Bubbles.Add(bubble); }