add admin to init message
This commit is contained in:
parent
3525fdcff4
commit
7771251f4f
3 changed files with 5 additions and 3 deletions
|
@ -45,7 +45,8 @@ export interface MSAgentInitMessage extends MSAgentProtocolMessage {
|
||||||
charlimit: number
|
charlimit: number
|
||||||
users: {
|
users: {
|
||||||
username: string,
|
username: string,
|
||||||
agent: string
|
agent: string,
|
||||||
|
admin: boolean
|
||||||
}[]
|
}[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,8 @@ export class MSAgentChatRoom {
|
||||||
users: this.clients.filter(c => c.username !== null).map(c => {
|
users: this.clients.filter(c => c.username !== null).map(c => {
|
||||||
return {
|
return {
|
||||||
username: c.username!,
|
username: c.username!,
|
||||||
agent: c.agent!
|
agent: c.agent!,
|
||||||
|
admin: c.admin
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,7 +225,7 @@ export class MSAgentClient {
|
||||||
this.charlimit = initMsg.data.charlimit;
|
this.charlimit = initMsg.data.charlimit;
|
||||||
for (let _user of initMsg.data.users) {
|
for (let _user of initMsg.data.users) {
|
||||||
let agent = await agentCreateCharacterFromUrl(this.url + '/api/agents/' + _user.agent);
|
let agent = await agentCreateCharacterFromUrl(this.url + '/api/agents/' + _user.agent);
|
||||||
agent.setUsername(_user.username, "#000000");
|
agent.setUsername(_user.username, _user.admin ? "#FF0000" : "#000000");
|
||||||
agent.addToDom(this.agentContainer);
|
agent.addToDom(this.agentContainer);
|
||||||
agent.show();
|
agent.show();
|
||||||
let user = new User(_user.username, agent);
|
let user = new User(_user.username, agent);
|
||||||
|
|
Loading…
Reference in a new issue