增加运动相关的变量,回家判断,运动到指定点,获取配置等;新增配置文件

This commit is contained in:
zhengxuan.zhang
2024-02-23 15:13:57 +08:00
parent cee64af0af
commit 5815739a4c
31 changed files with 942 additions and 146871 deletions
+7 -7
View File
@@ -110,6 +110,7 @@ namespace HexcalMC.Hexcal
}
catch
{
throw new Exception("TCP /IP 服务器关闭失败!");
}
}
@@ -134,7 +135,6 @@ namespace HexcalMC.Hexcal
{
if (_dictSocket.Values.ToArray()[i].Poll(10, SelectMode.SelectRead))
{
RemoveSocketClient(_dictSocket.Keys.ToArray()[i]);
}
}
@@ -145,7 +145,7 @@ namespace HexcalMC.Hexcal
_dictSocket.Add(sokClient.RemoteEndPoint.ToString(), sokClient); // 将与客户端连接的套接字对象添加到集合中;
RaisedStatus(EnumTcpIpServer.ClientConnect,
"客户端连接成功!RemoteEndPoint=" + sokClient.RemoteEndPoint);
"客户端连接成功!:" + sokClient.RemoteEndPoint);
Thread thread = new Thread(ReceiveThread);
thread.IsBackground = true;
@@ -154,17 +154,20 @@ namespace HexcalMC.Hexcal
_dictThread.Add(sokClient.RemoteEndPoint.ToString(), thread); // 将新建的线程 添加 到线程的集合中去。
}
}
catch
catch (Exception e)
{
throw new Exception("WatchThread异常" + e);
}
}
public event EventHandler<byte[]> DataReceived;
protected virtual void OnDataReceivedByte(byte[] data)
{
// 触发事件
DataReceived?.Invoke(this, data);
}
//接收线程
private void ReceiveThread(object sokObj)
{
@@ -222,7 +225,6 @@ namespace HexcalMC.Hexcal
case 3:
if (length > 0)
{
OnDataReceivedByte(arrMsgRec);
}
@@ -258,9 +260,7 @@ namespace HexcalMC.Hexcal
_dictSocket[strSocketKey].Send(arrMsg);
}
/// <summary>
/// 发送数据函数(字符串, 自动添加长度(byte格式))
/// </summary>
//发送数据函数(字符串, 自动添加长度(byte格式))
public string SendMessage2(string strSocketKey, string strMsg)
{
try