Pun-01/Assets/Photon/PhotonChat/Demos/DemoChat/AppSettingsExtensions.cs
2022-07-08 09:14:55 +08:00

30 lines
1.3 KiB
C#

// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Exit Games GmbH"/>
// <summary>Demo code for Photon Chat in Unity.</summary>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using Photon.Realtime;
namespace Photon.Chat.Demo
{
public static class AppSettingsExtensions
{
public static ChatAppSettings GetChatSettings(this AppSettings appSettings)
{
return new ChatAppSettings
{
AppIdChat = appSettings.AppIdChat,
AppVersion = appSettings.AppVersion,
FixedRegion = appSettings.IsBestRegion ? null : appSettings.FixedRegion,
NetworkLogging = appSettings.NetworkLogging,
Protocol = appSettings.Protocol,
EnableProtocolFallback = appSettings.EnableProtocolFallback,
Server = appSettings.IsDefaultNameServer ? null : appSettings.Server,
Port = (ushort)appSettings.Port
};
}
}
}