Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Controlling EmuHawk through Websocket Server and passthrough for Lua #4156

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1fb1be1
rename WebSocketServer to WebSocketClient
austinmilt Dec 1, 2024
278116f
add minimal websocket server with cli configs
austinmilt Dec 1, 2024
2d02269
websocket message types with topics echo, error, registration
austinmilt Dec 2, 2024
7050cb5
null enable flags
austinmilt Dec 3, 2024
f8d7ed3
fix serialization of error enum
austinmilt Dec 4, 2024
a04072f
revert formatting changes
austinmilt Dec 5, 2024
c3b1cce
revert formatting changes
austinmilt Dec 5, 2024
c998719
get input options request
austinmilt Dec 6, 2024
c16c51c
minimal inputs
austinmilt Dec 6, 2024
423f6e9
add request ID to single-client messages
austinmilt Dec 26, 2024
331ed0d
toggle sticky state in StickyController
austinmilt Dec 26, 2024
bb19d92
emulator speed change message
austinmilt Dec 26, 2024
fa19719
reboot core message
austinmilt Dec 26, 2024
fb77cf8
fix DecreaseSpeed
austinmilt Dec 27, 2024
b83673e
support setting button toggles
austinmilt Dec 27, 2024
c56c809
add save state command
austinmilt Dec 27, 2024
0f7a58f
improve input processing
austinmilt Dec 29, 2024
61fb786
fix sending request ID in emulator command response
austinmilt Dec 29, 2024
b96e99c
lock concurrent stick access
austinmilt Dec 30, 2024
c1bde68
custom topic messaging
austinmilt Jan 1, 2025
14ba2d2
hooking up handlers to lua
austinmilt Jan 1, 2025
a2fd4d0
add optional request ID to custom topics
austinmilt Jan 1, 2025
e447bdf
cleanup websockets a little
austinmilt Jan 1, 2025
e04103e
add custom topic broadcast registration
austinmilt Jan 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add optional request ID to custom topics
  • Loading branch information
austinmilt committed Jan 1, 2025
commit a2fd4d0eb4194a0379fcb63a1d59b677879ac461
26 changes: 23 additions & 3 deletions src/BizHawk.Client.Common/websocket/messages/Custom.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

namespace BizHawk.Client.Common.Websocket.Messages
{
/// <summary>
Expand All @@ -9,6 +11,11 @@ namespace BizHawk.Client.Common.Websocket.Messages
public struct CustomRequestMessage
{

/// <summary>
/// Optional request ID, which the websocket server will forward on to custom handlers
/// </summary>
public string? RequestId { get; set; }

/// <summary>
/// Sub-topic defined by the custom handler.
/// </summary>
Expand All @@ -20,10 +27,14 @@ public struct CustomRequestMessage
/// </summary>
public string Message { get; set; }

public CustomRequestMessage() { }
public CustomRequestMessage() {
SubTopic = "";
Message = "";
}

public CustomRequestMessage(string subTopic, string message)
public CustomRequestMessage(string? requestId, string subTopic, string message)
{
RequestId = requestId;
SubTopic = subTopic;
Message = message;
}
Expand All @@ -37,6 +48,12 @@ public CustomRequestMessage(string subTopic, string message)
/// <seealso cref="CustomRequestMessage"/>
public struct CustomResponseMessage
{

/// <summary>
/// Optional request ID, which a custom handler may use to identify responses to clients
/// </summary>
public string? RequestId { get; set; }

/// <summary>
/// Sub-topic defined by the custom handler.
/// </summary>
Expand All @@ -48,7 +65,10 @@ public struct CustomResponseMessage
/// </summary>
public string Message { get; set; }

public CustomResponseMessage() { }
public CustomResponseMessage() {
SubTopic = "";
Message = "";
}

public CustomResponseMessage(string subTopic, string message)
{
Expand Down