├── .gitattributes
├── .gitignore
├── GameInputCommandSystem.sln
├── GameInputCommandSystem
├── App.config
├── App.xaml
├── App.xaml.cs
├── App_Start
│ └── SwaggerConfig.cs
├── AutoItX3.dll
├── Controllers
│ ├── KeyController.cs
│ ├── ToggleController.cs
│ └── VersionController.cs
├── GICValues.cs
├── GameInputCommandSystem.csproj
├── GateKeeper.cs
├── GlobalSuppressions.cs
├── KeyMaster.cs
├── Models
│ └── Command.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Startup.cs
├── Views
│ ├── About.xaml
│ ├── About.xaml.cs
│ ├── MainWindow.xaml
│ └── MainWindow.xaml.cs
├── app.ico
├── app.manifest
├── license-autoit.txt
├── packages.config
└── utils
│ └── CryptoHelper.cs
├── LICENSE
├── README.md
└── _config.yml
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/GameInputCommandSystem.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.2003
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameInputCommandSystem", "GameInputCommandSystem\GameInputCommandSystem.csproj", "{C6CA4891-645A-4E86-900E-2ED2AD425855}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x64 = Debug|x64
12 | Release|Any CPU = Release|Any CPU
13 | Release|x64 = Release|x64
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {C6CA4891-645A-4E86-900E-2ED2AD425855}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {C6CA4891-645A-4E86-900E-2ED2AD425855}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {C6CA4891-645A-4E86-900E-2ED2AD425855}.Debug|x64.ActiveCfg = Debug|x64
19 | {C6CA4891-645A-4E86-900E-2ED2AD425855}.Debug|x64.Build.0 = Debug|x64
20 | {C6CA4891-645A-4E86-900E-2ED2AD425855}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {C6CA4891-645A-4E86-900E-2ED2AD425855}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {C6CA4891-645A-4E86-900E-2ED2AD425855}.Release|x64.ActiveCfg = Release|x64
23 | {C6CA4891-645A-4E86-900E-2ED2AD425855}.Release|x64.Build.0 = Release|x64
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {7370A55F-7AC0-4AD9-B331-2031CD724E5F}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | 0
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace GameInputCommandSystem
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/App_Start/SwaggerConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using WebActivatorEx;
3 | using GameInputCommandSystem;
4 | using Swashbuckle.Application;
5 |
6 | [assembly: PreApplicationStartMethod(typeof(SwaggerConfig), "Register")]
7 |
8 | namespace GameInputCommandSystem
9 | {
10 | public class SwaggerConfig
11 | {
12 | public static void Register()
13 | {
14 | var thisAssembly = typeof(SwaggerConfig).Assembly;
15 |
16 | GlobalConfiguration.Configuration
17 | .EnableSwagger(c =>
18 | {
19 | // By default, the service root url is inferred from the request used to access the docs.
20 | // However, there may be situations (e.g. proxy and load-balanced environments) where this does not
21 | // resolve correctly. You can workaround this by providing your own code to determine the root URL.
22 | //
23 | //c.RootUrl(req => GetRootUrlFromAppConfig());
24 |
25 | // If schemes are not explicitly provided in a Swagger 2.0 document, then the scheme used to access
26 | // the docs is taken as the default. If your API supports multiple schemes and you want to be explicit
27 | // about them, you can use the "Schemes" option as shown below.
28 | //
29 | //c.Schemes(new[] { "http", "https" });
30 |
31 | // Use "SingleApiVersion" to describe a single version API. Swagger 2.0 includes an "Info" object to
32 | // hold additional metadata for an API. Version and title are required but you can also provide
33 | // additional fields by chaining methods off SingleApiVersion.
34 | //
35 | c.SingleApiVersion("v1", "GameInputCommandSystem");
36 |
37 | // If you want the output Swagger docs to be indented properly, enable the "PrettyPrint" option.
38 | //
39 | //c.PrettyPrint();
40 |
41 | // If your API has multiple versions, use "MultipleApiVersions" instead of "SingleApiVersion".
42 | // In this case, you must provide a lambda that tells Swashbuckle which actions should be
43 | // included in the docs for a given API version. Like "SingleApiVersion", each call to "Version"
44 | // returns an "Info" builder so you can provide additional metadata per API version.
45 | //
46 | //c.MultipleApiVersions(
47 | // (apiDesc, targetApiVersion) => ResolveVersionSupportByRouteConstraint(apiDesc, targetApiVersion),
48 | // (vc) =>
49 | // {
50 | // vc.Version("v2", "Swashbuckle Dummy API V2");
51 | // vc.Version("v1", "Swashbuckle Dummy API V1");
52 | // });
53 |
54 | // You can use "BasicAuth", "ApiKey" or "OAuth2" options to describe security schemes for the API.
55 | // See https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md for more details.
56 | // NOTE: These only define the schemes and need to be coupled with a corresponding "security" property
57 | // at the document or operation level to indicate which schemes are required for an operation. To do this,
58 | // you'll need to implement a custom IDocumentFilter and/or IOperationFilter to set these properties
59 | // according to your specific authorization implementation
60 | //
61 | //c.BasicAuth("basic")
62 | // .Description("Basic HTTP Authentication");
63 | //
64 | // NOTE: You must also configure 'EnableApiKeySupport' below in the SwaggerUI section
65 | //c.ApiKey("apiKey")
66 | // .Description("API Key Authentication")
67 | // .Name("apiKey")
68 | // .In("header");
69 | //
70 | //c.OAuth2("oauth2")
71 | // .Description("OAuth2 Implicit Grant")
72 | // .Flow("implicit")
73 | // .AuthorizationUrl("http://petstore.swagger.wordnik.com/api/oauth/dialog")
74 | // //.TokenUrl("https://tempuri.org/token")
75 | // .Scopes(scopes =>
76 | // {
77 | // scopes.Add("read", "Read access to protected resources");
78 | // scopes.Add("write", "Write access to protected resources");
79 | // });
80 |
81 | // Set this flag to omit descriptions for any actions decorated with the Obsolete attribute
82 | //c.IgnoreObsoleteActions();
83 |
84 | // Each operation be assigned one or more tags which are then used by consumers for various reasons.
85 | // For example, the swagger-ui groups operations according to the first tag of each operation.
86 | // By default, this will be controller name but you can use the "GroupActionsBy" option to
87 | // override with any value.
88 | //
89 | //c.GroupActionsBy(apiDesc => apiDesc.HttpMethod.ToString());
90 |
91 | // You can also specify a custom sort order for groups (as defined by "GroupActionsBy") to dictate
92 | // the order in which operations are listed. For example, if the default grouping is in place
93 | // (controller name) and you specify a descending alphabetic sort order, then actions from a
94 | // ProductsController will be listed before those from a CustomersController. This is typically
95 | // used to customize the order of groupings in the swagger-ui.
96 | //
97 | //c.OrderActionGroupsBy(new DescendingAlphabeticComparer());
98 |
99 | // If you annotate Controllers and API Types with
100 | // Xml comments (http://msdn.microsoft.com/en-us/library/b2s063f7(v=vs.110).aspx), you can incorporate
101 | // those comments into the generated docs and UI. You can enable this by providing the path to one or
102 | // more Xml comment files.
103 | //
104 | //c.IncludeXmlComments(GetXmlCommentsPath());
105 |
106 | // Swashbuckle makes a best attempt at generating Swagger compliant JSON schemas for the various types
107 | // exposed in your API. However, there may be occasions when more control of the output is needed.
108 | // This is supported through the "MapType" and "SchemaFilter" options:
109 | //
110 | // Use the "MapType" option to override the Schema generation for a specific type.
111 | // It should be noted that the resulting Schema will be placed "inline" for any applicable Operations.
112 | // While Swagger 2.0 supports inline definitions for "all" Schema types, the swagger-ui tool does not.
113 | // It expects "complex" Schemas to be defined separately and referenced. For this reason, you should only
114 | // use the "MapType" option when the resulting Schema is a primitive or array type. If you need to alter a
115 | // complex Schema, use a Schema filter.
116 | //
117 | //c.MapType(() => new Schema { type = "integer", format = "int32" });
118 |
119 | // If you want to post-modify "complex" Schemas once they've been generated, across the board or for a
120 | // specific type, you can wire up one or more Schema filters.
121 | //
122 | //c.SchemaFilter();
123 |
124 | // In a Swagger 2.0 document, complex types are typically declared globally and referenced by unique
125 | // Schema Id. By default, Swashbuckle does NOT use the full type name in Schema Ids. In most cases, this
126 | // works well because it prevents the "implementation detail" of type namespaces from leaking into your
127 | // Swagger docs and UI. However, if you have multiple types in your API with the same class name, you'll
128 | // need to opt out of this behavior to avoid Schema Id conflicts.
129 | //
130 | //c.UseFullTypeNameInSchemaIds();
131 |
132 | // Alternatively, you can provide your own custom strategy for inferring SchemaId's for
133 | // describing "complex" types in your API.
134 | //
135 | //c.SchemaId(t => t.FullName.Contains('`') ? t.FullName.Substring(0, t.FullName.IndexOf('`')) : t.FullName);
136 |
137 | // Set this flag to omit schema property descriptions for any type properties decorated with the
138 | // Obsolete attribute
139 | //c.IgnoreObsoleteProperties();
140 |
141 | // In accordance with the built in JsonSerializer, Swashbuckle will, by default, describe enums as integers.
142 | // You can change the serializer behavior by configuring the StringToEnumConverter globally or for a given
143 | // enum type. Swashbuckle will honor this change out-of-the-box. However, if you use a different
144 | // approach to serialize enums as strings, you can also force Swashbuckle to describe them as strings.
145 | //
146 | //c.DescribeAllEnumsAsStrings();
147 |
148 | // Similar to Schema filters, Swashbuckle also supports Operation and Document filters:
149 | //
150 | // Post-modify Operation descriptions once they've been generated by wiring up one or more
151 | // Operation filters.
152 | //
153 | //c.OperationFilter();
154 | //
155 | // If you've defined an OAuth2 flow as described above, you could use a custom filter
156 | // to inspect some attribute on each action and infer which (if any) OAuth2 scopes are required
157 | // to execute the operation
158 | //
159 | //c.OperationFilter();
160 |
161 | // Post-modify the entire Swagger document by wiring up one or more Document filters.
162 | // This gives full control to modify the final SwaggerDocument. You should have a good understanding of
163 | // the Swagger 2.0 spec. - https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md
164 | // before using this option.
165 | //
166 | //c.DocumentFilter();
167 |
168 | // In contrast to WebApi, Swagger 2.0 does not include the query string component when mapping a URL
169 | // to an action. As a result, Swashbuckle will raise an exception if it encounters multiple actions
170 | // with the same path (sans query string) and HTTP method. You can workaround this by providing a
171 | // custom strategy to pick a winner or merge the descriptions for the purposes of the Swagger docs
172 | //
173 | //c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
174 |
175 | // Wrap the default SwaggerGenerator with additional behavior (e.g. caching) or provide an
176 | // alternative implementation for ISwaggerProvider with the CustomProvider option.
177 | //
178 | //c.CustomProvider((defaultProvider) => new CachingSwaggerProvider(defaultProvider));
179 | })
180 | .EnableSwaggerUi(c =>
181 | {
182 | // Use the "DocumentTitle" option to change the Document title.
183 | // Very helpful when you have multiple Swagger pages open, to tell them apart.
184 | //
185 | //c.DocumentTitle("My Swagger UI");
186 |
187 | // Use the "InjectStylesheet" option to enrich the UI with one or more additional CSS stylesheets.
188 | // The file must be included in your project as an "Embedded Resource", and then the resource's
189 | // "Logical Name" is passed to the method as shown below.
190 | //
191 | //c.InjectStylesheet(containingAssembly, "Swashbuckle.Dummy.SwaggerExtensions.testStyles1.css");
192 |
193 | // Use the "InjectJavaScript" option to invoke one or more custom JavaScripts after the swagger-ui
194 | // has loaded. The file must be included in your project as an "Embedded Resource", and then the resource's
195 | // "Logical Name" is passed to the method as shown above.
196 | //
197 | //c.InjectJavaScript(thisAssembly, "Swashbuckle.Dummy.SwaggerExtensions.testScript1.js");
198 |
199 | // The swagger-ui renders boolean data types as a dropdown. By default, it provides "true" and "false"
200 | // strings as the possible choices. You can use this option to change these to something else,
201 | // for example 0 and 1.
202 | //
203 | //c.BooleanValues(new[] { "0", "1" });
204 |
205 | // By default, swagger-ui will validate specs against swagger.io's online validator and display the result
206 | // in a badge at the bottom of the page. Use these options to set a different validator URL or to disable the
207 | // feature entirely.
208 | //c.SetValidatorUrl("http://localhost/validator");
209 | //c.DisableValidator();
210 |
211 | // Use this option to control how the Operation listing is displayed.
212 | // It can be set to "None" (default), "List" (shows operations for each resource),
213 | // or "Full" (fully expanded: shows operations and their details).
214 | //
215 | //c.DocExpansion(DocExpansion.List);
216 |
217 | // Specify which HTTP operations will have the 'Try it out!' option. An empty paramter list disables
218 | // it for all operations.
219 | //
220 | //c.SupportedSubmitMethods("GET", "HEAD");
221 |
222 | // Use the CustomAsset option to provide your own version of assets used in the swagger-ui.
223 | // It's typically used to instruct Swashbuckle to return your version instead of the default
224 | // when a request is made for "index.html". As with all custom content, the file must be included
225 | // in your project as an "Embedded Resource", and then the resource's "Logical Name" is passed to
226 | // the method as shown below.
227 | //
228 | //c.CustomAsset("index", containingAssembly, "YourWebApiProject.SwaggerExtensions.index.html");
229 |
230 | // If your API has multiple versions and you've applied the MultipleApiVersions setting
231 | // as described above, you can also enable a select box in the swagger-ui, that displays
232 | // a discovery URL for each version. This provides a convenient way for users to browse documentation
233 | // for different API versions.
234 | //
235 | //c.EnableDiscoveryUrlSelector();
236 |
237 | // If your API supports the OAuth2 Implicit flow, and you've described it correctly, according to
238 | // the Swagger 2.0 specification, you can enable UI support as shown below.
239 | //
240 | //c.EnableOAuth2Support(
241 | // clientId: "test-client-id",
242 | // clientSecret: null,
243 | // realm: "test-realm",
244 | // appName: "Swagger UI"
245 | // //additionalQueryStringParams: new Dictionary() { { "foo", "bar" } }
246 | //);
247 |
248 | // If your API supports ApiKey, you can override the default values.
249 | // "apiKeyIn" can either be "query" or "header"
250 | //
251 | //c.EnableApiKeySupport("apiKey", "header");
252 | });
253 | }
254 | }
255 | }
256 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/AutoItX3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Terence-D/GameInputCommandServer/5b8d8f556b600ea0858da890342568e5947468d1/GameInputCommandSystem/AutoItX3.dll
--------------------------------------------------------------------------------
/GameInputCommandSystem/Controllers/KeyController.cs:
--------------------------------------------------------------------------------
1 | using GameInputCommandSystem.Models;
2 | using System.Web.Http;
3 |
4 | /**
5 | Copyright [2019] [Terence Doerksen]
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 | */
19 | namespace GameInputCommandSystem.Controllers
20 | {
21 | /**
22 | * Used for commands related to a standard key up/down event
23 | * */
24 | [Authorize]
25 | public class KeyController : ApiController
26 | {
27 | /**
28 | * Client will send in a specific key command along with modifiers and the event type - key down or key up
29 | * */
30 | public void Post([FromBody]Command value)
31 | {
32 | KeyMaster.SendCommand(value, false);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Controllers/ToggleController.cs:
--------------------------------------------------------------------------------
1 | using GameInputCommandSystem.Models;
2 | using System.Web.Http;
3 |
4 | /**
5 | Copyright [2019] [Terence Doerksen]
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 | */
19 | namespace GameInputCommandSystem.Controllers
20 | {
21 | /**
22 | * Used for quick toggle commands
23 | * */
24 | [Authorize]
25 | public class ToggleController : ApiController
26 | {
27 | /**
28 | * Client will send in a specific key command along with modifiers and the event type.
29 | * The server will process both the key down and up commands.
30 | * */
31 | public void Post([FromBody]Command value)
32 | {
33 | KeyMaster.SendCommand(value, true);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Controllers/VersionController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net.Http;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Web.Http;
8 | using System.Reflection;
9 | using System.Diagnostics;
10 | using System.Net;
11 |
12 | /**
13 | Copyright [2019] [Terence Doerksen]
14 |
15 | Licensed under the Apache License, Version 2.0 (the "License");
16 | you may not use this file except in compliance with the License.
17 | You may obtain a copy of the License at
18 |
19 | http://www.apache.org/licenses/LICENSE-2.0
20 |
21 | Unless required by applicable law or agreed to in writing, software
22 | distributed under the License is distributed on an "AS IS" BASIS,
23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 | See the License for the specific language governing permissions and
25 | limitations under the License.
26 | */
27 | namespace GameInputCommandSystem.Controllers
28 | {
29 | /**
30 | * Used to validate the version of the server is what the client expects
31 | * */
32 | public class VersionController : ApiController
33 | {
34 | private const string API_VERSION = "1.3.0.0";
35 | /**
36 | * Returns current API version of this server
37 | * */
38 | public HttpResponseMessage Get()
39 | {
40 | Assembly assembly = Assembly.GetExecutingAssembly();
41 | //FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
42 | string version = API_VERSION;// fileVersionInfo.ProductVersion;
43 |
44 | return Request.CreateResponse(HttpStatusCode.OK, version, Configuration.Formatters.JsonFormatter);
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/GICValues.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 |
4 | /**
5 | Copyright [2019] [Terence Doerksen]
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 | */
19 | namespace GameInputCommandSystem
20 | {
21 | class GICValues
22 | {
23 | private static readonly Lazy instance = new Lazy(() => new GICValues());
24 | public static GICValues Instance { get { return instance.Value; } }
25 |
26 | private string address = "localhost";
27 | private int port = 8093;
28 | private string password = "123456";
29 | private string application = "notepad.exe";
30 |
31 |
32 | private GICValues()
33 | {
34 | }
35 |
36 | public Process ActiveProcess { get; set; }
37 |
38 | public string Address
39 | {
40 | get
41 | {
42 | return address;
43 | }
44 | set
45 | {
46 | address = value;
47 | }
48 | }
49 |
50 | public int Port
51 | {
52 | get
53 | {
54 | return port;
55 | }
56 | set
57 | {
58 | if (value > 1023 && value < 655535)
59 | port = value;
60 | }
61 | }
62 |
63 | public string Password
64 | {
65 | get
66 | {
67 | return password;
68 | }
69 | set
70 | {
71 | if (value.Length > 6 && value.Length < 100)
72 | password = value;
73 | }
74 | }
75 | public string Application
76 | {
77 | get
78 | {
79 | return application;
80 | }
81 | set
82 | {
83 | if (value.Length > 0)
84 | application = value;
85 | }
86 | }
87 |
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/GameInputCommandSystem.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {C6CA4891-645A-4E86-900E-2ED2AD425855}
8 | WinExe
9 | GameInputCommandSystem
10 | GameInputCommandSystem
11 | v4.7.2
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 | false
17 | publish\
18 | true
19 | Disk
20 | false
21 | Foreground
22 | 7
23 | Days
24 | false
25 | false
26 | true
27 | true
28 | 0
29 | 1.5.0.%2a
30 | false
31 | true
32 | true
33 |
34 |
35 |
36 | AnyCPU
37 | true
38 | full
39 | false
40 | bin\Debug\
41 | DEBUG;TRACE
42 | prompt
43 | 4
44 |
45 |
46 | AnyCPU
47 | pdbonly
48 | true
49 | bin\Release\
50 | TRACE
51 | prompt
52 | 4
53 | bin\Release\GameInputCommandSystem.xml
54 |
55 |
56 | true
57 | bin\x64\Debug\
58 | DEBUG;TRACE
59 | full
60 | x64
61 | prompt
62 | MinimumRecommendedRules.ruleset
63 | true
64 |
65 |
66 | bin\x64\Release\
67 | TRACE
68 | true
69 | pdbonly
70 | x64
71 | prompt
72 | MinimumRecommendedRules.ruleset
73 | true
74 |
75 |
76 | EF661A61AB2405EB0CE7621DCBAC48215BF8E838
77 |
78 |
79 | GameInputCommandSystem_TemporaryKey.pfx
80 |
81 |
82 | false
83 |
84 |
85 | true
86 |
87 |
88 | app.manifest
89 |
90 |
91 | LocalIntranet
92 |
93 |
94 | app.ico
95 |
96 |
97 |
98 | False
99 | C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3.Assembly.dll
100 |
101 |
102 | ..\packages\Microsoft.Owin.4.1.1\lib\net45\Microsoft.Owin.dll
103 |
104 |
105 | ..\packages\Microsoft.Owin.Host.HttpListener.4.1.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll
106 |
107 |
108 | ..\packages\Microsoft.Owin.Hosting.4.1.1\lib\net45\Microsoft.Owin.Hosting.dll
109 |
110 |
111 | ..\packages\Microsoft.Owin.Security.4.1.1\lib\net45\Microsoft.Owin.Security.dll
112 |
113 |
114 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
115 |
116 |
117 | ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll
118 |
119 |
120 | ..\packages\Owin.1.0\lib\net40\Owin.dll
121 |
122 |
123 | ..\packages\Swashbuckle.Core.5.6.0\lib\net40\Swashbuckle.Core.dll
124 |
125 |
126 |
127 |
128 |
129 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll
130 |
131 |
132 |
133 | ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll
134 |
135 |
136 | ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.7\lib\net45\System.Web.Http.Owin.dll
137 |
138 |
139 | ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 | 4.0
150 |
151 |
152 | ..\packages\Thinktecture.IdentityModel.Owin.BasicAuthentication.1.0.1\lib\net45\Thinktecture.IdentityModel.Owin.BasicAuthentication.dll
153 |
154 |
155 | ..\packages\WebActivatorEx.2.2.0\lib\net40\WebActivatorEx.dll
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 | MSBuild:Compile
164 | Designer
165 |
166 |
167 | Designer
168 | MSBuild:Compile
169 |
170 |
171 | MSBuild:Compile
172 | Designer
173 |
174 |
175 | App.xaml
176 | Code
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 | About.xaml
191 |
192 |
193 | MainWindow.xaml
194 | Code
195 |
196 |
197 |
198 |
199 | Code
200 |
201 |
202 | True
203 | True
204 | Resources.resx
205 |
206 |
207 | True
208 | Settings.settings
209 | True
210 |
211 |
212 | ResXFileCodeGenerator
213 | Resources.Designer.cs
214 |
215 |
216 |
217 |
218 |
219 | SettingsSingleFileGenerator
220 | Settings.Designer.cs
221 |
222 |
223 |
224 |
225 | Designer
226 |
227 |
228 |
229 |
230 |
231 | Always
232 |
233 |
234 |
235 |
236 |
237 | False
238 | Microsoft .NET Framework 4.6.1 %28x86 and x64%29
239 | true
240 |
241 |
242 | False
243 | .NET Framework 3.5 SP1
244 | false
245 |
246 |
247 |
248 |
249 | {F8937E53-D444-4E71-9275-35B64210CC3B}
250 | 1
251 | 0
252 | 0
253 | tlbimp
254 | False
255 | True
256 |
257 |
258 |
259 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/GateKeeper.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Owin.Hosting;
2 | using System;
3 | using System.Diagnostics;
4 | using System.Net;
5 | using System.Net.Http;
6 | using System.Net.Sockets;
7 |
8 | /**
9 | Copyright [2019] [Terence Doerksen]
10 |
11 | Licensed under the Apache License, Version 2.0 (the "License");
12 | you may not use this file except in compliance with the License.
13 | You may obtain a copy of the License at
14 |
15 | http://www.apache.org/licenses/LICENSE-2.0
16 |
17 | Unless required by applicable law or agreed to in writing, software
18 | distributed under the License is distributed on an "AS IS" BASIS,
19 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 | See the License for the specific language governing permissions and
21 | limitations under the License.
22 | */
23 | namespace GameInputCommandSystem
24 | {
25 | public class GateKeeper
26 | {
27 | private IDisposable app;
28 | private HttpClient client;
29 |
30 | public string Address
31 | {
32 | get
33 | {
34 | return GICValues.Instance.Address;
35 | }
36 | set
37 | {
38 | GICValues.Instance.Address = value;
39 | }
40 | }
41 |
42 | public int Port
43 | {
44 | get
45 | {
46 | return GICValues.Instance.Port;
47 | }
48 | set
49 | {
50 | GICValues.Instance.Port = value;
51 | }
52 | }
53 |
54 | public string Password
55 | {
56 | get
57 | {
58 | return GICValues.Instance.Password;
59 | }
60 | set
61 | {
62 | GICValues.Instance.Password = value;
63 | }
64 | }
65 | public string Application
66 | {
67 | get
68 | {
69 | return GICValues.Instance.Application;
70 | }
71 | set
72 | {
73 | GICValues.Instance .Application = value;
74 | }
75 | }
76 |
77 | public bool Start()
78 | {
79 | CheckFirewall(Port);
80 | string baseAddress = "http://" + "*" + ":" + Port + "/";
81 |
82 | // Start our OWIN hosting
83 | app = WebApp.Start(url: baseAddress);
84 | client = new HttpClient();
85 | return true;
86 | }
87 |
88 | private void CheckFirewall(int port)
89 | {
90 | foreach (IPAddress address in Dns.GetHostEntry(Dns.GetHostName()).AddressList)
91 | {
92 | IPEndPoint ipLocalEndPoint = new IPEndPoint(address, Port);
93 |
94 | TcpListener t = new TcpListener(ipLocalEndPoint);
95 | t.Start();
96 | t.Stop();
97 | }
98 | }
99 |
100 | private Process FindProcess()
101 | {
102 | Process[] procs = Process.GetProcesses();
103 |
104 | foreach (Process proc in procs)
105 | {
106 | if (proc.MainWindowTitle == GICValues.Instance.Application)
107 | return proc;
108 | }
109 |
110 | return null;
111 | }
112 |
113 | public void Stop()
114 | {
115 | app.Dispose();
116 | client.Dispose();
117 | }
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 |
2 | // This file is used by Code Analysis to maintain SuppressMessage
3 | // attributes that are applied to this project.
4 | // Project-level suppressions either have no target or are given
5 | // a specific target and scoped to a namespace, type, member, etc.
6 |
7 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "", Scope = "member", Target = "~M:GameInputCommandSystem.MainWindow.btnStart_Click(System.Object,System.Windows.RoutedEventArgs)")]
--------------------------------------------------------------------------------
/GameInputCommandSystem/KeyMaster.cs:
--------------------------------------------------------------------------------
1 | using AutoIt;
2 | using GameInputCommandSystem.Models;
3 | using System;
4 | using System.Windows;
5 |
6 | /**
7 | Copyright [2019] [Terence Doerksen]
8 |
9 | Licensed under the Apache License, Version 2.0 (the "License");
10 | you may not use this file except in compliance with the License.
11 | You may obtain a copy of the License at
12 |
13 | http://www.apache.org/licenses/LICENSE-2.0
14 |
15 | Unless required by applicable law or agreed to in writing, software
16 | distributed under the License is distributed on an "AS IS" BASIS,
17 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | See the License for the specific language governing permissions and
19 | limitations under the License.
20 | */
21 | namespace GameInputCommandSystem
22 | {
23 | public static class KeyMaster
24 | {
25 | static volatile object locker = new Object();
26 |
27 | public static bool SendCommand(Command command, bool quickCommand)
28 | {
29 | lock (locker)
30 | {
31 | //long sec = DateTime.Now.Second;
32 | //Console.WriteLine("starting command for " + command.Key + " " + sec);
33 | int rv = 0;
34 | try
35 | {
36 | rv = AutoItX.WinWaitActive(GICValues.Instance.Application);
37 | }
38 | catch (Exception e)
39 | {
40 | //MessageBox.Show(e.Message);
41 | return false;
42 | }
43 | if (rv == 0)
44 | {
45 | return false;
46 | }
47 | else
48 | {
49 | if (command.activatorType == Command.KEY_DOWN)
50 | {
51 | //if any modifiers, send them first
52 | foreach (string modifier in command.Modifier)
53 | {
54 | AutoItX.Send("{" + modifier + "DOWN}");
55 | }
56 | //now send the key itself
57 | AutoItX.Send("{" + command.Key + " down}");
58 | if (quickCommand)
59 | {
60 | //keep everything pressed for 10ms
61 | System.Threading.Thread.Sleep(10);
62 | AutoItX.Send("{" + command.Key + " up}");
63 | //if any modifiers, unset them last
64 | foreach (string modifier in command.Modifier)
65 | {
66 | AutoItX.Send("{" + modifier + "UP}");
67 | }
68 | }
69 | }
70 | else if (command.activatorType == Command.KEY_UP && !quickCommand )
71 | {
72 | AutoItX.Send("{" + command.Key + " up}");
73 | //if any modifiers, unset them last
74 | foreach (string modifier in command.Modifier)
75 | {
76 | AutoItX.Send("{" + modifier + "UP}");
77 | }
78 | }
79 | //Console.WriteLine("ending command for " + command.Key + " " + sec);
80 | }
81 | return true;
82 | }
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Models/Command.cs:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright [2019] [Terence Doerksen]
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | namespace GameInputCommandSystem.Models
17 | {
18 | public class Command
19 | {
20 | public const int KEY_DOWN = 0;
21 | public const int KEY_UP = 1;
22 |
23 | public string Key { get; set; }
24 | public string[] Modifier { get; set; }
25 | public int activatorType {get;set;}
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("GameInputCommandSystem")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("Coffee Shop Studio")]
14 | [assembly: AssemblyProduct("GameInputCommandSystem")]
15 | [assembly: AssemblyCopyright("Copyright © 2019")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("2.0.0.0")]
55 | [assembly: AssemblyFileVersion("2.0.0.0")]
56 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GameInputCommandSystem.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GameInputCommandSystem.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GameInputCommandSystem.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("")]
29 | public string target {
30 | get {
31 | return ((string)(this["target"]));
32 | }
33 | set {
34 | this["target"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
41 | public int port {
42 | get {
43 | return ((int)(this["port"]));
44 | }
45 | set {
46 | this["port"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("")]
53 | public string password {
54 | get {
55 | return ((string)(this["password"]));
56 | }
57 | set {
58 | this["password"] = value;
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 0
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Startup.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using Newtonsoft.Json.Serialization;
3 | using Owin;
4 | using Swashbuckle.Application;
5 | using System.Collections.Generic;
6 | using System.Net.Http.Formatting;
7 | using System.Net.Http.Headers;
8 | using System.Security.Claims;
9 | using System.Threading.Tasks;
10 | using System.Web.Http;
11 | using Thinktecture.IdentityModel.Owin;
12 |
13 | /**
14 | Copyright [2019] [Terence Doerksen]
15 |
16 | Licensed under the Apache License, Version 2.0 (the "License");
17 | you may not use this file except in compliance with the License.
18 | You may obtain a copy of the License at
19 |
20 | http://www.apache.org/licenses/LICENSE-2.0
21 |
22 | Unless required by applicable law or agreed to in writing, software
23 | distributed under the License is distributed on an "AS IS" BASIS,
24 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 | See the License for the specific language governing permissions and
26 | limitations under the License.
27 | */
28 | namespace GameInputCommandSystem
29 | {
30 | class Startup
31 | {
32 | // Configures the Web API. This class is a parameter in the WerbApp.Start method in the main class.
33 | public void Configuration(IAppBuilder appBuilder)
34 | {
35 | // Configure Web API for self-host.
36 | HttpConfiguration config = new HttpConfiguration();
37 | config.Routes.MapHttpRoute(
38 | name: "DefaultApi",
39 | routeTemplate: "api/{controller}/{id}",
40 | defaults: new { id = RouteParameter.Optional }
41 | );
42 | appBuilder.UseBasicAuthentication(new BasicAuthenticationOptions("SecureApi",
43 | async (username, password) => await Authenticate(username, password)));
44 |
45 | //Tell swagger to generate documentation based on the XML doc file output from msbuild
46 | config.EnableSwagger(c =>
47 | {
48 | c.IncludeXmlComments("GameInputCommandSystem.xml");
49 | c.SingleApiVersion("1.0", "Owin Swashbuckle Demo");
50 | }).EnableSwaggerUi();
51 |
52 | appBuilder.UseWebApi(config);
53 | }
54 | private async Task> Authenticate(string username, string password)
55 | {
56 | // authenticate user
57 | if (username == "gic" && password == Properties.Settings.Default.password)
58 | {
59 | return new List {
60 | new Claim("name", username)
61 | };
62 | }
63 |
64 | return null;
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Views/About.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | This software makes use of the cross platform encryption library by Mataprasad licensed under the MIT License. See below for details
23 |
24 |
25 | License
26 |
27 |
28 |
29 |
30 | This software and the GIC Server are open source products used to act as a remote control style device for your PC. Copyright 2019 Terry Doerksen
31 |
32 |
33 | Apache 2.0 License
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Views/About.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace GameInputCommandSystem.Views
17 | {
18 | ///
19 | /// Interaction logic for About.xaml
20 | ///
21 | public partial class About : Window
22 | {
23 | public About()
24 | {
25 | InitializeComponent();
26 | txtVersion.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
27 | }
28 |
29 | private void Button_Click(object sender, RoutedEventArgs e)
30 | {
31 | this.Close();
32 | }
33 |
34 | private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
35 | {
36 | Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
37 | e.Handled = true;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Views/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/Views/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using CrossPlatformAESEncryption.Helper;
2 | using GameInputCommandSystem.Views;
3 | using System;
4 | using System.Windows;
5 |
6 | /**
7 | Copyright [2019] [Terence Doerksen]
8 |
9 | Licensed under the Apache License, Version 2.0 (the "License");
10 | you may not use this file except in compliance with the License.
11 | You may obtain a copy of the License at
12 |
13 | http://www.apache.org/licenses/LICENSE-2.0
14 |
15 | Unless required by applicable law or agreed to in writing, software
16 | distributed under the License is distributed on an "AS IS" BASIS,
17 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | See the License for the specific language governing permissions and
19 | limitations under the License.
20 | */
21 | namespace GameInputCommandSystem
22 | {
23 | ///
24 | /// Interaction logic for MainWindow.xaml
25 | ///
26 | public partial class MainWindow : Window
27 | {
28 | //private MainController controller;
29 | private static GateKeeper server = new GateKeeper();
30 | private bool isRunning = false;
31 |
32 | public MainWindow()
33 | {
34 | InitializeComponent();
35 | LoadSettings();
36 | }
37 |
38 | private void btnStart_Click(object sender, RoutedEventArgs e)
39 | {
40 | if (txtPassword.Password.Length < 6)
41 | System.Windows.MessageBox.Show("Please use a password at least 6 characters long.");
42 | else if (txtTarget.Text.Length <= 0)
43 | {
44 | System.Windows.MessageBox.Show("Ensure you set the target of the application you want to send commands to.");
45 | }
46 | else {
47 | int port = Int16.Parse(txtPort.Text);
48 | SetApplication(txtTarget.Text);
49 | SetPassword(txtPassword.Password);
50 | SetPort(port);
51 | ToggleServer();
52 | SaveSettings(txtTarget.Text, txtPassword.Password, port);
53 | }
54 | }
55 |
56 | private void LoadSettings()
57 | {
58 | txtTarget.Items.Add("Star Citizen");
59 | txtTarget.Items.Add("Elite - Dangerous (CLIENT)");
60 | txtTarget.Text = Properties.Settings.Default.target;
61 | if (txtTarget.Text == "")
62 | txtTarget.Text = "Star Citizen";
63 | if (Properties.Settings.Default.password.Length > 5)
64 | txtPassword.Password = CryptoHelper.Decrypt(Properties.Settings.Default.password);
65 | int port = Properties.Settings.Default.port;
66 | if (port == 0)
67 | port = 8091;
68 | txtPort.Text = port.ToString();
69 | }
70 |
71 | private void SaveSettings(string target, string password, int port)
72 | {
73 | Properties.Settings.Default.target = target;
74 | String encrypted = CryptoHelper.Encrypt(password);
75 | Properties.Settings.Default.password = encrypted;
76 | Properties.Settings.Default.port = port;
77 | Properties.Settings.Default.Save();
78 | }
79 |
80 | private void ToggleServer()
81 | {
82 | if (isRunning)
83 | {
84 | server.Stop();
85 | isRunning = !isRunning;
86 | txtPassword.IsEnabled = true;
87 | txtPort.IsEnabled = true;
88 | txtTarget.IsEnabled = true;
89 | }
90 | else
91 | {
92 | isRunning = server.Start();
93 | txtPassword.IsEnabled = false;
94 | txtPort.IsEnabled = false;
95 | txtTarget.IsEnabled = false;
96 | }
97 | toggleText();
98 | }
99 |
100 | private void toggleText()
101 | {
102 | if (!isRunning)
103 | btnStart.Content = "Start";
104 | else
105 | btnStart.Content = "Stop";
106 | }
107 |
108 | internal void SetPort(int newPort)
109 | {
110 | server.Port = newPort;
111 | }
112 |
113 | internal void SetPassword(string text)
114 | {
115 | server.Password = text;
116 | }
117 |
118 | internal void SetApplication(string text)
119 | {
120 | server.Application = text;
121 | }
122 |
123 | private void Button_Click(object sender, RoutedEventArgs e)
124 | {
125 | About window = new About();
126 | window.Show();
127 | }
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/app.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Terence-D/GameInputCommandServer/5b8d8f556b600ea0858da890342568e5947468d1/GameInputCommandSystem/app.ico
--------------------------------------------------------------------------------
/GameInputCommandSystem/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
48 |
55 |
56 |
70 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/license-autoit.txt:
--------------------------------------------------------------------------------
1 | https://www.autoitscript.com/autoit3/docs/license.htm
2 |
3 |
4 | Software License
5 |
6 | AutoIt
7 |
8 | Author : Jonathan Bennett and the AutoIt Team
9 | WWW : https://www.autoitscript.com/site/autoit/
10 | Email : support at autoitscript dot com
11 | ________________________________________________________
12 |
13 | END-USER LICENSE AGREEMENT FOR THIS SOFTWARE
14 |
15 | This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and the mentioned author of this Software for the software product identified above, which includes computer software and may include associated media, printed materials, and "online" or electronic documentation ("SOFTWARE PRODUCT"). By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, do not install or use the SOFTWARE PRODUCT.
16 |
17 |
18 |
19 | SOFTWARE PRODUCT LICENSE
20 |
21 | The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.
22 |
23 | The definition of SOFTWARE PRODUCT does not includes any files generated by the SOFTWARE PRODUCT, such as compiled script files in the form of standalone executables.
24 |
25 | 1. GRANT OF LICENSE
26 |
27 | This EULA grants you the following rights:
28 |
29 | Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.
30 |
31 | Reproduction and Distribution. You may reproduce and distribute an unlimited number of copies of the SOFTWARE PRODUCT either in whole or in part; each copy should include all copyright and trademark notices, and shall be accompanied by a copy of this EULA. Copies of the SOFTWARE PRODUCT may be distributed as a standalone product or included with your own product.
32 |
33 | Commercial Use. You may use the SOFTWARE PRODUCT for commercial purposes. You may sell for profit and freely distribute scripts and/or compiled scripts that were created with the SOFTWARE PRODUCT.
34 |
35 | Reverse engineering. You may not reverse engineer or disassemble the SOFTWARE PRODUCT.
36 |
37 | 2. COPYRIGHT
38 |
39 | All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by the Author of this Software. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material.
40 |
41 |
42 |
43 | MISCELLANEOUS
44 |
45 | If you acquired this product in the United Kingdom, this EULA is governed by the laws of the United Kingdom. If this product was acquired outside the United Kingdom, then local law may apply.
46 |
47 | Should you have any questions concerning this EULA, or if you desire to contact the author of this Software for any reason, please contact him/her at the email address mentioned at the top of this EULA.
48 |
49 |
50 |
51 | LIMITED WARRANTY
52 |
53 | 1. NO WARRANTIES
54 |
55 | The Author of this Software expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.
56 |
57 | 2. NO LIABILITY FOR DAMAGES
58 |
59 | In no event shall the author of this Software be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if the Author of this Software has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.
60 |
61 |
62 |
63 | [END OF LICENSE]
64 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/GameInputCommandSystem/utils/CryptoHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Security.Cryptography;
4 |
5 | //https://github.com/mataprasad/Cross-platform-AES-encryption-128bit
6 |
7 | /**
8 | * MIT License
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 | **/
28 | namespace CrossPlatformAESEncryption.Helper
29 | {
30 | public class CryptoHelper
31 | {
32 | private const string SECRET_KEY = "5MOujLrJUpjIEqLg";//16 char secret key
33 |
34 | public static string Decrypt(string textToDecrypt)
35 | {
36 | RijndaelManaged rijndaelCipher = new RijndaelManaged();
37 | rijndaelCipher.Mode = CipherMode.CBC;
38 | rijndaelCipher.Padding = PaddingMode.PKCS7;
39 |
40 | rijndaelCipher.KeySize = 0x80;
41 | rijndaelCipher.BlockSize = 0x80;
42 | byte[] encryptedData = Convert.FromBase64String(textToDecrypt);
43 | byte[] pwdBytes = Encoding.UTF8.GetBytes(SECRET_KEY);
44 | byte[] keyBytes = new byte[0x10];
45 | int len = pwdBytes.Length;
46 | if (len > keyBytes.Length)
47 | {
48 | len = keyBytes.Length;
49 | }
50 | Array.Copy(pwdBytes, keyBytes, len);
51 | rijndaelCipher.Key = keyBytes;
52 | rijndaelCipher.IV = keyBytes;
53 | byte[] plainText = rijndaelCipher.CreateDecryptor().TransformFinalBlock(encryptedData, 0, encryptedData.Length);
54 | return Encoding.UTF8.GetString(plainText);
55 | }
56 |
57 | public static string Encrypt(string textToEncrypt)
58 | {
59 | RijndaelManaged rijndaelCipher = new RijndaelManaged();
60 | rijndaelCipher.Mode = CipherMode.CBC;
61 | rijndaelCipher.Padding = PaddingMode.PKCS7;
62 |
63 | rijndaelCipher.KeySize = 0x80;
64 | rijndaelCipher.BlockSize = 0x80;
65 | byte[] pwdBytes = Encoding.UTF8.GetBytes(SECRET_KEY);
66 | byte[] keyBytes = new byte[0x10];
67 | int len = pwdBytes.Length;
68 | if (len > keyBytes.Length)
69 | {
70 | len = keyBytes.Length;
71 | }
72 | Array.Copy(pwdBytes, keyBytes, len);
73 | rijndaelCipher.Key = keyBytes;
74 | rijndaelCipher.IV = keyBytes;
75 | ICryptoTransform transform = rijndaelCipher.CreateEncryptor();
76 | byte[] plainText = Encoding.UTF8.GetBytes(textToEncrypt);
77 | return Convert.ToBase64String(transform.TransformFinalBlock(plainText, 0, plainText.Length));
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NEW LINK New Version 2.0 alpha - NEW LINK
2 | https://github.com/Terence-D/GamingInterfaceCommandServer
3 |
4 | Started a new repo as this is a full rewrite - same license and same features as the old verison, just switching to a multi project Net Core project to eventually make it cross platform (half of it technically already is in its current form)
5 |
6 | # Gaming Input Command Server (Windows)
7 | Windows server for the Gaming Interface Client
8 |
9 | ## Guide
10 | https://github.com/Terence-D/GameInputCommandServer/wiki
11 |
12 | ## Description
13 | This is part of a two app system that allows the use of a remote device (Tablet or Phone) to provide input into a PC game or application. This software is the Windows Server and runs on your Windows PC. It talks to GIC for Android - https://github.com/Terence-D/GamingInterfaceClientAndroid/wiki and will accept commands from it and pass it off to whatever application or game you have set it for. For example if you play a space simulator, you can add custom buttons for Comms, Warp Drive, Power control, etc and have it accessible at your fingertips without remembering complex keystrokes.
14 |
15 | ## Features
16 | * Open Source and Free!
17 | * Simple http based connection, making it easy for people to write their own clients
18 | * Supports multiple devices connecting to the server. Use one Tablet for your ship Systems, another for Comms!
19 | * Supports practically any game
20 | * More features to be worked on!
21 |
22 | Check the Wiki link at the top for more information on how to use. Any issues please add to the Issue tracker, or contact me at support [ a]t coffeeshopstudio.ca
23 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-slate
--------------------------------------------------------------------------------