/// <summary> /// 加载xml /// 子端结构体赋值为空 /// 实例化Net类 /// </summary> public Special() { Data = new ServerData("Server", "PointCloud-EVCS"); loadxml(); cloud = this; cloudnet = new CenterServerNet(Data, cloud); }
public static User CreatUserData(Socket socket, Package package) { User data = CenterServerNet.NewUser(package); data.IP = socket.RemoteEndPoint.ToString(); data.Live = true; data.socket = socket; return(data); }
/// <summary> /// 创建设备数据并注入 /// </summary> /// <param name="socket">Socket节点</param> /// <param name="package">获得的数据包</param> /// <returns></returns> public static Device CreatDeviceData(Socket socket, Package package) { Device data = CenterServerNet.NewDevice(package); data.IP = socket.RemoteEndPoint.ToString(); data.Live = true; data.socket = socket; return(data); }
public bool SendCode(Codemode code) { if (MailBox.Send(CenterServerNet.CreatCodeToPackage_ToDevice(code))) { return(true); } else { Console.WriteLine("fail"); return(false); } }
/// <summary> /// 发送设备列表事件 /// </summary> /// <param name="o"></param> /// <param name="e"></param> void sendiplist(object o, Send_IPList e) { MailBox.Send(CenterServerNet.CreatIPListToPackage(Messagetype.codeus, e.iPLists)); }