wip create working(?)
This commit is contained in:
@@ -12,6 +12,7 @@ export async function createProfile(
|
||||
w: Repositories,
|
||||
req: CreateProfileRequest
|
||||
): Promise<GenericResponse> {
|
||||
const now = new Date();
|
||||
const profile: ProfileSpec = {
|
||||
teamId: 2 as ExtId<Team>, // TODO
|
||||
name: req.name,
|
||||
@@ -32,7 +33,7 @@ export async function createProfile(
|
||||
lastMileageReward: 0,
|
||||
};
|
||||
|
||||
const profileId = await w.profile().create(profile);
|
||||
const profileId = await w.profile().create(req.aimeId, profile, now);
|
||||
|
||||
await w.chara().save(profileId, req.chara);
|
||||
await w.car().saveCar(profileId, req.car);
|
||||
|
||||
@@ -6,17 +6,21 @@ export async function saveProfile(
|
||||
w: Repositories,
|
||||
req: SaveProfileRequest
|
||||
): Promise<GenericResponse> {
|
||||
const now = new Date();
|
||||
const profile = await w.profile().load(req.profileId);
|
||||
const chara = await w.chara().load(req.profileId);
|
||||
|
||||
await w.profile().save({
|
||||
...profile,
|
||||
lv: req.lv,
|
||||
exp: req.exp,
|
||||
fame: req.fame,
|
||||
dpoint: req.dpoint,
|
||||
mileage: req.mileage,
|
||||
});
|
||||
await w.profile().save(
|
||||
{
|
||||
...profile,
|
||||
lv: req.lv,
|
||||
exp: req.exp,
|
||||
fame: req.fame,
|
||||
dpoint: req.dpoint,
|
||||
mileage: req.mileage,
|
||||
},
|
||||
now
|
||||
);
|
||||
|
||||
await w.chara().save(req.profileId, {
|
||||
...chara,
|
||||
|
||||
@@ -6,7 +6,12 @@ export async function saveTimeAttack(
|
||||
w: Repositories,
|
||||
req: SaveTimeAttackRequest
|
||||
): Promise<SaveTimeAttackResponse> {
|
||||
await w.timeAttack().save(req.profileId, req.payload);
|
||||
// Override client time since we might be doing some maintenance window
|
||||
// avoidance time warping stuff
|
||||
|
||||
await w
|
||||
.timeAttack()
|
||||
.save(req.profileId, { ...req.payload, timestamp: new Date() });
|
||||
|
||||
return {
|
||||
type: "save_time_attack_res",
|
||||
|
||||
Reference in New Issue
Block a user