Separated 'exit' and 'self-destroy' and added functionality to remove agents from the teamserver to cleanup the sessions table.

This commit is contained in:
Jakob Friedl
2025-10-27 15:17:56 +01:00
parent f5ff90fc47
commit f30f1d2ec0
7 changed files with 51 additions and 37 deletions

View File

@@ -54,6 +54,16 @@ proc sendAgentTask*(connection: WsConnection, agentId: string, command: string,
)
connection.ws.sendEvent(event, connection.sessionKey)
proc sendAgentRemove*(connection: WsConnection, agentId: string) =
let event = Event(
eventType: CLIENT_AGENT_REMOVE,
timestamp: now().toTime().toUnix(),
data: %*{
"agentId": agentId
}
)
connection.ws.sendEvent(event, connection.sessionKey)
proc sendRemoveLoot*(connection: WsConnection, lootId: string) =
let event = Event(
eventType: CLIENT_LOOT_REMOVE,
@@ -72,4 +82,5 @@ proc sendGetLoot*(connection: WsConnection, lootId: string) =
"lootId": lootId
}
)
connection.ws.sendEvent(event, connection.sessionKey)
connection.ws.sendEvent(event, connection.sessionKey)