Warning: session_start(): open(/var/lib/php/sessions/sess_fid7hvo92kc80umbdg58k9hott, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
sclass OSChat extends DynPrintLog {
S msg;
bool sign;
transient StefansOS_ConnectToServer connector;
visualize {
ret centerAndSouthWithMargins(
super.visualize(),
centerAndEastWithMargin(withLabel("Talk to everyone:", onEnter(jLiveValueTextField_bothWays(dm_fieldLiveValue('msg)), rThread sendMsg)),
centerAndEastWithMargin(jLiveValueCheckBox("Sign", dm_fieldLiveValue('sign)), jbutton("Send", rThread sendMsg))));
}
void sendMsg {
postMsg(trim(msg), sign);
}
void postSigned(S msg) {
postMsg(msg, true);
}
void postMsg(S msg, bool sign) {
S msg = trim(msg);
if (empty(msg)) ret;
if (sign) msg = signWithComputerIDAndDate(msg);
logQuotedWithDate(javaxDataDir("OS Chat/sent.log"), msg);
print("Sending to chat: " + msg);
connector.sendLine("chat: " + quote(msg));
}
void cleanMeUp {
cleanUp(connector);
}
start {
connector = new StefansOS_ConnectToServer;
connector.onLine = voidfunc(S line) {
new Matches m;
if (startsWith(line, "chat:", m)) {
S msg = unquote(m.rest());
printWithIndent("<< ", msg);
logQuotedWithDate(stefansOS_chat_receivedLogFile(), msg);
}
};
connector.startWithSubs("chat");
}
}