mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-03-28 14:56:24 +01: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) {
|
||||
this.last_sender = save_data.last_sender;
|
||||
if (convoManager.isOtherAgent(this.last_sender)) {
|
||||
if (convoManager.otherAgentInGame(this.last_sender)) {
|
||||
const msg_package = {
|
||||
message: `You have restarted and this message is auto-generated. Continue the conversation with me.`,
|
||||
start: true
|
||||
|
|
|
@ -5,6 +5,7 @@ import { sendBotChatToServer } from './agent_proxy.js';
|
|||
|
||||
let agent;
|
||||
let agent_names = settings.profiles.map((p) => JSON.parse(readFileSync(p, 'utf8')).name);
|
||||
let agents_in_game = [];
|
||||
|
||||
let self_prompter_paused = false;
|
||||
|
||||
|
@ -68,7 +69,7 @@ class ConversationManager {
|
|||
return; // will clean itself up
|
||||
}
|
||||
let cur_name = this.activeConversation.name;
|
||||
if (!this.isOtherAgent(cur_name)) {
|
||||
if (!this.otherAgentInGame(cur_name)) {
|
||||
if (!self_prompter_paused) {
|
||||
this.endConversation(cur_name);
|
||||
agent.handleMessage('system', `${cur_name} disconnected, conversation has ended.`);
|
||||
|
@ -156,9 +157,14 @@ class ConversationManager {
|
|||
isOtherAgent(name) {
|
||||
return agent_names.some((n) => n === name);
|
||||
}
|
||||
|
||||
otherAgentInGame(name) {
|
||||
return agents_in_game.some((n) => n === name);
|
||||
}
|
||||
|
||||
updateAgents(agents) {
|
||||
agent_names = agents.map(a => a.name);
|
||||
agents_in_game = agents.filter(a => a.in_game).map(a => a.name);
|
||||
}
|
||||
|
||||
inConversation(other_agent=null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue