Seven is the number.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB

4 years ago
  1. // ----------------------------------------------------------------------------
  2. // <copyright file="FriendInfo.cs" company="Exit Games GmbH">
  3. // Loadbalancing Framework for Photon - Copyright (C) 2018 Exit Games GmbH
  4. // </copyright>
  5. // <summary>
  6. // Collection of values related to a user / friend.
  7. // </summary>
  8. // <author>developer@photonengine.com</author>
  9. // ----------------------------------------------------------------------------
  10. #if UNITY_4_7 || UNITY_5 || UNITY_5_3_OR_NEWER
  11. #define SUPPORTED_UNITY
  12. #endif
  13. namespace Photon.Realtime
  14. {
  15. using ExitGames.Client.Photon;
  16. #if SUPPORTED_UNITY || NETFX_CORE
  17. using Hashtable = ExitGames.Client.Photon.Hashtable;
  18. using SupportClass = ExitGames.Client.Photon.SupportClass;
  19. #endif
  20. /// <summary>
  21. /// Used to store info about a friend's online state and in which room he/she is.
  22. /// </summary>
  23. public class FriendInfo
  24. {
  25. [System.Obsolete("Use UserId.")]
  26. public string Name { get { return this.UserId; } }
  27. public string UserId { get; internal protected set; }
  28. public bool IsOnline { get; internal protected set; }
  29. public string Room { get; internal protected set; }
  30. public bool IsInRoom
  31. {
  32. get { return this.IsOnline && !string.IsNullOrEmpty(this.Room); }
  33. }
  34. public override string ToString()
  35. {
  36. return string.Format("{0}\t is: {1}", this.UserId, (!this.IsOnline) ? "offline" : this.IsInRoom ? "playing" : "on master");
  37. }
  38. }
  39. }