添加调试信息和数据库查询

如题
This commit is contained in:
tianshuanbao
2025-12-17 09:59:02 +08:00
parent 5c949a6ce2
commit 4b15524845
4 changed files with 37 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ using Common;
using Commonlib;
using LogCap.Entity;
using MathNet.Numerics.Distributions;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json;
using NLog;
@@ -69,7 +70,7 @@ namespace LogCap.Common
var QQQSSS = Program.Cache.Get<List<MonitorEndPoint>>(CacheKey.MonitorEndPointList);
if (QQQSSS.Count > 0)
if (QQQSSS?.Count > 0)
{
string S_R_Type = "";
@@ -269,7 +270,7 @@ namespace LogCap.Common
}
}
private static void ReallyDealWith(bool isRegister, List<byte> data, string source_ip, ushort source_port, string cmdtype, string Send_Or_Receive = ConstKey.Receive_RX)
public static void ReallyDealWith(bool isRegister, List<byte> data, string source_ip, ushort source_port, string cmdtype, string Send_Or_Receive = ConstKey.Receive_RX)
{
try
{
@@ -285,8 +286,15 @@ namespace LogCap.Common
{
return;
}
long HHH = context.SystemHeader.Value.HostNumber.ToHotelCode();
var list = Program.Cache.Get<List<Monitor_Host>>(CacheKey.Key);
if (HHH == 1197)
{
//Console.WriteLine("data:" + Tools.ByteToString(data.ToArray()));
//Console.WriteLine(JsonConvert.SerializeObject(list));
}
if (list == null)
{
return;
@@ -349,6 +357,11 @@ namespace LogCap.Common
if (HostNNN.Equals(Ghostnumber))
{
if (HHH == 1197)
{
//Console.WriteLine("111111 "+isRegister);
//Console.WriteLine("111111 data:" + Tools.ByteToString(data.ToArray()));
}
//心跳包可以注册
if (isRegister)
{
@@ -360,6 +373,11 @@ namespace LogCap.Common
string Key = string.Format("{0}_{1}", CacheKey.RoomIP_Port_Prefix, HostNNN);
var takeMM = Program.Cache.Get<MonitorRedis>(Key);
if (HHH == 1197)
{
//Console.WriteLine("1197::::"+JsonConvert.SerializeObject(takeMM));
}
//如果房间为空
if (takeMM == null)
{
@@ -379,6 +397,9 @@ namespace LogCap.Common
}
else
{
//SqlConnection con = new SqlConnection("");
//con.Open();
sttr = Send_Http_Request_Params("api/GetHostByMAC_POST", dic);
Program.Cache.Set<string>(KKK, GGG, new MemoryCacheEntryOptions()
{
@@ -448,6 +469,10 @@ namespace LogCap.Common
}
else
{
if (hotelcode.Equals("1197"))
{
Console.WriteLine("upload data");
}
long hotel_code = takeMM.HotelCode;
int host_id = takeMM.HostID;