[mod]
This commit is contained in:
12
backend1/src/api/ApiJoin.ts
Normal file
12
backend1/src/api/ApiJoin.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ApiCallWs } from "tsrpc";
|
||||
import { roomInstance } from "..";
|
||||
import { ReqJoin, ResJoin } from "../shared/protocols/PtlJoin";
|
||||
|
||||
export async function ApiJoin(call: ApiCallWs<ReqJoin, ResJoin>): Promise<void> {
|
||||
let playerId: number = roomInstance.join(call.req, call.conn);
|
||||
|
||||
call.succ({
|
||||
playerId: playerId,
|
||||
gameState: roomInstance.gameSystem.state
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user