ChatAppSettings.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // -----------------------------------------------------------------------
  2. // <copyright file="ChatAppSettings.cs" company="Exit Games GmbH">
  3. // Chat API for Photon - Copyright (C) 2018 Exit Games GmbH
  4. // </copyright>
  5. // <summary>Settings for Photon Chat application and the server to connect to.</summary>
  6. // <author>developer@photonengine.com</author>
  7. // ----------------------------------------------------------------------------
  8. #if UNITY_4_7 || UNITY_5 || UNITY_5_3_OR_NEWER
  9. #define SUPPORTED_UNITY
  10. #endif
  11. namespace Photon.Chat
  12. {
  13. using System;
  14. using ExitGames.Client.Photon;
  15. #if SUPPORTED_UNITY
  16. using UnityEngine.Serialization;
  17. #endif
  18. /// <summary>
  19. /// Settings for Photon application(s) and the server to connect to.
  20. /// </summary>
  21. /// <remarks>
  22. /// This is Serializable for Unity, so it can be included in ScriptableObject instances.
  23. /// </remarks>
  24. #if !NETFX_CORE || SUPPORTED_UNITY
  25. [Serializable]
  26. #endif
  27. public class ChatAppSettings
  28. {
  29. /// <summary>AppId for the Chat Api.</summary>
  30. #if SUPPORTED_UNITY
  31. [FormerlySerializedAs("AppId")]
  32. #endif
  33. public string AppIdChat;
  34. /// <summary>The AppVersion can be used to identify builds and will split the AppId distinct "Virtual AppIds" (important for the users to find each other).</summary>
  35. public string AppVersion;
  36. /// <summary>Can be set to any of the Photon Cloud's region names to directly connect to that region.</summary>
  37. public string FixedRegion;
  38. /// <summary>The address (hostname or IP) of the server to connect to.</summary>
  39. public string Server;
  40. /// <summary>If not null, this sets the port of the first Photon server to connect to (that will "forward" the client as needed).</summary>
  41. public ushort Port;
  42. /// <summary>The network level protocol to use.</summary>
  43. public ConnectionProtocol Protocol = ConnectionProtocol.Udp;
  44. /// <summary>Enables a fallback to another protocol in case a connect to the Name Server fails.</summary>
  45. /// <remarks>See: LoadBalancingClient.EnableProtocolFallback.</remarks>
  46. public bool EnableProtocolFallback = true;
  47. /// <summary>Log level for the network lib.</summary>
  48. public DebugLevel NetworkLogging = DebugLevel.ERROR;
  49. /// <summary>If true, the default nameserver address for the Photon Cloud should be used.</summary>
  50. public bool IsDefaultNameServer { get { return string.IsNullOrEmpty(this.Server); } }
  51. /// <summary>Available to not immediately break compatibility.</summary>
  52. [Obsolete("Use AppIdChat instead.")]
  53. public string AppId
  54. {
  55. get { return this.AppIdChat; }
  56. set { this.AppIdChat = value; }
  57. }
  58. }
  59. }