Skip to content

five-on-it / packages/ai/src/police-cops / placeCopOrder

Function: placeCopOrder() ​

placeCopOrder(ai, client, order, hooks): CopOrderResult

Defined in: packages/ai/src/police-cops.ts:331

Takes a cop's order (see the module documentation): checked against their role, the rate limit, their team's cooldown and budget, the robbers the police know of, the place on the map and the room's cap, then carried out by the director's senders, its cost paid and its cooldown started. The server calls it with what a client sent; nothing of the client's is trusted beyond its being a cop (the server's to know) and the point it named.

Parameters ​

ai ​

AiWorld

client ​

number

order ​

CopOrder

hooks ​

CopHooks

Returns ​

CopOrderResult