Add experimental multiuserroom

This commit is contained in:
kwaroran
2024-09-10 05:44:59 +09:00
parent 2f5f136089
commit 8c47298512
10 changed files with 322 additions and 49 deletions

View File

@@ -20,7 +20,7 @@ import { additionalInformations } from "./embedding/addinfo";
import { cipherChat, decipherChat } from "./cipherChat";
import { getInlayImage, supportsInlayImage } from "./files/image";
import { getGenerationModelString } from "./models/modelString";
import { sendPeerChar } from "../sync/multiuser";
import { connectionOpen, peerRevertChat, peerSafeCheck, peerSync } from "../sync/multiuser";
import { runInlayScreen } from "./inlayScreen";
import { runCharacterJS } from "../plugins/embedscript";
import { addRerolls } from "./prereroll";
@@ -108,6 +108,19 @@ export async function sendChat(chatProcessIndex = -1,arg:{
}
doingChat.set(true)
if(connectionOpen){
chatProcessStage.set(4)
const peerSafe = await peerSafeCheck()
if(!peerSafe){
peerRevertChat()
doingChat.set(false)
alertError(language.otherUserRequesting)
return false
}
await peerSync()
chatProcessStage.set(0)
}
let db = get(DataBase)
let selectedChar = get(selectedCharID)
const nowChatroom = db.characters[selectedChar]
@@ -1307,7 +1320,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{
chatProcessStage.set(4)
sendPeerChar()
peerSync()
if(req.special){
if(req.special.emotion){