feat: send Login Disconnect with custom message on blocked join
Previously a blocked join just dropped the socket, so the MC client showed 'Internal Exception: SocketException: Connection reset'. Now when next_state=2 (login), the proxy sends a proper Login Disconnect (0x00) packet containing a JSON chat component, and the client displays the message on its disconnect screen. - block_message added to config (default Korean message); editable in Settings UI as a textarea - build_login_disconnect() encodes (varint length)+(0x00)+(JSON str) - Status/ping (next_state=1) still silently dropped so the proxy presence is not announced to scanners - Backward-compat: load_config() backfills block_message on old files
This commit is contained in:
@@ -51,6 +51,23 @@ export default function Settings() {
|
||||
프록시 활성화
|
||||
</label>
|
||||
</section>
|
||||
<section className="card">
|
||||
<h2>차단 메시지</h2>
|
||||
<label>
|
||||
허용되지 않은 도메인으로 접속 시도 시 마인크래프트 클라이언트에 보여줄 메시지
|
||||
<textarea
|
||||
rows={2}
|
||||
value={cfg.block_message ?? ''}
|
||||
onChange={(e) =>
|
||||
setCfg({ ...cfg, block_message: e.target.value })
|
||||
}
|
||||
placeholder="이 서버는 허용된 도메인에서만 접속 가능합니다."
|
||||
/>
|
||||
<span className="muted">
|
||||
로그인(join) 시도에만 적용됩니다. 서버 리스트 핑은 그냥 응답을 차단합니다.
|
||||
</span>
|
||||
</label>
|
||||
</section>
|
||||
<section className="card">
|
||||
<h2>백엔드 (실제 MC 서버)</h2>
|
||||
<label>
|
||||
|
||||
@@ -159,7 +159,8 @@ button.mt { margin-top: 12px; }
|
||||
input:disabled { opacity: 0.7; cursor: not-allowed; }
|
||||
|
||||
input,
|
||||
select {
|
||||
select,
|
||||
textarea {
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
@@ -168,8 +169,15 @@ select {
|
||||
font-size: 14px;
|
||||
font-family: inherit;
|
||||
}
|
||||
textarea {
|
||||
width: 100%;
|
||||
max-width: 520px;
|
||||
resize: vertical;
|
||||
margin-top: 4px;
|
||||
}
|
||||
input:focus,
|
||||
select:focus {
|
||||
select:focus,
|
||||
textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user