tlewis17 / touchportalapi Goto Github PK
View Code? Open in Web Editor NEWThis is an SDK to interface with Touch Portal to aid in the development of C# based Plugins.
License: MIT License
This is an SDK to interface with Touch Portal to aid in the development of C# based Plugins.
License: MIT License
I'm getting this error when intalling through the packages manager:
Error Could not install package 'TouchPortalApi 0.3.2'. You are trying to install this package in a project that targets '.NETFramework, Version = v4.7.2', but the package does not contain assembly references or content files that support that framework. For more information, contact the author of the package.
Tested both from NuGet and cloned Repo (lastest master commit in picture).
I am not sure why this happens, as I cannot always reproduce it (will update if I figure out more).
When I change values on a valueChoices list in a dynamic action (inlined), some times this happens, and the choice is selected in TouchPortal, but the OnListChangeEventHandler is not called.
Message: Specified argument was out of the range of valid values. (Parameter 'start')
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument)
at System.ReadOnlyMemory`1.Slice(Int32 start, Int32 length)
at System.Buffers.ReadOnlySequence`1.Enumerator.MoveNext()
at TouchPortalApi.Extensions.ReadOnlySquenceByteExtension.ParseAsUTF8String(ReadOnlySequence`1 slice, Int32 stringLengthEstimate) in C:\Users\oddbj\source\repos\TouchPortalAPI\TouchPortalApi\Extensions\ReadOnlySquenceByteExtension.cs:line 22
at TouchPortalApi.MessageProcessor.ProcessLine(ReadOnlySequence`1 line) in C:\Users\oddbj\source\repos\TouchPortalAPI\TouchPortalApi\MessageProcessor.cs:line 87
This bug is happens when the plugin is started from TouchPortal with plugin_start_cmd
. Not when starting from Visual Studio and connecting to TouchPortal etc.
When a Console application is started by TouchPortal, the Console.ReadLine()
does not hold the application.
Therefor this plugin will just skip the ReadLine part, and close the pluigin.
It can be changed to something like:
//Console.ReadLine();
var manualResetEvent = new ManualResetEvent(false);
manualResetEvent.WaitOne();
This will work, but then there is another issue. When TouchPortal closes, the plugin is still running.
Therefor there are two options, either use Environment.Exit(0);
in the OnCloseEventHandler
.
This is similar to what the Java SDK does:
@Override
public void onDisconnect(Exception exception) {
// Socket connection is lost or plugin has received close message
if (exception != null) {
exception.printStackTrace();
}
System.exit(0);
}
Or, pick in the OnCloseEventHandler
and do a manualResetEvent.Set()
.
Using a TaskCompleationSource
or similar instead of a ManualResetEvent should also work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.