forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
159 changed files
with
1,887 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
import $ from 'cafy'; | ||
import define from '../../define'; | ||
import { ApiError } from '../../error'; | ||
import { Users, UserProfiles } from '@/models/index'; | ||
import { ID } from '@/misc/cafy-id'; | ||
import { toPunyNullable } from '@/misc/convert-host'; | ||
|
||
export const meta = { | ||
tags: ['room'], | ||
|
||
requireCredential: false as const, | ||
|
||
params: { | ||
userId: { | ||
validator: $.optional.type(ID), | ||
}, | ||
|
||
username: { | ||
validator: $.optional.str, | ||
}, | ||
|
||
host: { | ||
validator: $.optional.nullable.str, | ||
}, | ||
}, | ||
|
||
errors: { | ||
noSuchUser: { | ||
message: 'No such user.', | ||
code: 'NO_SUCH_USER', | ||
id: '7ad3fa3e-5e12-42f0-b23a-f3d13f10ee4b', | ||
}, | ||
}, | ||
|
||
res: { | ||
type: 'object' as const, | ||
optional: false as const, nullable: false as const, | ||
properties: { | ||
roomType: { | ||
type: 'string' as const, | ||
optional: false as const, nullable: false as const, | ||
enum: ['default', 'washitsu'], | ||
}, | ||
furnitures: { | ||
type: 'array' as const, | ||
optional: false as const, nullable: false as const, | ||
items: { | ||
type: 'object' as const, | ||
optional: false as const, nullable: false as const, | ||
properties: { | ||
id: { | ||
type: 'string' as const, | ||
optional: false as const, nullable: false as const, | ||
}, | ||
type: { | ||
type: 'string' as const, | ||
optional: false as const, nullable: false as const, | ||
}, | ||
props: { | ||
type: 'object' as const, | ||
optional: true as const, nullable: false as const, | ||
}, | ||
position: { | ||
type: 'object' as const, | ||
optional: false as const, nullable: false as const, | ||
properties: { | ||
x: { | ||
type: 'number' as const, | ||
optional: false as const, nullable: false as const, | ||
}, | ||
y: { | ||
type: 'number' as const, | ||
optional: false as const, nullable: false as const, | ||
}, | ||
z: { | ||
type: 'number' as const, | ||
optional: false as const, nullable: false as const, | ||
}, | ||
}, | ||
}, | ||
rotation: { | ||
type: 'object' as const, | ||
optional: false as const, nullable: false as const, | ||
properties: { | ||
x: { | ||
type: 'number' as const, | ||
optional: false as const, nullable: false as const, | ||
}, | ||
y: { | ||
type: 'number' as const, | ||
optional: false as const, nullable: false as const, | ||
}, | ||
z: { | ||
type: 'number' as const, | ||
optional: false as const, nullable: false as const, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
carpetColor: { | ||
type: 'string' as const, | ||
optional: false as const, nullable: false as const, | ||
format: 'hex', | ||
example: '#85CAF0', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default define(meta, async (ps, me) => { | ||
const user = await Users.findOne(ps.userId != null | ||
? { id: ps.userId } | ||
: { usernameLower: ps.username!.toLowerCase(), host: toPunyNullable(ps.host) }); | ||
|
||
if (user == null) { | ||
throw new ApiError(meta.errors.noSuchUser); | ||
} | ||
|
||
const profile = await UserProfiles.findOneOrFail(user.id); | ||
|
||
if (profile.room.furnitures == null) { | ||
await UserProfiles.update(user.id, { | ||
room: { | ||
furnitures: [], | ||
...profile.room, | ||
}, | ||
}); | ||
|
||
profile.room.furnitures = []; | ||
} | ||
|
||
if (profile.room.roomType == null) { | ||
const initialType = 'default'; | ||
await UserProfiles.update(user.id, { | ||
room: { | ||
roomType: initialType as any, | ||
...profile.room, | ||
}, | ||
}); | ||
|
||
profile.room.roomType = initialType; | ||
} | ||
|
||
if (profile.room.carpetColor == null) { | ||
const initialColor = '#85CAF0'; | ||
await UserProfiles.update(user.id, { | ||
room: { | ||
carpetColor: initialColor as any, | ||
...profile.room, | ||
}, | ||
}); | ||
|
||
profile.room.carpetColor = initialColor; | ||
} | ||
|
||
return profile.room; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import $ from 'cafy'; | ||
import { publishMainStream } from '@/services/stream'; | ||
import define from '../../define'; | ||
import { Users, UserProfiles } from '@/models/index'; | ||
|
||
export const meta = { | ||
tags: ['room'], | ||
|
||
requireCredential: true as const, | ||
|
||
params: { | ||
room: { | ||
validator: $.obj({ | ||
furnitures: $.arr($.obj({ | ||
id: $.str, | ||
type: $.str, | ||
position: $.obj({ | ||
x: $.num, | ||
y: $.num, | ||
z: $.num, | ||
}), | ||
rotation: $.obj({ | ||
x: $.num, | ||
y: $.num, | ||
z: $.num, | ||
}), | ||
props: $.optional.nullable.obj(), | ||
})), | ||
roomType: $.str, | ||
carpetColor: $.str, | ||
}), | ||
}, | ||
}, | ||
}; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default define(meta, async (ps, user) => { | ||
await UserProfiles.update(user.id, { | ||
room: ps.room as any, | ||
}); | ||
|
||
const iObj = await Users.pack(user.id, user, { | ||
detail: true, | ||
includeSecrets: true, | ||
}); | ||
|
||
// Publish meUpdated event | ||
publishMainStream(user.id, 'meUpdated', iObj); | ||
|
||
// TODO: レスポンスがおかしいと思う by YuzuRyo61 | ||
return iObj; | ||
}); |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+503 KB
packages/client/assets/room/furnitures/cardboard-box/cardboard-box.blend
Binary file not shown.
Binary file added
BIN
+4.46 KB
packages/client/assets/room/furnitures/cardboard-box/cardboard-box.glb
Binary file not shown.
Binary file added
BIN
+533 KB
packages/client/assets/room/furnitures/cardboard-box2/cardboard-box2.blend
Binary file not shown.
Binary file added
BIN
+23.5 KB
packages/client/assets/room/furnitures/cardboard-box2/cardboard-box2.glb
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+535 KB
packages/client/assets/room/furnitures/cardboard-box3/cardboard-box3.blend
Binary file not shown.
Binary file added
BIN
+23.1 KB
packages/client/assets/room/furnitures/cardboard-box3/cardboard-box3.glb
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+470 KB
packages/client/assets/room/furnitures/carpet-stripe/carpet-stripe.blend
Binary file not shown.
Binary file added
BIN
+4.84 KB
packages/client/assets/room/furnitures/carpet-stripe/carpet-stripe.glb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+708 KB
packages/client/assets/room/furnitures/energy-drink/energy-drink.blend
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.37 KB
packages/client/assets/room/furnitures/facial-tissue/facial-tissue-uv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+521 KB
packages/client/assets/room/furnitures/facial-tissue/facial-tissue.blend
Binary file not shown.
Binary file added
BIN
+8.14 KB
packages/client/assets/room/furnitures/facial-tissue/facial-tissue.glb
Binary file not shown.
Binary file added
BIN
+688 Bytes
packages/client/assets/room/furnitures/facial-tissue/facial-tissue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+109 KB
packages/client/assets/room/furnitures/facial-tissue/facial-tissue.psd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+770 KB
packages/client/assets/room/furnitures/holo-display/holo-display.blend
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.