initial profile save wire-up

This commit is contained in:
Tau
2019-11-06 17:28:29 -05:00
parent 9bdc840019
commit c79c1b870d
18 changed files with 145 additions and 8 deletions
+6 -1
View File
@@ -1,5 +1,7 @@
import { Id } from "../model/base";
import { Profile } from "../model/profile";
import { Settings } from "../model/settings";
import { Story } from "../model/story";
import { Team } from "../model/team";
import { CreateProfileRequest } from "../request/createProfile";
import { GenericResponse } from "../response/generic";
@@ -14,11 +16,12 @@ export async function createProfile(
teamId: 2 as Id<Team>,
name: req.name,
lv: 1,
exp: 0,
fame: 0,
dpoint: 0,
};
const settings = {
const settings: Settings = {
bgMusic: 0,
forceQuitEn: false,
steeringForce: 4,
@@ -30,6 +33,8 @@ export async function createProfile(
taResultSkip: false,
};
const story: Story = { x: 0, y: 0, rows: [] };
await Promise.all([
w.profile().save(profile.id, profile),
w.chara().save(profile.id, req.chara),