mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-04 14:25:43 +02:00
check loggin in instead
This commit is contained in:
parent
2b09a578a8
commit
a1a6f60d8d
2 changed files with 8 additions and 2 deletions
|
@ -151,7 +151,7 @@ export class Agent {
|
||||||
}
|
}
|
||||||
if (save_data?.last_sender) {
|
if (save_data?.last_sender) {
|
||||||
this.last_sender = save_data.last_sender;
|
this.last_sender = save_data.last_sender;
|
||||||
if (convoManager.isOtherAgent(this.last_sender)) {
|
if (convoManager.otherAgentInGame(this.last_sender)) {
|
||||||
const msg_package = {
|
const msg_package = {
|
||||||
message: `You have restarted and this message is auto-generated. Continue the conversation with me.`,
|
message: `You have restarted and this message is auto-generated. Continue the conversation with me.`,
|
||||||
start: true
|
start: true
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { sendBotChatToServer } from './agent_proxy.js';
|
||||||
|
|
||||||
let agent;
|
let agent;
|
||||||
let agent_names = settings.profiles.map((p) => JSON.parse(readFileSync(p, 'utf8')).name);
|
let agent_names = settings.profiles.map((p) => JSON.parse(readFileSync(p, 'utf8')).name);
|
||||||
|
let agents_in_game = [];
|
||||||
|
|
||||||
let self_prompter_paused = false;
|
let self_prompter_paused = false;
|
||||||
|
|
||||||
|
@ -68,7 +69,7 @@ class ConversationManager {
|
||||||
return; // will clean itself up
|
return; // will clean itself up
|
||||||
}
|
}
|
||||||
let cur_name = this.activeConversation.name;
|
let cur_name = this.activeConversation.name;
|
||||||
if (!this.isOtherAgent(cur_name)) {
|
if (!this.otherAgentInGame(cur_name)) {
|
||||||
if (!self_prompter_paused) {
|
if (!self_prompter_paused) {
|
||||||
this.endConversation(cur_name);
|
this.endConversation(cur_name);
|
||||||
agent.handleMessage('system', `${cur_name} disconnected, conversation has ended.`);
|
agent.handleMessage('system', `${cur_name} disconnected, conversation has ended.`);
|
||||||
|
@ -157,8 +158,13 @@ class ConversationManager {
|
||||||
return agent_names.some((n) => n === name);
|
return agent_names.some((n) => n === name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
otherAgentInGame(name) {
|
||||||
|
return agents_in_game.some((n) => n === name);
|
||||||
|
}
|
||||||
|
|
||||||
updateAgents(agents) {
|
updateAgents(agents) {
|
||||||
agent_names = agents.map(a => a.name);
|
agent_names = agents.map(a => a.name);
|
||||||
|
agents_in_game = agents.filter(a => a.in_game).map(a => a.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
inConversation(other_agent=null) {
|
inConversation(other_agent=null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue