Exemplo n.º 1
0
        public async Task <Process> Start()
        {
            string configPath = Functions.ServerPath.GetServerFiles(_serverData.ServerID, @"cstrike\server.cfg");

            if (!File.Exists(configPath))
            {
                Notice = $"server.cfg not found ({configPath})";
            }

            string param = "-console -game cstrike";

            param += String.Format("{0}", String.IsNullOrEmpty(_serverData.ServerIP) ? "" : $" -ip {_serverData.ServerIP}");
            param += String.Format("{0}", String.IsNullOrEmpty(_serverData.ServerPort) ? "" : $" -port {_serverData.ServerPort}");
            param += String.Format("{0}", String.IsNullOrEmpty(_serverData.ServerMaxPlayer) ? "" : $" -maxplayers {_serverData.ServerMaxPlayer}");
            param += String.Format("{0}", String.IsNullOrEmpty(_serverData.ServerGSLT) ? "" : $" +sv_setsteamaccount {_serverData.ServerGSLT}");
            param += String.Format("{0}", String.IsNullOrEmpty(_serverData.ServerParam) ? "" : $" {_serverData.ServerParam}");
            param += String.Format("{0}", String.IsNullOrEmpty(_serverData.ServerMap) ? "" : $" +map {_serverData.ServerMap}");

            Type.HLDS hlds = new Type.HLDS(_serverData.ServerID);
            Process   p    = await hlds.Start(param);

            Error = hlds.Error;

            return(p);
        }
Exemplo n.º 2
0
        public async Task <bool> Update()
        {
            Type.HLDS hlds    = new Type.HLDS(_serverData.ServerID);
            bool      success = await hlds.Update("", "90");

            Error = hlds.Error;

            return(success);
        }
Exemplo n.º 3
0
        public async Task <Process> Install()
        {
            Type.HLDS hlds = new Type.HLDS(_serverData.ServerID);
            Process   p    = await hlds.Install("", "90");

            Error = hlds.Error;

            return(p);
        }