Bläddra i källkod

added Gamespy2 protocol support, fixed steam server timeout by adding fork of SteamQueryNet, minor fixes

Veloe 2 år sedan
förälder
incheckning
551cc9a25a

+ 2 - 1
.gitignore

@@ -360,4 +360,5 @@ MigrationBackup/
 .ionide/
 
 # Fody - auto-generated XML schema
-FodyWeavers.xsd
+FodyWeavers.xsd
+/VeloeMonitorDataCollector/config.ini

+ 84 - 20
VeloeMonitorDataCollector/DataCollector.cs

@@ -45,7 +45,7 @@ namespace VeloeMonitorDataCollector
             if (!File.Exists("config.ini"))
             {
                 File.WriteAllText("config.ini",
-                    "#hardware = true\n\n#[MySQL]\n#Ip = 127.0.0.1\n#Port = 8806\n#Username = User\n#Password = Password\n#Scheme = values\n\n#[WebSoket]\n#url = http://192.168.1.2:5000\n\n#[MinecraftServer]\n#Ip = 127.0.0.1\n#Port = 25565\n#Type = Minecraft\n#updateInterval = 30\n\n#[SteamAPIServer]\n#Ip = 127.0.0.1\n#Port = 27015\n#Type = Steam\n#updateInterval = 30\n\n#[Gamespy3Server]\n#Ip = 127.0.0.1\n#Port = 5446\n#Type = Gamespy3\n#updateInterval = 30");
+                    "#[Hardware]\n#hardware = true\n#hardwareUpdateInterval = true\n\n#[MySQL]\n#server = 127.0.0.1\n#port = 8806\n#uid = User\n#pwd = Password\n#database = values\n\n#[WebSoket]\n#url = http://192.168.1.2:5000\n\n#[MinecraftServer]\n#Ip = 127.0.0.1\n#Port = 25565\n#Type = Minecraft\n#updateInterval = 30\n\n#[SteamAPIServer]\n#Ip = 127.0.0.1\n#Port = 27015\n#Type = Steam\n#updateInterval = 30\n\n#[Gamespy3Server]\n#Ip = 127.0.0.1\n#Port = 5446\n#Type = Gamespy3\n#updateInterval = 30\n\n#[Gamespy2Server]\n#Ip = 127.0.0.1\n#Port = 10480\n#Type = Gamespy2\n#updateInterval = 30");
                 throw new FileNotFoundException("config.ini does not exist! Default config was created as an example.");
             }
 
@@ -57,7 +57,7 @@ namespace VeloeMonitorDataCollector
 
             var hardware = data.GetSection("Hardware");
 
-            //ini data validation
+            //ini hardvare section validation
             
             if (hardware["hardware"] != "true" && hardware["hardware"] != "false" || hardware["hardware"] is null) 
             {
@@ -192,10 +192,11 @@ namespace VeloeMonitorDataCollector
                     while (!_token.IsCancellationRequested)
                     {
                         //Console.WriteLine(_token.IsCancellationRequested);
+                        var data = UpdateHardware();
                         if (_sendToDb != null)
                             foreach (var dbController in _sendToDb)
                             {
-                                dbController.SendHardware(UpdateHardware());
+                                dbController.SendHardware(data);
                             }
                         
                         await Task.Delay(TimeSpan.FromSeconds(updateIntervalHardware));
@@ -326,8 +327,8 @@ namespace VeloeMonitorDataCollector
                         while (!_token.IsCancellationRequested)
                         {
                             await Task.Delay(TimeSpan.FromSeconds(interval));
-                            var data = UpdateMinecraft(ip, port);
-                            //_logger.Debug("Updating {0}", name);
+                            McStatus? data = null;      
+                            data = UpdateMinecraft(ip, port);
                             
                             if (data is null)
                                 continue;
@@ -351,7 +352,9 @@ namespace VeloeMonitorDataCollector
                         while (!_token.IsCancellationRequested)
                         {
                             await Task.Delay(TimeSpan.FromSeconds(interval));
-                            var data = UpdateSteam(ip, port);
+                            SteamData? data = null;
+
+                            data = await UpdateSteam(ip, port, interval);
 
                             if (data is null)
                                 continue;
@@ -395,18 +398,25 @@ namespace VeloeMonitorDataCollector
                             */
                             while (!_token.IsCancellationRequested)
                             {
-                                await Task.Delay(TimeSpan.FromSeconds(interval));
-                                var data = server.GetStatus();
+                                try
+                                {
+                                    await Task.Delay(TimeSpan.FromSeconds(interval));
+                                    var data = server.GetStatus();
 
-                                if (data is null)
-                                    continue;
+                                    if (data is null)
+                                        continue;
 
-                                if (_sendToDb is null)
-                                    continue;
+                                    if (_sendToDb is null)
+                                        continue;
 
-                                foreach (var dbController in _sendToDb)
+                                    foreach (var dbController in _sendToDb)
+                                    {
+                                        dbController.SendGamespy3(data, name);
+                                    }
+                                }
+                                catch (System.Net.Sockets.SocketException ex)
                                 {
-                                    dbController.SendGamespy3(data, name);
+                                    _logger.Debug(ex.Message);
                                 }
                             }
                         }
@@ -416,6 +426,45 @@ namespace VeloeMonitorDataCollector
                         }
                     }, _token));
 
