增加日志
This commit is contained in:
@@ -1280,13 +1280,14 @@ namespace RCUHost.Implement
|
||||
o.CurrentTime = DateTime.Now;
|
||||
o.EndPoint = EndPointStr;
|
||||
o.UnixTime = Tools.GetUnixTime();
|
||||
o.MAC = BitConverter.ToString(gga.Data.Skip(9).Take(2).ToArray());
|
||||
//新来的数据
|
||||
var n = Newtonsoft.Json.JsonConvert.SerializeObject(o);
|
||||
|
||||
|
||||
//上线
|
||||
//string EEE = CSRedisCacheHelper.Get<string>(EndPointStr);
|
||||
var EEE = CSRedisCacheHelper.Get_Partition<string>(EndPointStr, 4);
|
||||
var EEE = CSRedisCacheHelper.Get_Partition<string>(EndPointStr, 6);
|
||||
var dtstart = CSRedisCacheHelper.ForeverGet<string>(CacheKey.ServerStartTime);
|
||||
DateTime SSS = DateTime.Now;
|
||||
DateTime.TryParse(dtstart, out SSS);
|
||||
@@ -1295,7 +1296,8 @@ namespace RCUHost.Implement
|
||||
{
|
||||
CSRedisCacheHelper.Publish("redis-on_off_line", n);
|
||||
}
|
||||
CSRedisCacheHelper.Set_PartitionWithTime(EndPointStr, n, 5, 4);
|
||||
CSRedisCacheHelper.Set_PartitionWithTime(EndPointStr, n, 5, 6);
|
||||
CSRedisCacheHelper.Set_PartitionWithTime(EndPointStr, n, 20, 4);
|
||||
|
||||
|
||||
|
||||
@@ -1713,9 +1715,14 @@ namespace RCUHost.Implement
|
||||
int length = context111.Data.Length - offset - 2;
|
||||
var data = OriginalByte.Skip(offset).ToArray();
|
||||
|
||||
var LauncherVersion = data.Take(20);
|
||||
var RestartReason = data.Skip(20).Take(1);
|
||||
var LauncherVersion = data.Take(20).ToArray();
|
||||
var RestartReason = data.Skip(20).Take(1).ToArray();
|
||||
|
||||
string RoomNUMBER = CSRedisCacheHelper.HMGet<string>(5, CacheKey.RoomNumber_HostNumber, HostNNN)[0];
|
||||
if (string.IsNullOrEmpty(RoomNUMBER))
|
||||
{
|
||||
return;
|
||||
}
|
||||
NewVersionHexData ns = new NewVersionHexData();
|
||||
ns.CmdType = 0x33;
|
||||
ns.HotelCode = hotelCode;
|
||||
@@ -1723,9 +1730,17 @@ namespace RCUHost.Implement
|
||||
ns.RemoteEndPoint = EndPoint;
|
||||
ns.CurrentTime = DateTime.Now;
|
||||
ns.HexData = Tools.ByteToString(context111.Data);
|
||||
|
||||
ns.RoomNumber = RoomNUMBER;
|
||||
ns.MAC = BitConverter.ToString(OriginalByte.Skip(9).Take(2).ToArray());
|
||||
ns.CurrentStatus = "on";
|
||||
ns.UnixTime = Tools.GetUnixTime();
|
||||
ns.LauncherVersion = LauncherVersion;
|
||||
ns.RebootReason = RestartReason;
|
||||
string mns1 = Newtonsoft.Json.JsonConvert.SerializeObject(ns);
|
||||
CSRedisCacheHelper.Publish("redis-rcu-restart", mns1);
|
||||
}
|
||||
#region 取电
|
||||
if (cmdType == 0x35)
|
||||
{
|
||||
ReplyWithContent(context111, new byte[] { 0x00 }, framenolist);
|
||||
@@ -1806,6 +1821,7 @@ namespace RCUHost.Implement
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
// AA 55 35 00 54 33 53 41 34 10 80 EB 03 6B 24
|
||||
// 01 //协议版本
|
||||
@@ -1843,6 +1859,7 @@ namespace RCUHost.Implement
|
||||
//P30~P33:通道总能耗,单位:Wh(1度电 = 1KWh)
|
||||
|
||||
|
||||
#region 定时上报
|
||||
if (cmdType == 0x36)
|
||||
{
|
||||
|
||||
@@ -1937,6 +1954,9 @@ namespace RCUHost.Implement
|
||||
//ns.HexData = Tools.ByteToString(context111.Data);
|
||||
//CSRedisCacheHelper.Publish("redis-rcu-hexdata", Newtonsoft.Json.JsonConvert.SerializeObject(ns));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 定时上报
|
||||
if (cmdType == 0x34)
|
||||
{
|
||||
ReplyWithContent(context111, new byte[] { 0x00 }, framenolist);
|
||||
@@ -2540,6 +2560,7 @@ namespace RCUHost.Implement
|
||||
logger.Error("定是上报出错:" + ex.StackTrace);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//向服务器获取房态
|
||||
if (cmdType == 0x32)
|
||||
|
||||
Reference in New Issue
Block a user