make fetchHadler synchronous only
This commit is contained in:
parent
2fbe0f0595
commit
594921352c
@ -75,13 +75,17 @@ export class Input extends System {
|
||||
PhysicsConstants.MAX_JUMP_TIME_MS
|
||||
) {
|
||||
const mass = entity.getComponent<Mass>(ComponentNames.Mass).mass;
|
||||
entity.getComponent<Forces>(ComponentNames.Forces)?.forces.push({
|
||||
|
||||
const jumpForce = {
|
||||
fCartesian: {
|
||||
fy: mass * PhysicsConstants.PLAYER_JUMP_ACC,
|
||||
fx: 0
|
||||
},
|
||||
torque: 0
|
||||
});
|
||||
};
|
||||
entity
|
||||
.getComponent<Forces>(ComponentNames.Forces)
|
||||
?.forces.push(jumpForce);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,10 +65,10 @@ export class GameServer {
|
||||
const { sessionId } = websocket.data;
|
||||
|
||||
const sessionEntities = this.sessions.get(sessionId)!.controllableEntities;
|
||||
|
||||
this.sessions.delete(sessionId);
|
||||
|
||||
if (!sessionEntities) return;
|
||||
|
||||
this.messagePublisher.addMessage({
|
||||
type: MessageType.REMOVE_ENTITIES,
|
||||
body: Array.from(sessionEntities)
|
||||
@ -103,10 +103,7 @@ export class GameServer {
|
||||
this.sessions.get(sessionId)!.controllableEntities.add(player.id);
|
||||
}
|
||||
|
||||
private fetchHandler(
|
||||
req: Request,
|
||||
server: Server
|
||||
): Promise<Response> | Response {
|
||||
private fetchHandler(req: Request, server: Server): Response {
|
||||
const url = new URL(req.url);
|
||||
|
||||
const headers = new Headers();
|
||||
|
Loading…
Reference in New Issue
Block a user