/// <summary> /// Constructor /// </summary> /// <param name="hostname">The hostname/ip of the socks server</param> /// <param name="port">The port of the socks server</param> /// <param name="ipv6">True to try and use IPv6 (if available)</param> /// <param name="version">Specify the supported versions</param> /// <param name="sendHostName">True to send the hostname to the socks server</param> public SocksProxyClient(string hostname, int port, bool ipv6, SupportedVersion version, bool sendHostName) { _hostname = hostname; _port = port; _ipv6 = ipv6; _version = version; _sendHostName = sendHostName; }
/// <summary> /// Constructor /// </summary> /// <param name="hostname">The hostname/ip of the socks server</param> /// <param name="port">The port of the socks server</param> /// <param name="ipv6">True to try and use IPv6 (if available)</param> /// <param name="version">Specify the supported versions</param> /// <param name="sendHostName">True to send the hostname to the socks server</param> public SocksProxyClient(string hostname, int port, bool ipv6, SupportedVersion version, bool sendHostName) { _hostname = hostname; _port = port; _ipv6 = ipv6; _version = version; _sendHostName = sendHostName; }
/// <summary> /// Load existing nflavor props /// </summary> /// <param name="buffer"></param> public void Load(byte[] buffer) { try { using (MemoryReader mem = new MemoryReader(buffer)) { /* Sign = Encoding.Default.GetString()*/ mem.ReadBytes(18); Version = mem.ReadUInt32(); #if DEBUG == false if (!SupportedVersion.Contains(Version)) { Parent.Log(Levels.Error, "Failed\n"); Parent.Log(Levels.Fatal, $"Incompatible version {Version} is not supported or not implemented.\n"); return; } #endif var PropCount = mem.ReadInt32(); for (int i = 0; i < PropCount; i++) { var prop = new QuestProp(); prop.QuestPropID = mem.ReadInt32(); var vector = new Vector { X = mem.ReadSingle() / 7.875f, Y = mem.ReadSingle() / 7.875f }; prop.Position = vector.Rotate180FlipY(); prop.OffSet = mem.ReadSingle(); prop.RotateX = mem.ReadSingle(); prop.RotateY = mem.ReadSingle(); prop.RotateZ = mem.ReadSingle(); prop.ScaleX = mem.ReadSingle(); prop.ScaleY = (Version >= 3) ? mem.ReadSingle() : prop.ScaleX; prop.ScaleZ = (Version >= 3) ? mem.ReadSingle() : prop.ScaleX; prop.PropNum = mem.ReadUInt16(); prop.LockedHeight = (Version >= 3) ? mem.ReadBoolean() : false; prop.LockHeight = (Version >= 3) ? mem.ReadSingle() : 0f; prop.TextureGroupIndex = (Version >= 3) ? mem.ReadInt16() : (short)-1; Props.Add(prop); } } Render(); Parent.Log(Levels.Success, "Ok\n"); } catch (Exception exception) { Dispose(); Parent.Log(Levels.Error, "Failed\n"); Parent.Log(Levels.Fatal, $"Qpf::Load<Exception> -> {exception}\n"); } }
public ITaskItem ToItem() { ITaskItem item = new TaskItem(Framework.ToString()); item.SetMetadata("ShortName", ShortName); item.SetMetadata("Version", SupportedVersion.ToString()); item.SetMetadata("Inbox", IsInbox.ToString()); item.SetMetadata("ValidatedRIDs", String.Join(";", RuntimeIds)); return(item); }
/// <summary> /// Initialize with no data. /// </summary> public G1Model() { Section = new ResourceSectionHeader { Magic = DataType.Model, Size = -1, Version = SupportedVersion.ToVersionA() }; SectionRoot = new PackedResource(); }
private void CreateCapabilitiesRequestMockForParty( string partyRequestUri, string partyId, SupportedVersion supportedVersion = null) { if (supportedVersion == null) { supportedVersion = new SupportedVersion { SupportedFeatures = new[] { new SupportedFeature { Public = new[] { new FeatureObject { Url = new Uri("http://localhost.com/authorize") } } } } }; } _capabilitiesQueryServiceMock .Setup(x => x.GetAsync( It.Is <CapabilitiesRequestArgs>( c => c.RequestUri == partyRequestUri), It.IsAny <CancellationToken>())) .ReturnsAsync(new CapabilitiesResponse { PartyId = partyId, SupportedVersions = new[] { supportedVersion } }); }
/// <summary> /// /// </summary> /// <param name="logger"></param> /// <param name="supportedVersion"></param> public SocksProxyServer(Logger logger, SupportedVersion supportedVersion) : base(logger) { _supportedVersion = supportedVersion; }
/// <summary> /// Constructor /// </summary> /// <param name="version">The supported version</param> public SupportedVersionAttribute(SupportedVersion version) { Version = version; }
/// <summary> /// /// </summary> /// <param name="logger"></param> /// <param name="supportedVersion"></param> public SocksProxyServer(Logger logger, SupportedVersion supportedVersion) : base(logger) { _supportedVersion = supportedVersion; }
/// <summary> /// Load existing potencially visible set /// </summary> /// <param name="buffer"></param> public void Load(byte[] buffer) { try { using (MemoryReader mem = new MemoryReader(buffer)) { /*Sign = Encoding.Default.GetString()*/ mem.ReadBytes(16); Version = mem.ReadUInt16(); #if DEBUG == false if (!SupportedVersion.Contains(Version)) { Parent.Log(Levels.Error, $"Failed\n"); Parent.Log(Levels.Fatal, $"Incompatible version {Version} is not supported or not implemented.\n"); return; } #endif SegmentCountPerMap = mem.ReadByte(); MapStartPosX = mem.ReadByte(); MapStartPosY = mem.ReadByte(); var segmentCount = mem.ReadUInt16(); var propCount = mem.ReadInt32(); SegmentLeft = mem.ReadByte(); SegmentTop = mem.ReadByte(); SegmentRight = mem.ReadByte(); SegmentBottom = mem.ReadByte(); for (int i = 0; i < segmentCount; i++) { var segment = new PotencialSegment(); segment.SegmentX = mem.ReadByte(); segment.SegmentY = mem.ReadByte(); var includeSegmentCount = mem.ReadUInt16(); for (int f = 0; f < includeSegmentCount; f++) { var includeSegment = new PotencialSegmentData(); includeSegment.SegmentX = mem.ReadByte(); includeSegment.SegmentY = mem.ReadByte(); segment.IncludeSegments.Add(includeSegment); } Segments.Add(segment); } for (int i = 0; i < propCount; i++) { var prop = new PotencialProp(); prop.SegmentX = mem.ReadByte(); prop.SegmentY = mem.ReadByte(); var includePropCount = mem.ReadInt32(); for (int f = 0; f < includePropCount; f++) { var includeProp = new PotencialPropData(); includeProp.PropIdx = mem.ReadUInt32(); includeProp.SegmentIdx = mem.ReadUInt32(); prop.IncludeProps.Add(includeProp); } Props.Add(prop); } } Parent.Log(Levels.Success, "Ok\n"); } catch (Exception exception) { Dispose(); Parent.Log(Levels.Error, "Failed\n"); Parent.Log(Levels.Fatal, $"Pvs::Load<Exception> -> {exception}\n"); } }
/// <summary> /// Load existing nflavor script /// </summary> /// <param name="buffer"></param> public void Load(byte[] buffer) { try { using (MemoryReader mem = new MemoryReader(buffer)) { /*Sign = Encoding.Default.GetString()*/ mem.ReadBytes(16); Version = mem.ReadInt32(); #if DEBUG == false if (!SupportedVersion.Contains(Version)) { Parent.Log(Levels.Error, $"Failed\n"); Parent.Log(Levels.Fatal, $"Nfs::Load<Version> -> Incompatible version {Version} is not supported\n"); return; } #endif /* nfs.dwEventLocationOffset = */ mem.ReadInt32(); /* nfs.dwEventScriptOffset = */ mem.ReadInt32(); /* nfs.dwPropScriptOffset = */ mem.ReadInt32(); var nLocationCount = mem.ReadInt32(); Respawns = new List <Respawn>(); for (int i = 0; i < nLocationCount; i++) { var location = new Respawn(); location.Rectangle.LeftTop = new Vector { X = mem.ReadInt32() * Global.TileLenght / Global.ScaleRatio, Y = mem.ReadInt32() * Global.TileLenght / Global.ScaleRatio } .Rotate180FlipY(); location.Rectangle.RightBottom = new Vector { X = mem.ReadInt32() * Global.TileLenght / Global.ScaleRatio, Y = mem.ReadInt32() * Global.TileLenght / Global.ScaleRatio } .Rotate180FlipY(); var stringSize = mem.ReadInt32(); location.Description = Encoding.Default.GetString(mem.ReadBytes(stringSize)); Respawns.Add(location); } var nScriptCount = mem.ReadInt32(); for (int i = 0; i < nScriptCount; i++) { var index = mem.ReadInt32(); var nFunctionCount = mem.ReadInt32(); for (int f = 0; f < nFunctionCount; f++) { /* function.nTrigger = */ mem.ReadInt32(); var nStringSize = mem.ReadInt32(); var FunctionString = Encoding.Default.GetString(mem.ReadBytes(nStringSize)); Respawns[index].Scripts.Add(FunctionString); } } var nPropCount = mem.ReadInt32(); Props = new List <NpcProp>(); for (int i = 0; i < nPropCount; i++) { var propScript = new NpcProp(); propScript.PropId = mem.ReadInt32(); var vector = new Vector { X = mem.ReadSingle() / 7.875f, Y = mem.ReadSingle() / 7.875f }; propScript.Position = vector.Rotate180FlipY(); propScript.ModelId = mem.ReadInt16(); var nFunctionCount = mem.ReadInt32(); for (int f = 0; f < nFunctionCount; f++) { /* function.nTrigger = */ mem.ReadInt32(); var nStringSize = mem.ReadInt32(); var FunctionString = Encoding.Default.GetString(mem.ReadBytes(nStringSize)); propScript.Scripts.Add(FunctionString); } Props.Add(propScript); } } Render(); Parent.Log(Levels.Success, "Ok\n"); } catch (Exception exception) { Dispose(); Parent.Log(Levels.Error, "Failed\n"); Parent.Log(Levels.Fatal, $"Nfs::Load<Exception> -> {exception}\n"); } }
/// <summary> /// Constructor /// </summary> /// <param name="version">The supported version</param> public SupportedVersionAttribute(SupportedVersion version) { Version = version; }