Document socket response format
This commit is contained in:
parent
afccbe8aa6
commit
de1e7eef69
|
@ -71,6 +71,9 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public string GetInfo() => $"{_targetAddr.HostIP}:{_targetAddr.Port}";
|
public string GetInfo() => $"{_targetAddr.HostIP}:{_targetAddr.Port}";
|
||||||
|
|
||||||
|
/// <remarks>
|
||||||
|
/// Since BizHawk 2.6.2, all responses must be of the form <c>$"{msg.Length:D} {msg}"</c> i.e. prefixed with the length in base-10 and a space.
|
||||||
|
/// </remarks>
|
||||||
public string ReceiveString(Encoding encoding = null)
|
public string ReceiveString(Encoding encoding = null)
|
||||||
{
|
{
|
||||||
if (!Connected)
|
if (!Connected)
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace BizHawk.Client.Common
|
||||||
return APIs.Comm.Sockets.SendBytes(_th.EnumerateValues<double>(byteArray).Select(d => (byte) d).ToArray());
|
return APIs.Comm.Sockets.SendBytes(_th.EnumerateValues<double>(byteArray).Select(d => (byte) d).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
[LuaMethod("socketServerResponse", "receives a message from the Socket server")]
|
[LuaMethod("socketServerResponse", "Receives a message from the Socket server. Since BizHawk 2.6.2, all responses must be of the form $\"{msg.Length:D} {msg}\" i.e. prefixed with the length in base-10 and a space.")]
|
||||||
[return: LuaArbitraryStringParam]
|
[return: LuaArbitraryStringParam]
|
||||||
public string SocketServerResponse()
|
public string SocketServerResponse()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue