forked from xiangwang25/whale-town-end-v2
feat: integrate invitation access, world NPCs, and deployment
This commit is contained in:
@@ -269,8 +269,8 @@ export class CafeCompanionService implements OnModuleInit, OnModuleDestroy {
|
||||
}
|
||||
|
||||
const assignedOccupant = this.getAssignedOccupant(dto.service_point_id);
|
||||
if (assignedOccupant && assignedOccupant.occupant_type === 'hired_player') {
|
||||
throw new BadRequestException('该陪伴位已经有玩家在打工');
|
||||
if (assignedOccupant) {
|
||||
throw new BadRequestException('该陪伴位已被占用,请选择其他空位');
|
||||
}
|
||||
|
||||
const agentId = ['cafe_companion_agent', userKey, dto.service_point_id].join(':');
|
||||
@@ -296,6 +296,12 @@ export class CafeCompanionService implements OnModuleInit, OnModuleDestroy {
|
||||
|
||||
await this.validateEmploymentAgent(agent);
|
||||
|
||||
// Agent validation calls an external service, so the point may have been
|
||||
// taken while this request was waiting for the response.
|
||||
if (this.getAssignedOccupant(dto.service_point_id)) {
|
||||
throw new BadRequestException('该陪伴位已被占用,请选择其他空位');
|
||||
}
|
||||
|
||||
const occupant: CafeCompanionOccupant = {
|
||||
id: occupantId,
|
||||
service_point_id: dto.service_point_id,
|
||||
|
||||
Reference in New Issue
Block a user