+                    break;
+
+                case "Gamespy2":
+
+                    _updaterTasks.Add(name, new Task(async () => {
+                        try
+                        {
+                            Gs2Status server = new Gs2Status(ip, port);
+
+                            while (!_token.IsCancellationRequested)
+                            {
+                                try
+                                {
+                                    await Task.Delay(TimeSpan.FromSeconds(interval));
+                                    var data = server.GetStatus();
+
+                                    if (data is null)
+                                        continue;
+
+                                    if (_sendToDb is null)
+                                        continue;
+
+                                    foreach (var dbController in _sendToDb)
+                                    {
+                                        dbController.SendGamespy2(data, name);
+                                    }
+                                }
+                                catch (System.Net.Sockets.SocketException ex)
+                                {
+                                    _logger.Debug(ex.Message);
+                                }
+                            }
+                        }
+                        catch (System.Net.Sockets.SocketException ex)
+                        {
+                            _logger.Debug(ex.Message);
+                        }
+                    }, _token));
+
                     break;
             }
         }
@@ -437,23 +486,38 @@ namespace VeloeMonitorDataCollector
             return null;
         }
 
-        private SteamData? UpdateSteam(string ip, int port)
+        private async Task<SteamData?> UpdateSteam(string ip, int port, int interval)
         {   
-            IServerQuery serverQuery = new ServerQuery(ip, (ushort)port);
+            ServerQuery serverQuery = new ServerQuery();
             try
             {
-                SteamData output = new SteamData
+                serverQuery.SendTimeout = 2000;
+                serverQuery.ReceiveTimeout = 2000;
+
+                SteamData? output = null;
+                serverQuery.Connect(ip, (ushort)port);
+
+                var serverInfo = await serverQuery.GetServerInfoAsync();
+                var serverPlayers = await serverQuery.GetPlayersAsync();
+
+                output = new SteamData
                 {
-                    ServerInfo = serverQuery.GetServerInfo(),
+                    ServerInfo = serverInfo,
 
-                    Players = serverQuery.GetPlayers()
+                    Players = serverPlayers
                 };
+                
 
-                if (output.ServerInfo is null)
+                if (output is null)
                     return null;
                 
                 return output;
             }
+            catch (TimeoutException ex)
+            {
+                _logger.Debug($"{{0}}:{{1}} {ex.Message}", ip, port); 
+                return null;
+            }
             catch (Exception ex)
             {
                 _logger.Debug(ex.Message);

+ 154 - 0
VeloeMonitorDataCollector/DatabaseConnectors/MySqlConnector.cs

@@ -166,6 +166,10 @@ namespace VeloeMonitorDataCollector.DatabaseConnectors
                     _logger.Warning("Table {0} can't be checked before game server quering service init because server uses {1} protocol. Table will be checked after first success connection to the server.", name, "Gamespy3");
                     return true;
 
+                case "Gamespy2":
+                    _logger.Warning("Table {0} can't be checked before game server quering service init because server uses {1} protocol. Table will be checked after first success connection to the server.", name, "Gamespy2");
+                    return true;
+
                 default:
                     throw new ArgumentException(type);
             }
@@ -330,6 +334,10 @@ namespace VeloeMonitorDataCollector.DatabaseConnectors
                     throw new NotImplementedException("Gamespy3");
                     return;
 
+                case "Gamespy2":
+                    throw new NotImplementedException("Gamespy3");
+                    return;
+
                 default:    
                     throw new ArgumentException(type);
             }
