<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://ja.lfsmanual.net/index.php?action=history&amp;feed=atom&amp;title=InSim_Relay</id>
	<title>InSim Relay - 変更履歴</title>
	<link rel="self" type="application/atom+xml" href="https://ja.lfsmanual.net/index.php?action=history&amp;feed=atom&amp;title=InSim_Relay"/>
	<link rel="alternate" type="text/html" href="https://ja.lfsmanual.net/index.php?title=InSim_Relay&amp;action=history"/>
	<updated>2026-05-03T00:20:06Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://ja.lfsmanual.net/index.php?title=InSim_Relay&amp;diff=2464&amp;oldid=prev</id>
		<title>Skylinekakkoii: 英版コピー</title>
		<link rel="alternate" type="text/html" href="https://ja.lfsmanual.net/index.php?title=InSim_Relay&amp;diff=2464&amp;oldid=prev"/>
		<updated>2017-06-09T15:30:14Z</updated>

		<summary type="html">&lt;p&gt;英版コピー&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== InSim Relay の用途 ==&lt;br /&gt;
The InSim Relay is a service that can connect to your LFS host via InSim and relay the InSim information sent by your host, to anyone who connects to the InSim Relay. This relayed data can be used by programmers for various things, such as the LFS Remote (remote viewing / adminning of a race) and race-tracking to store race information and statistics.&lt;br /&gt;
&lt;br /&gt;
To have your host connected to the Relay, see this page on LFS World:&lt;br /&gt;
http://www.lfsworld.net/?win=hosts&amp;amp;whichTab=insim_relay&lt;br /&gt;
&lt;br /&gt;
The rest of this document is only for programmers who want to know how to connect to the InSim Relay, so they can make use of the available data.&lt;br /&gt;
&lt;br /&gt;
Source file information: [[InSim Relay source]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== InSim Relay に接続する ===&lt;br /&gt;
The Relay code below can be seen as an extension to the regular InSim protocol, as the packets are constructed in the same manner as regular InSim packets and use their own identifiers.&lt;br /&gt;
&lt;br /&gt;
Connect your client to isrelay.lfs.net:47474 with TCP. After you are connected you can request a list of hosts, so you can see which hosts you can connect to. Then you can send a packet to the Relay to select a host. After that the Relay will send you all insim data from that host.&lt;br /&gt;
&lt;br /&gt;
Some hosts require a spectator password in order to be selectable.&lt;br /&gt;
&lt;br /&gt;
You do not need to specify a spectator password if you use a valid administrator password.&lt;br /&gt;
&lt;br /&gt;
If you connect with an administrator password, you can send just about every regular InSim packet there is available in LFS, just like as if you were connected to the host directly. For a full list, see end of document.&lt;br /&gt;
&lt;br /&gt;
=== InSim Relay に使われているパケットタイプ ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define IRP_ARQ		250	// Send : request if we are host admin (after connecting to a host)&lt;br /&gt;
#define IRP_ARP		251	// Receive : replies if you are admin (after connecting to a host)&lt;br /&gt;
#define IRP_HLR		252	// Send : To request a hostlist&lt;br /&gt;
#define IRP_HOS		253	// Receive : Hostlist info&lt;br /&gt;
#define IRP_SEL		254	// Send : To select a host&lt;br /&gt;
#define IRP_ERR		255	// Receive : An error number&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To request a hostlist from the Relay, send this packet :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct IR_HLR // HostList Request&lt;br /&gt;
{&lt;br /&gt;
	byte	Size;		// 4&lt;br /&gt;
	byte	Type;		// IRP_HLR&lt;br /&gt;
	byte	ReqI;&lt;br /&gt;
	byte	Sp0;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That will return (multiple) packets containing hostnames and some information about them&lt;br /&gt;
&lt;br /&gt;
The following struct is a sub packet of the IR_HOS packet&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct HInfo // Sub packet for IR_HOS. Contains host information&lt;br /&gt;
{&lt;br /&gt;
	char	HName[32];	// Name of the host&lt;br /&gt;
	&lt;br /&gt;
	char	Track[6];	// Short track name&lt;br /&gt;
	byte	Flags;		// Info flags about the host - see NOTE 1) below&lt;br /&gt;
	byte	NumConns;	// Number of people on the host&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// NOTE 1)&lt;br /&gt;
#define HOS_SPECPASS		1	// Host requires a spectator password&lt;br /&gt;
#define HOS_LICENSED		2	// Bit is set if host is licensed&lt;br /&gt;
#define HOS_S1		        4	// Bit is set if host is S1&lt;br /&gt;
#define HOS_S2		        8	// Bit is set if host is S2&lt;br /&gt;
#define HOS_FIRST               64	// info: http://www.lfsforum.net/showthread.php?p=1376118#post1376118&lt;br /&gt;
#define HOS_LAST                128	// info: http://www.lfsforum.net/showthread.php?p=1376118#post1376118&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct IR_HOS // Hostlist (hosts connected to the Relay)&lt;br /&gt;
{&lt;br /&gt;
	byte	Size;		// 4 + NumHosts * 40&lt;br /&gt;
	byte	Type;		// IRP_HOS&lt;br /&gt;
	byte	ReqI;		// As given in IR_HLR&lt;br /&gt;
	byte	NumHosts;	// Number of hosts described in this packet&lt;br /&gt;
&lt;br /&gt;
	HInfo	Info[6];	// Host info for every host in the Relay. 1 to 6 of these in a IR_HOS&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To select a host in the Relay, send this packet :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct IR_SEL // Relay select - packet to select a host, so relay starts sending you data.&lt;br /&gt;
{&lt;br /&gt;
	byte	Size;		// 68&lt;br /&gt;
	byte	Type;		// IRP_SEL&lt;br /&gt;
	byte	ReqI;		// If non-zero Relay will reply with an IS_VER packet&lt;br /&gt;
	byte	Zero;		// 0&lt;br /&gt;
&lt;br /&gt;
	char	HName[32];	// Hostname to receive data from - may be colourcode stripped&lt;br /&gt;
	char	Admin[16];	// Admin password (to gain admin access to host)&lt;br /&gt;
	char	Spec[16];	// Spectator password (if host requires it)&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To request if we are an admin send:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct IR_ARQ // Admin Request&lt;br /&gt;
{&lt;br /&gt;
    byte    Size;		// 4&lt;br /&gt;
    byte    Type;		// IRP_ARQ&lt;br /&gt;
    byte    ReqI;&lt;br /&gt;
    byte    Sp0;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Relay will reply to admin status request :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct IR_ARP // Admin Response&lt;br /&gt;
 {&lt;br /&gt;
	 byte	Size;		// 4&lt;br /&gt;
	 byte	Type;		// IRP_ARP&lt;br /&gt;
	 byte	ReqI;&lt;br /&gt;
	 byte	Admin;		// 0- no admin; 1- admin&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you specify a wrong value, like invalid packet / hostname / adminpass / specpass, the Relay returns an error packet :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct IR_ERR&lt;br /&gt;
{&lt;br /&gt;
	byte	Size;		// 4&lt;br /&gt;
	byte	Type;		// IRP_ERR&lt;br /&gt;
	byte	ReqI;		// As given in RL_SEL, otherwise 0&lt;br /&gt;
	byte	ErrNo;		// Error number - see NOTE 2) below&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// NOTE 2) Error numbers :&lt;br /&gt;
#define IR_ERR_PACKET1          1    // Invalid packet sent by client (wrong structure / length)&lt;br /&gt;
#define IR_ERR_PACKET2          2    // Invalid packet sent by client (packet was not allowed to be forwarded to host)&lt;br /&gt;
#define IR_ERR_HOSTNAME         3    // Wrong hostname given by client&lt;br /&gt;
#define IR_ERR_ADMIN            4    // Wrong admin pass given by client&lt;br /&gt;
#define IR_ERR_SPEC             5    // Wrong spec pass given by client&lt;br /&gt;
#define IR_ERR_NOSPEC           6    // Spectator pass required, but none given&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Regular insim packets that a relay client can send to host :&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For anyone&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_VER&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_PING&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_SCP&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_SST&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_GTH&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_ISM&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_NCN&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_NPL&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_RES&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_REO&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_RST&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_AXI&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Admin only&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_VTC&amp;lt;br&amp;gt;&lt;br /&gt;
ISP_MST&amp;lt;br&amp;gt;&lt;br /&gt;
ISP_MSX&amp;lt;br&amp;gt;&lt;br /&gt;
ISP_MSL&amp;lt;br&amp;gt;&lt;br /&gt;
ISP_MTC&amp;lt;br&amp;gt;&lt;br /&gt;
ISP_SCH&amp;lt;br&amp;gt;&lt;br /&gt;
ISP_BFN&amp;lt;br&amp;gt;&lt;br /&gt;
ISP_BTN&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The relay will also accept, but not forward&amp;lt;br&amp;gt;&lt;br /&gt;
TINY_NONE    // for relay-connection maintenance&lt;br /&gt;
&lt;br /&gt;
=== エスケープコードのリスト ===&lt;br /&gt;
&lt;br /&gt;
^v - |&amp;lt;br&amp;gt;&lt;br /&gt;
^a - *&amp;lt;br&amp;gt;&lt;br /&gt;
^c - :&amp;lt;br&amp;gt;&lt;br /&gt;
^d - \&amp;lt;br&amp;gt;&lt;br /&gt;
^s - /&amp;lt;br&amp;gt;&lt;br /&gt;
^q - ?&amp;lt;br&amp;gt;&lt;br /&gt;
^t - &amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
^l - &amp;lt;&amp;lt;br&amp;gt;&lt;br /&gt;
^r - &amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
^L = Latin 1 (CP1252)&amp;lt;br&amp;gt;&lt;br /&gt;
^G = Greek (ISO-8859-7)&amp;lt;br&amp;gt;&lt;br /&gt;
^C = Cyrillic (CP1251)&amp;lt;br&amp;gt;&lt;br /&gt;
^J = Japanese (Shift-JIS)&amp;lt;br&amp;gt;&lt;br /&gt;
^E = Central Europe (ISO-8859-2)&amp;lt;br&amp;gt;&lt;br /&gt;
^T = Turkish (ISO-8859-9)&amp;lt;br&amp;gt;&lt;br /&gt;
^B = Baltic (ISO-8859-13)&amp;lt;br&amp;gt;&lt;br /&gt;
^H = Traditional Chinese (CP936)&amp;lt;br&amp;gt;&lt;br /&gt;
^S = Simpified Chinese (CP949)&amp;lt;br&amp;gt;&lt;br /&gt;
^K = Korean (CP950)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
^0 - Black&amp;lt;br&amp;gt;&lt;br /&gt;
^1 - Red&amp;lt;br&amp;gt;&lt;br /&gt;
^2 - Light green&amp;lt;br&amp;gt;&lt;br /&gt;
^3 - Yellow&amp;lt;br&amp;gt;&lt;br /&gt;
^4 - Blue&amp;lt;br&amp;gt;&lt;br /&gt;
^5 - Purple&amp;lt;br&amp;gt;&lt;br /&gt;
^6 - Light blue&amp;lt;br&amp;gt;&lt;br /&gt;
^7 - White&amp;lt;br&amp;gt;&lt;br /&gt;
^8 - Dark green (default)&amp;lt;br&amp;gt;&lt;br /&gt;
^9 - Original text colour and codepage.&lt;br /&gt;
&lt;br /&gt;
{{Guides}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- 他言語へのリンク --&amp;gt;&lt;br /&gt;
[[en:InSim Relay]]&lt;br /&gt;
[[ru:InSim Relay]]&lt;/div&gt;</summary>
		<author><name>Skylinekakkoii</name></author>
	</entry>
</feed>