2

我想将java程序连接到LSL。我在SL中有很多传感器。我想通过java程序为这些传感器提供真实世界的读数,即来自外部SL的输入。这可能吗?如果可能,那么如何。请帮助我。如果我提供的信息不充分,请询问我并尝试帮助我。

4

2 回答 2

0

这绝对是可能的。我建议将您的 Java 应用程序作为服务器运行,并让 SL 对象使用http_request定期轮询它。或者您可以让您的外部 Java 应用程序使用 HTTP 请求来调用您的 SL 对象,但前者要简单得多。

PS 正如 Sascha 所说,XML-RPC 也是可能的,而且使用起来更简单一些,但 Linden Lab 建议尽可能使用 LSL HTTP,因为它可以更好地扩展并且更可靠。

于 2016-08-06T09:46:06.147 回答
0

The only way I know would work via requests and two-way communication and could be implemented easily with XML Remote Procedure Calls.

XML-RPC is a standard for sending Procedure Calls (e.g. function calls) to Remote systems. It sends XML data over HTTP that remote system then handles.

LSL receives XML-RPC requests and passes them to the prim specified. It may not establish this connection, but it may reply and keep two-way communication with that server. These responses seem to be able to transport the largest amount of data out of Second Life (vs. Email and HTTP Requests).

Quoted from LSL XML-RPC - Second Life Wiki, what you want is the Java-Snippet on this page.

于 2016-08-04T19:24:02.003 回答