feat: F4.6g1 the echo server and the generic client windows
Oracle EchoWindowRun uses Java's echo server and client windows as a person does; SaveAfterRunRun echo saves what Java keeps after the run. The room takes setActive with a port, connect/disconnect/send, sends both views and writes the server's port and the client's target back. The editor's windows show Java's buttons, fields and lines; a port that is no port is marked and not handed over (Java's button throws). Core fix: an empty message (one empty segment with the push, as Java's erstelleSegmente makes) counted as a repeat and never arrived. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
// A server's lines as Java's server windows write them (ServerAnwendung,
|
||||
// ServerMitarbeiter, TCPSocket's failures), in the person's language: one
|
||||
// line each, as Java appends them to its window's text area.
|
||||
// ServerMitarbeiter, TCPSocket's failures), and the generic client's as its
|
||||
// window writes them (ClientBaustein, Socket, TCPSocket), in the person's
|
||||
// language: one line each (a failed connection two), as Java appends them to
|
||||
// its window's text area.
|
||||
|
||||
import type { ServerLogEntry } from '@mdg-filius/core';
|
||||
import type { ServerLogEntry, SimpleClientLogEntry } from '@mdg-filius/core';
|
||||
import type { Translate } from '../i18n/i18n.js';
|
||||
|
||||
export function serverLine(entry: ServerLogEntry, t: Translate): string {
|
||||
@@ -23,3 +25,23 @@ export function serverLine(entry: ServerLogEntry, t: Translate): string {
|
||||
return t(`server.sendFailed.${entry.failure}`);
|
||||
}
|
||||
}
|
||||
|
||||
export function simpleClientLine(entry: SimpleClientLogEntry, t: Translate): string {
|
||||
switch (entry.kind) {
|
||||
case 'connected':
|
||||
case 'disconnected':
|
||||
case 'notConnected':
|
||||
case 'receiveFailed':
|
||||
return t(`simpleClient.${entry.kind}`);
|
||||
case 'connectFailed':
|
||||
return `${t('simpleClient.notConnected')}\n${t(`simpleClient.failure.${entry.failure}`)}`;
|
||||
case 'connectionClosed':
|
||||
return t('simpleClient.connectionClosed', { address: `${entry.address}:${entry.port}` });
|
||||
case 'received':
|
||||
return `>>${entry.text}`;
|
||||
case 'sent':
|
||||
return `<<${entry.text}`;
|
||||
case 'sendFailed':
|
||||
return t(`server.sendFailed.${entry.failure}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user