ChatAppSettings.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. public string AppIdChat;
  31. /// <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>
  32. public string AppVersion;
  33. /// <summary>Can be set to any of the Photon Cloud's region names to directly connect to that region.</summary>
  34. public string FixedRegion;
  35. /// <summary>The address (hostname or IP) of the server to connect to.</summary>
  36. public string Server;
  37. /// <summary>If not null, this sets the port of the first Photon server to connect to (that will "forward" the client as needed).</summary>
  38. public ushort Port;
  39. /// <summary>The address (hostname or IP and port) of the proxy server.</summary>
  40. public string ProxyServer;
  41. /// <summary>The network level protocol to use.</summary>
  42. public ConnectionProtocol Protocol = ConnectionProtocol.Udp;
  43. /// <summary>Enables a fallback to another protocol in case a connect to the Name Server fails.</summary>
  44. /// <remarks>See: LoadBalancingClient.EnableProtocolFallback.</remarks>
  45. public bool EnableProtocolFallback = true;
  46. /// <summary>Log level for the network lib.</summary>
  47. public DebugLevel NetworkLogging = DebugLevel.ERROR;
  48. /// <summary>If true, the default nameserver address for the Photon Cloud should be used.</summary>
  49. public bool IsDefaultNameServer { get { return string.IsNullOrEmpty(this.Server); } }
  50. }
  51. }