You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
707 B
37 lines
707 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
using Sog;
|
|
using Google.Protobuf.WellKnownTypes;
|
|
using Google.Protobuf;
|
|
|
|
namespace SMAgent
|
|
{
|
|
public static class SMPingSvc
|
|
{
|
|
public static long lastPingTimeMs;
|
|
|
|
public static void Update(long tMs)
|
|
{
|
|
if(tMs - lastPingTimeMs < 30000)
|
|
{
|
|
return;
|
|
}
|
|
|
|
lastPingTimeMs = tMs;
|
|
|
|
if(SMAgentNet.Instance.IsConnected() == false)
|
|
{
|
|
return;
|
|
}
|
|
|
|
SMPing ping = new SMPing();
|
|
|
|
SMAgentNet.Instance.SendMsgToCenter(ping, SMMsgID.Ping);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|