CodeSmile AssetDatabase 1.9
Unity's AssetDatabase in enjoyable, consistent, concise, convenient, comprehensible, safe, documented form.
Loading...
Searching...
No Matches
Asset.Database.CacheServer.cs
1// Copyright (C) 2021-2023 Steffen Itterheim
2// Refer to included LICENSE file for terms and conditions.
3
4using System;
5using System.Diagnostics.CodeAnalysis;
6using UnityEditor;
7
8namespace CodeSmileEditor
9{
10 public sealed partial class Asset
11 {
12 public static partial class Database
13 {
17 public static class CacheServer
18 {
26 public static Boolean Enabled => AssetDatabase.IsCacheServerEnabled();
27
35 public static Boolean Connected => AssetDatabase.IsConnectedToCacheServer();
36
47 public static String ConnectedAddress => AssetDatabase.GetCurrentCacheServerIp();
48
59 public static String Address => AssetDatabase.GetCacheServerAddress();
60
71 public static UInt16 Port => AssetDatabase.GetCacheServerPort();
72
80 public static String NamespacePrefix => AssetDatabase.GetCacheServerNamespacePrefix();
81
89 public static Boolean UploadsAllowed => AssetDatabase.GetCacheServerEnableUpload();
90
98 public static Boolean DownloadsAllowed => AssetDatabase.GetCacheServerEnableDownload();
99
107 [ExcludeFromCodeCoverage] // not testable
108 public static void ApplySettings() => AssetDatabase.RefreshSettings();
109
121 [ExcludeFromCodeCoverage] // not testable, requires external service
122 public static Boolean CanConnect([NotNull] String ipAddress, UInt16 port) =>
123 AssetDatabase.CanConnectToCacheServer(ipAddress, port);
124
133 [ExcludeFromCodeCoverage] // not testable
134 public static void ResetReconnectTimer() => AssetDatabase.ResetCacheServerReconnectTimer();
135
143 [ExcludeFromCodeCoverage] // not testable, requires external service
144 public static void Disconnect() => AssetDatabase.CloseCacheServerConnection();
145 }
146 }
147 }
148}
static void Disconnect()
Disconnects any active cache server (Accelerator) connection.
static String NamespacePrefix
Returns the cache server (Accelerator) namespace prefix from Project Settings.
static Boolean Enabled
Returns true if cache server (Accelerator) is enabled in Project Settings / Preferences.
static Boolean Connected
Returns true if the editor is connected to a cache server (Accelerator).
static Boolean DownloadsAllowed
Returns whether the cache server (Accelerator) is allowed to download files.
static Boolean CanConnect([NotNull] String ipAddress, UInt16 port)
Tests if the cache server (Accelerator) connection can be established with the given IP address and p...
static String Address
Returns the cache server (Accelerator) IP address from Project Settings.
static void ResetReconnectTimer()
Resets the internal reconnect timer which subsequently increases to up to 5 minutes if connection att...
static String ConnectedAddress
Returns the cache server (Accelerator) IP address the editor is currently connected to.
static void ApplySettings()
Applies modified cache server (Accelerator) settings so that they take effect immediately.
static UInt16 Port
Returns the cache server (Accelerator) port number from Project Settings.
static Boolean UploadsAllowed
Returns whether the cache server (Accelerator) is allowed to upload files.
Groups CacheServer (Accelerator) related functionality.
Groups all asset database functionality.