/// <summary> /// Retrieves info about the opensubtitles.org server. /// </summary> /// <returns>Info about the opensubtitles.org server.</returns> public static ServerInfoOutput ServerInfo( ) { IServer proxy = XmlRpcProxyGen.Create <IServer>( ); XmlRpcStruct ret = proxy.ServerInfo( ); ServerInfoOutput info = new ServerInfoOutput(ret); return(info); }
public static ServerInfoOutput ServerInfo() { ServerInfoOutput result = default(ServerInfoOutput); result.Hostname = Server.hostname; result.MaxPlayers = Server.maxplayers; result.Players = BasePlayer.activePlayerList.Count; result.Queued = SingletonComponent <ServerMgr> .Instance.connectionQueue.Queued; result.Joining = SingletonComponent <ServerMgr> .Instance.connectionQueue.Joining; result.EntityCount = BaseNetworkable.serverEntities.Count; result.GameTime = ((TOD_Sky.Instance != null) ? TOD_Sky.Instance.Cycle.DateTime.ToString() : DateTime.UtcNow.ToString()); result.Uptime = (int)UnityEngine.Time.realtimeSinceStartup; result.Map = Server.level; result.Framerate = Performance.report.frameRate; result.Memory = (int)Performance.report.memoryAllocations; result.Collections = (int)Performance.report.memoryCollections; result.NetworkIn = (int)((Network.Net.sv != null) ? Network.Net.sv.GetStat(null, BaseNetwork.StatTypeLong.BytesReceived_LastSecond) : 0); result.NetworkOut = (int)((Network.Net.sv != null) ? Network.Net.sv.GetStat(null, BaseNetwork.StatTypeLong.BytesSent_LastSecond) : 0); result.Restarting = SingletonComponent <ServerMgr> .Instance.Restarting; result.SaveCreatedTime = SaveRestore.SaveCreatedTime.ToString(); return(result); }