示例#1
0
 public void OnBubbleMessageReceived(Session session, Message message)
 {
     if(SessionBubbleDictionary.ContainsKey(session))
     {
         RemoteBubble bubble = SessionBubbleDictionary[session];
     }
 }
示例#2
0
 public void OnBubbleDisconnected(Session session)
 {
     if(SessionBubbleDictionary.ContainsKey(session))
     {
         RemoteBubble bubble = SessionBubbleDictionary[session];
         RemoveBubble(bubble);
     }
 }
示例#3
0
 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);
 }
示例#4
0
 public void RemoveBubble(RemoteBubble bubble)
 {
     SessionBubbleDictionary.Remove(bubble.Session);
     IdBubbleDictionary.Remove(bubble.BubbleId);
     Bubbles.Remove(bubble);
 }
示例#5
0
 public void AddBubble(RemoteBubble bubble)
 {
     SessionBubbleDictionary.Add(bubble.Session,bubble);
     IdBubbleDictionary.Add(bubble.BubbleId, bubble);
     Bubbles.Add(bubble);
 }