Пример #1
0
        //Update Server Config Parameter.
        private static string UpdateServerParam(List <string[]> request, int serverID)
        {
            string paramName, paramValue;

            if (!FindRequestValue(request, "param", out paramName) || !FindRequestValue(request, "paramvalue", out paramValue))
            {
                return("ParameterName or Value not found");
            }
            return(Arma3ServerData.UpdateConfigParam(serverID, paramName, paramValue));
        }
Пример #2
0
        //Get Arma3Server class to JSON string.
        private static string GetServerInfo(List <string[]> request, int serverID)
        {
            Arma3Server server = Arma3ServerUtility.FindArma3ServerByID(serverID);

            if (server == null)
            {
                return("Server with id " + serverID + " not found");
            }

            string result;

            Arma3ServerData.ServerToJSON(server, out result);
            return(result);
        }
Пример #3
0
        //Update Server Config Parameter-State (included).
        private static string UpdateServerParamState(List <string[]> request, int serverID)
        {
            string paramName, paramValue;
            bool   state;

            if (!FindRequestValue(request, "param", out paramName) || !FindRequestValue(request, "paramvalue", out paramValue))
            {
                return("ParameterName or Value not found");
            }

            if (!bool.TryParse(paramValue, out state))
            {
                return("Value was not boolean-type.");
            }

            return(Arma3ServerData.UpdateConfigParamState(serverID, paramName, state));
        }