AppSettingsExtensions.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <copyright company="Exit Games GmbH"/>
  3. // <summary>Demo code for Photon Chat in Unity.</summary>
  4. // <author>developer@exitgames.com</author>
  5. // --------------------------------------------------------------------------------------------------------------------
  6. using Photon.Realtime;
  7. namespace Photon.Chat.Demo
  8. {
  9. public static class AppSettingsExtensions
  10. {
  11. public static ChatAppSettings GetChatSettings(this AppSettings appSettings)
  12. {
  13. return new ChatAppSettings
  14. {
  15. AppIdChat = appSettings.AppIdChat,
  16. AppVersion = appSettings.AppVersion,
  17. FixedRegion = appSettings.IsBestRegion ? null : appSettings.FixedRegion,
  18. NetworkLogging = appSettings.NetworkLogging,
  19. Protocol = appSettings.Protocol,
  20. EnableProtocolFallback = appSettings.EnableProtocolFallback,
  21. Server = appSettings.IsDefaultNameServer ? null : appSettings.Server,
  22. Port = (ushort)appSettings.Port,
  23. ProxyServer = appSettings.ProxyServer
  24. // values not copied from AppSettings class: AuthMode
  25. // values not needed from AppSettings class: EnableLobbyStatistics
  26. };
  27. }
  28. }
  29. }