public override void Close() { try { base.Close(); MCreateShapeModel.Close(); MCreateShapeModel = null; MFindShapeMode.Close(); MFindShapeMode = null; MGrabPointSetting.Close(); MGrabPointSetting = null; MPZT_Detection.Close(); MPZT_Detection = null; MGrab_Intervene.Close(); MGrab_Intervene = null; MLM_DP.Close(); MLM_DP = null; MFangDai.Close(); MFangDai = null; MLanQuan.Close(); MLanQuan = null; NotifyExcInfo = null; } catch (Exception ex) { Util.WriteLog(this.GetType(), ex); Util.Notify("工具删除异常"); } }
public override void SerializeCheck() { NotifyExcInfo = null; using (Stream objectStream = new MemoryStream()) { System.Runtime.Serialization.IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); formatter.Serialize(objectStream, this); } }
//序列化 public override void SerializeCheck() { NotifyExcInfo = null; MCreateShapeModel.SerializeCheck(); MFindShapeMode.SerializeCheck(); MGrabPointSetting.SerializeCheck(); using (Stream objectStream = new MemoryStream()) { System.Runtime.Serialization.IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); formatter.Serialize(objectStream, this); } }
public void MapTest70022() { string path = @"D:\Clients\7.0.2.2"; Version version = ExeInfo.GetFileVersion(Path.Combine(path, "client.exe")); TileData.Initialize(path); Map.Initialize(path, 0); MapInfo mi; foreach (LandTileTest lt in m_LandTileTests) { MacroEx.GetMapInfo(lt.Facet, lt.X, lt.Y, out mi); Assert.IsNotNull(mi.landTile, "LandTile is null."); Assert.AreEqual(mi.landTile.ID, lt.LandTileID, "LandTile doesn't match expected."); Assert.AreEqual(mi.landTile.Name, lt.LandTileName, "LandTile Name doesn't match expected."); } TileData.Dispose(); Map.Dispose(); }
public static bool SetAddresses(ClientInfo clientInfo, string fileName) { try { byte[] fileBytes = File.ReadAllBytes(fileName); int baseAddress = clientInfo.BaseAddress.ToInt32(); clientInfo.Version = ExeInfo.GetFileVersion(fileName); clientInfo.DateStamp = ExeInfo.GetStamp(fileBytes); if (clientInfo.Version == "0.0.0.0") { clientInfo.Version = ExeInfo.DateToVersion(clientInfo.DateStamp); if (clientInfo.Version == "") { string version; if (!FindVersion(baseAddress, fileBytes, out version)) { //return false; } clientInfo.Version = version; } } if (!GetHookAddress(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetRecvAddress(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetSendAddress(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetReturnAddress1(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetCaveAddress(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetPlayerInfoPointer(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetClientPacketData(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetCursorAddress(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetServerSendAddress(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetPathFindAddress(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetGumpPointer(baseAddress, fileBytes, clientInfo)) { return(false); } if (!GetLoginServerAddress(baseAddress, fileBytes, clientInfo)) { return(false); } clientInfo.IsValid = true; return(true); } catch { } return(false); }