@@ -567,6 +575,152 @@ namespace VeloeMonitorDataCollector.DatabaseConnectors
             _logger.Information("Table {0} created in {1} for {2} (MySQL)", name ,_connection.Database, _connection.DataSource);
         }
 
+        public void SendGamespy2(in Gs2Status.Status data, in string name)
+        {
+            if (_gamespyTableCheck.GetValueOrDefault(name, null) is null)
+            {
+                _gamespyTableCheck[name] = CheckGamespy2(data, name);
+            }
+
+            if (_gamespyTableCheck[name] is false)
+                return;
+
+            MySqlCommand command;
+
+            StringBuilder queryBuilder = new StringBuilder();
+            queryBuilder.Append($"INSERT INTO {name} (date");
+
+            foreach (var parameter in data.Info)
+            {
+                if (parameter.Value != String.Empty && parameter.Value is not null)
+                {
+                    queryBuilder.Append(", ");
+                    queryBuilder.Append(parameter.Key);
+                }
+            }
+
+            queryBuilder.Append(", playerslist) VALUES  ( @date ");
+
+            foreach (var parameter in data.Info)
+            {
+                if (parameter.Value != String.Empty && parameter.Value is not null)
+                {
+                    queryBuilder.Append(", @");
+                    queryBuilder.Append(parameter.Key);
+
+                    //_logger.Debug("'{0}' = '{1}'", parameter.Key, parameter.Value);
+                }
+            }
+
+            queryBuilder.Append(", @playerslist )");
+
+            command = new MySqlCommand(queryBuilder.ToString(), _connection);
+
+            command.Parameters.Clear();
+            command.Parameters.Add("date", MySqlDbType.UInt64).Value = DateTimeOffset.Now.ToUnixTimeSeconds();
+
+            foreach (var parameter in data.Info)
+            {
+                if (parameter.Value != String.Empty && parameter.Value is not null)
+
+                    command.Parameters.Add(parameter.Key, MySqlDbType.VarString).Value = parameter.Value;
+            }
+
+            command.Parameters.Add("playerslist", MySqlDbType.VarString).Value = JsonSerializer.Serialize(data.Players);
+            command.ExecuteNonQueryAsync();
+        }
+
+        private bool CheckGamespy2(Gs2Status.Status input, string name)
+        {
+            var command = new MySqlCommand($"SHOW COLUMNS FROM {name};", _connection);
+
+            try
+            {
+                bool valid = true;
+                using var result = command.ExecuteReaderAsync().Result;
+                _logger.Information("Checking table {0} ({1}) in {2} for {3} (MySQL)", name, "Gamespy2", _connection.Database, _connection.DataSource);
+                if (result.Read() is false)
+                {
+                    CreateTableGamespy2(input, name);
+                    return true;
+                }
+
+                int colsCount = 1;
+
+                foreach (var parameter in input.Info)
+                    if (parameter.Value is not null && parameter.Value != String.Empty)
+                        colsCount++;
+
+                if (result.GetString(0) is not "date" && result.GetString(1) is not "bigint")
+                {
+                    _logger.Error("Error at column {0}. Correct is {1} {2}", 0, "date", "bigint");
+                    valid = false;
+                }
+
+                int i = 1;
+                foreach (var parameter in input.Info)
+                {
+                    if (result.Read() is false)
+                    {
+                        _logger.Error("End of table on column {0}/{1}", i, colsCount);
+                        return false;
+                    }
+
+                    if (result.GetString(0) != parameter.Key || result.GetString(1) != "varchar(127)")
+                    {
+                        _logger.Error("Error at colunm {0}. Correct is {1} {2}", i, parameter.Key, "varchar(127)");
+                        valid = false;
+                    }
+                    i++;
+                }
+
+                if (result.Read() is false)
+                {
+                    _logger.Error("End of table on column {0}/{0}", colsCount);
+                    return false;
+                }
+
+                if (result.GetString(0) != "playerslist" || result.GetString(1) != "varchar(255)")
+                {
+                    _logger.Error("Error at colunm {0}. Correct is {1} {2}", i, "playerslist", "varchar(255)");
+                    valid = false;
+                }
+
+
+                if (valid) _logger.Information("Ok");
+                //else _logger.Warning("Table {0} isn't receiving any updates to {1} (MySQL)", name, _connection.DataSource);
+                return valid;
+            }
+            catch (AggregateException e)
+            {
+                if (e.InnerException is MySqlException)
+                {                   
+                    if (((MySqlException)e.InnerException).Number == 1146)
+                    {
+                        CreateTableGamespy2(input, name);
+                        return true;
+                    }                 
+                }
+                throw;
+            }
+        }
+
+        private void CreateTableGamespy2(Gs2Status.Status input, string name)
+        {
+            StringBuilder columns = new StringBuilder();
+            foreach (var parameter in input.Info)
+            {
+                if (parameter.Value != String.Empty && parameter.Value is not null)
+                    columns.Append($",{parameter.Key} VARCHAR(127) ");
+            }
+            MySqlCommand command = new MySqlCommand(
+                $"CREATE TABLE {name} (date BIGINT NOT NULL {columns}, playerslist VARCHAR(255) ,PRIMARY KEY (date))", _connection);
+
+            command.ExecuteNonQuery();
+
+            _logger.Information("Table {0} created in {1} for {2} (MySQL)", name, _connection.Database, _connection.DataSource);
+        }
+
         private void CreateDatabase(string name)
         {
             MySqlCommand command = new MySqlCommand($"CREATE DATABASE {name}", _connection);

+ 11 - 1
VeloeMonitorDataCollector/DatabaseConnectors/SignalRConnector.cs

@@ -57,6 +57,11 @@ namespace VeloeMonitorDataCollector.DatabaseConnectors
             app.Services.GetService<DataSender>().SendGamespy3(data, name);
         }
 
+        public void SendGamespy2(in Gs2Status.Status data, in string name)
+        {
+            app.Services.GetService<DataSender>().SendGamespy2(data, name);
+        }
+
         public void SendHardware(in Dictionary<string, float> data)
         {
             app.Services.GetService<DataSender>().SendHardware(data);
@@ -64,7 +69,7 @@ namespace VeloeMonitorDataCollector.DatabaseConnectors
 
         public void SendMinecraft(in McStatus data, in string name)
         {
-            app.Services.GetService<DataSender>().SendMinecraft(data, name);
+              app.Services.GetService<DataSender>().SendMinecraft(data, name);
         }
 
         public void SendSteam(in SteamData data, in string name)
@@ -88,6 +93,11 @@ namespace VeloeMonitorDataCollector.DatabaseConnectors
             _hubContext.Clients.Groups(name).SendAsync($"Update{name}",JsonSerializer.Serialize(data));
         }
 
+        public void SendGamespy2(in Gs2Status.Status data, in string name)
+        {
+            _hubContext.Clients.Groups(name).SendAsync($"Update{name}", JsonSerializer.Serialize(data));
+        }
+
         public void SendHardware(in Dictionary<string, float> data)
         {
             _hubContext.Clients.Groups("hardware").SendAsync($"Update", JsonSerializer.Serialize(data));

+ 250 - 0
VeloeMonitorDataCollector/Dependencies/Gs2Status.cs

@@ -0,0 +1,250 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Net.Sockets;
+using System.Net;
+
+//https://github.com/opengsq/opengsq-dotnet/blob/main/OpenGSQ/Protocols/GameSpy2.cs
+//https://github.com/opengsq/opengsq-dotnet/blob/main/OpenGSQ/ProtocolBase.cs
+
+/*
+MIT License
+
+Copyright (c) 2021 OpenGSQ
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. 
+ 
+ */
+
+namespace VeloeMonitorDataCollector.Dependencies
+{
+    /// <summary>
+    /// Gamespy Query Protocol version 2
+    /// </summary>
+    public class Gs2Status
+    {
+
+        /// <summary>
+        /// Represents a network endpoint as an IP address and a port number.
+        /// </summary>
+        protected IPEndPoint _EndPoint;
+
+        /// <summary>
+        /// Timeout in millisecond
+        /// </summary>
+        protected int _Timeout;
+
+        /// <summary>
+        /// Cached challenge bytes
+        /// </summary>
+        protected byte[] _Challenge = new byte[0];
+
+        /// <summary>
+        /// ProtocolBase
+        /// </summary>
+        /// <param name="address"></param>
+        /// <param name="port"></param>
+        /// <param name="timeout"></param>
+        public Gs2Status(string address, int port, int timeout = 5000)
+        {
+            if (IPAddress.TryParse(address, out var ipAddress))
+            {
+                _EndPoint = new IPEndPoint(ipAddress, port);
+            }
+            else
+            {
+                _EndPoint = new IPEndPoint(Dns.GetHostAddresses(address)[0], port);
+            }
+
+            _Timeout = timeout;
+        }
+        /// <summary>
+        /// Gamespy Query Protocol version 2
+        /// </summary>
+        /// <param name="address"></param>
+        /// <param name="port"></param>
+        /// <param name="timeout"></param>
+
+        /// <summary>
+        /// Retrieves information about the server including, Info, Players, and Teams.
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        /// <exception cref="SocketException"></exception>
+        public Status GetStatus(Request request = Request.Info | Request.Players | Request.Teams)
+        {
+            using (var udpClient = new UdpClient())
+            {
+                var responseData = ConnectAndSend(udpClient, request);
+
+                using (var br = new BinaryReader(new MemoryStream(responseData), Encoding.UTF8))
+                {
+                    var status = new Status();
+
+                    // Save Response Info
+                    if (request.HasFlag(Request.Info))
+                    {
+                        status.Info = GetInfo(br);
+                    }
+
+                    // Save Response Players
+                    if (request.HasFlag(Request.Players))
+                    {
+                        status.Players = GetPlayers(br);
+                    }
+
+                    // Save Response Teams
+                    if (request.HasFlag(Request.Teams))
+                    {
+                        status.Teams = GetTeams(br);
+                    }
+
+                    return status;
+                }
+            }
+        }
+
+        private byte[] ConnectAndSend(UdpClient udpClient, Request request)
+        {
+            // Connect to remote host
+            udpClient.Connect(_EndPoint);
+            udpClient.Client.SendTimeout = _Timeout;
+            udpClient.Client.ReceiveTimeout = _Timeout;
+
+            // Send Request
+            var requestData = new byte[] { 0xFE, 0xFD, 0x00, 0x04, 0x05, 0x06, 0x07 }.Concat(GetRequestBytes(request)).ToArray();
+            udpClient.Send(requestData, requestData.Length);
+
+            // Server response
+            var responseData = udpClient.Receive(ref _EndPoint);
+
+            // Remove the first 5 bytes { 0x00, 0x04, 0x05, 0x06, 0x07 }
+            return responseData.Skip(5).ToArray();
+        }
+
+        private byte[] GetRequestBytes(Request request)
+        {
+            return new byte[] {
+                (byte)(request.HasFlag(Request.Info) ? 0xFF : 0x00),
+                (byte)(request.HasFlag(Request.Players) ? 0xFF : 0x00),
+                (byte)(request.HasFlag(Request.Teams) ? 0xFF : 0x00),
+            };
+        }
+
+        private Dictionary<string, string> GetInfo(BinaryReader br)
+        {
+            var info = new Dictionary<string, string>();
+
+            // Read all key values
+            while (br.TryReadStringEx(out var key))
+            {
+                info[key] = br.ReadStringEx().Trim();
+            }
+
+            return info;
+        }
+
+        private List<Dictionary<string, string>> GetPlayers(BinaryReader br)
+        {
+            var players = new List<Dictionary<string, string>>();
+
+            // Skip a byte
+            br.ReadByte();
+
+            // Get player count
+            var playerCount = br.ReadByte();
+
+            // Get all keys
+            var keys = new List<string>();
+
+            while (br.TryReadStringEx(out var key))
+            {
+                keys.Add(key.TrimEnd('_'));
+            }
+
+            // Set all keys and values
+            for (int i = 0; i < playerCount; i++)
+            {
+                players.Add(new Dictionary<string, string>());
+
+                foreach (var key in keys)
+                {
+                    players[i][key] = br.ReadStringEx().Trim();
+                }
+            }
+
+            return players;
+        }
+
+        private List<Dictionary<string, string>> GetTeams(BinaryReader br)
+        {
+            var teams = new List<Dictionary<string, string>>();
+
+            // Skip a byte
+            br.ReadByte();
+
+            // Get team count
+            var teamCount = br.ReadByte();
+
+            // Get all keys
+            var keys = new List<string>();
+
+            while (br.TryReadStringEx(out var key))
+            {
+                keys.Add(key.TrimEnd('t').TrimEnd('_'));
+            }
+
+            // Set all keys and values
+            for (int i = 0; i < teamCount; i++)
+            {
+                teams.Add(new Dictionary<string, string>());
+
+                foreach (var key in keys)
+                {
+                    teams[i][key] = br.ReadStringEx().Trim();
+                }
+            }
+
+            return teams;
+        }
+
+        /// <summary>
+        /// Request Flag
+        /// </summary>
+        [Flags]
+        public enum Request : short
+        {
+#pragma warning disable 1591
+            Info = 1,
+            Players = 2,
+            Teams = 4,
+        }
+
+        public class Status
+        {
+            public Dictionary<string, string> Info { get; set; }
+
+            public List<Dictionary<string, string>> Players { get; set; }
+
+            public List<Dictionary<string, string>> Teams { get; set; }
+        }
+    }
+}

+ 25 - 0
VeloeMonitorDataCollector/Dependencies/SteamQuery/LICENSE

@@ -0,0 +1,25 @@
+MIT License
+
+
+
+    Copyright for original code of SteamQueryNet are held by Cem YILMAZ, 2018 and contributors. All other copyright for SteamQueryNet are held by Tyler O'Brien, 2022 under the same license..
+
+Copyright (c) 2018 Cem YILMAZ
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

BIN
VeloeMonitorDataCollector/Dependencies/SteamQuery/SteamQueryNet.dll


+ 2 - 0
VeloeMonitorDataCollector/Interfaces/IDataSendable.cs

@@ -14,6 +14,8 @@ public interface IDataSendable
 
     public void SendGamespy3(in Gs3Status.Status data, in string name);
 
+    public void SendGamespy2(in Gs2Status.Status data, in string name);
+
     public void Close();
 
     public bool CheckHardware(in Dictionary<string,float> input);

+ 2 - 2
VeloeMonitorDataCollector/Models/SteamData.cs

@@ -4,7 +4,7 @@ namespace VeloeMonitorDataCollector.Models;
 
 public struct SteamData
 {
-    public ServerInfo ServerInfo;
-    public List<Player> Players;
+    public ServerInfo ServerInfo { get; set; }
+    public List<Player> Players { get; set; }
 
 }

+ 1 - 1
VeloeMonitorDataCollector/Program.cs

@@ -45,5 +45,5 @@ catch (Exception ex)
 {
     logger.Error(ex.Message);
     logger.Error(ex.StackTrace);
-    throw;
+   
 }

+ 7 - 1
VeloeMonitorDataCollector/VeloeMonitorDataCollector.csproj

@@ -6,6 +6,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <PlatformTarget>x64</PlatformTarget>
+    <DebugType>embedded</DebugType>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -32,10 +33,15 @@
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-    <PackageReference Include="SteamQueryNet" Version="1.0.6" />
     <PackageReference Include="MySql.Data" Version="8.0.30" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Reference Include="SteamQueryNet">
+      <HintPath>Dependencies\SteamQuery\SteamQueryNet.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+
   <ItemGroup>
     <None Update="config.ini">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>