|
@@ -15,6 +15,7 @@ export default class ActionsHandler {
|
|
|
this.room = room
|
|
|
}
|
|
|
|
|
|
+ // 在_handleAvatar时调用
|
|
|
async avatarComponentsSync(avatarComponents) {
|
|
|
this.sendData({
|
|
|
data: {
|
|
@@ -128,7 +129,7 @@ export default class ActionsHandler {
|
|
|
))
|
|
|
}
|
|
|
|
|
|
- // Panorama.exit()中调用
|
|
|
+ // 用于Panorama.exit()
|
|
|
changeRotationRenderType({renderType, player, camera, areaName, attitude, pathName})
|
|
|
{
|
|
|
return this.transfer({
|
|
@@ -160,7 +161,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 设置角色行动类型,如MotionType.Walk。方法未调用
|
|
|
+ // 用于XverseAvatar.setMotionType()。方法未执行
|
|
|
setMotionType(type)
|
|
|
{
|
|
|
return this.transfer({
|
|
@@ -169,7 +170,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 设置角色昵称
|
|
|
+ // 设置角色昵称。用于XverseAvatar.setNickname()
|
|
|
setNickName(nickname)
|
|
|
{
|
|
|
return this.sendData({
|
|
@@ -182,7 +183,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
getReserveSeat({routeId, name})
|
|
|
{
|
|
|
return this.sendData({
|
|
@@ -196,7 +197,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
getReserveStatus({routeId, name, need_detail})
|
|
|
{
|
|
|
return this.sendData({
|
|
@@ -223,7 +224,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
getOnVehicle({routeId, name, camera})
|
|
|
{
|
|
|
return this.sendData({
|
|
@@ -238,7 +239,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
getOffVehicle({renderType, player, camera})
|
|
|
{
|
|
|
return this.sendData({
|
|
@@ -281,77 +282,68 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
- async changeSkin(e)
|
|
|
+ // 方法未执行
|
|
|
+ async changeSkin(skinData)
|
|
|
{
|
|
|
- const t = e.special === void 0 ? e.renderType === RenderType.ClientRotationPano : e.special
|
|
|
- , {skinId: r, mode: n, landingType: o=LandingType.Stay, landingPoint: a, landingCamera: s, renderType: l, areaName: u, attitude: c, pathName: h, person: f, noMedia: d, timeout: _, roomTypeId: g=""} = e
|
|
|
- , m = this.room.skinList.filter(y=>y.id === r)[0];
|
|
|
- if (!m) {
|
|
|
- const y = `skin ${r} is invalid`;
|
|
|
+ const { skinId, mode, landingType=LandingType.Stay, landingPoint, landingCamera, renderType, areaName, attitude, pathName, person, noMedia, timeout,
|
|
|
+ roomTypeId="", special } = skinData
|
|
|
+
|
|
|
+ const newSkin = this.room.skinList.filter(skin => skin.id === skinId)[0];
|
|
|
+ if (!newSkin) {
|
|
|
+ const y = `skin ${skinId} is invalid`;
|
|
|
return logger.error(y),
|
|
|
Promise.reject(new ParamError(y))
|
|
|
}
|
|
|
- const v = {
|
|
|
- action_type: Actions.ChangeSkin,
|
|
|
- change_skin_action: {
|
|
|
- skinID: r,
|
|
|
- mode: n === ChangeMode.Preview ? ChangeMode.Preview : ChangeMode.Confirm,
|
|
|
- skin_data_version: r + m.versionId,
|
|
|
- landing_type: o,
|
|
|
- landing_point: a,
|
|
|
- landing_camera: s,
|
|
|
- render_wrapper: {
|
|
|
- render_type: l
|
|
|
- },
|
|
|
- areaName: u,
|
|
|
- attitude: c,
|
|
|
- noMedia: d,
|
|
|
- person: f,
|
|
|
- pathName: h,
|
|
|
- roomTypeId: g
|
|
|
- }
|
|
|
- };
|
|
|
+
|
|
|
return this.sendData({
|
|
|
- data: v,
|
|
|
- timeout: _ || 6e3,
|
|
|
- special: t
|
|
|
- }).then(async y=>{
|
|
|
- if (l === RenderType.ClientRotationPano && y) {
|
|
|
- const b = await this.room.modelManager.findRoute(r, h)
|
|
|
- , {camera: T} = util.getRandomItem(b.birthPointList) || {};
|
|
|
- await this.room.panorama.handleReceivePanorama(y, T)
|
|
|
+ data: {
|
|
|
+ action_type: Actions.ChangeSkin,
|
|
|
+ change_skin_action: {
|
|
|
+ skinID: skinId,
|
|
|
+ mode: mode === ChangeMode.Preview ? ChangeMode.Preview : ChangeMode.Confirm,
|
|
|
+ skin_data_version: skinId + newSkin.versionId,
|
|
|
+ landing_type: landingType,
|
|
|
+ landing_point: landingPoint,
|
|
|
+ landing_camera: landingCamera,
|
|
|
+ render_wrapper: {
|
|
|
+ render_type: renderType
|
|
|
+ },
|
|
|
+ areaName,
|
|
|
+ attitude,
|
|
|
+ noMedia,
|
|
|
+ person,
|
|
|
+ pathName,
|
|
|
+ roomTypeId
|
|
|
+ }
|
|
|
+ },
|
|
|
+ timeout: timeout || 6e3,
|
|
|
+ special: special === void 0 ? renderType === RenderType.ClientRotationPano : special
|
|
|
+ })
|
|
|
+ .then(async y=>{
|
|
|
+ if (renderType === RenderType.ClientRotationPano && y) {
|
|
|
+ const route = await this.room.modelManager.findRoute(skinId, pathName)
|
|
|
+ , {camera} = util.getRandomItem(route.birthPointList) || {};
|
|
|
+ await this.room.panorama.handleReceivePanorama(y, camera)
|
|
|
}
|
|
|
- return this.handleChangeSkin(e)
|
|
|
- }
|
|
|
- ).catch(y=>d ? this.handleChangeSkin(e) : Promise.reject(y))
|
|
|
+ return this.handleChangeSkin(skinData)
|
|
|
+ })
|
|
|
+ .catch(e => noMedia ? this.handleChangeSkin(skinData) : Promise.reject(e))
|
|
|
}
|
|
|
|
|
|
- handleChangeSkin(e)
|
|
|
+ handleChangeSkin({skinId, mode, renderType, areaName, attitude, pathName})
|
|
|
{
|
|
|
- const {skinId: t, mode: r, renderType: n, areaName: o, attitude: a, pathName: s} = e;
|
|
|
return this.room.sceneManager.staticmeshComponent.getCgMesh().show(),
|
|
|
this.room.sceneManager.cameraComponent.switchToCgCamera(),
|
|
|
- this.room.engineProxy._updateSkinAssets(t).then(()=>{
|
|
|
+ this.room.engineProxy._updateSkinAssets(skinId).then(()=>{
|
|
|
this.room.sceneManager.staticmeshComponent.getCgMesh().hide(),
|
|
|
this.room.sceneManager.cameraComponent.switchToMainCamera(),
|
|
|
- this.room.pathManager.currentArea = o,
|
|
|
+ this.room.pathManager.currentArea = areaName,
|
|
|
logger.info("changeSkin _updateSkinAssets susccss"),
|
|
|
- this.room.updateCurrentNetworkOptions({
|
|
|
- pathName: s,
|
|
|
- attitude: a,
|
|
|
- areaName: o
|
|
|
- }),
|
|
|
+ this.room.updateCurrentNetworkOptions({ pathName, attitude, areaName }),
|
|
|
this.room.skinChangedHook(),
|
|
|
- this.room.emit("skinChanged", {
|
|
|
- skin: {
|
|
|
- id: t
|
|
|
- },
|
|
|
- mode: r
|
|
|
- }),
|
|
|
- n === RenderType.ClientRotationPano && this.room.sceneManager.cameraComponent.allowMainCameraController()
|
|
|
- }
|
|
|
- )
|
|
|
+ this.room.emit("skinChanged", { skin: { id: skinId }, mode }),
|
|
|
+ renderType === RenderType.ClientRotationPano && this.room.sceneManager.cameraComponent.allowMainCameraController()
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 相机旋转
|
|
@@ -360,7 +352,7 @@ export default class ActionsHandler {
|
|
|
if (
|
|
|
this.room.disableRotate ||
|
|
|
this.room.isPano ||
|
|
|
- (this.room._userAvatar == null ? void 0 : this.room._userAvatar._isChangingComponentsMode)
|
|
|
+ (this.room._userAvatar && this.room._userAvatar._isChangingComponentsMode)
|
|
|
) return;
|
|
|
|
|
|
this.sendData({
|
|
@@ -375,7 +367,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 用于XverseAvatar.turnTo()。方法未执行
|
|
|
turnTo({point, timeout=2e3, offset=8} = {})
|
|
|
{
|
|
|
return this.sendData({
|
|
@@ -390,7 +382,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 人物旋转
|
|
|
+ // 用于XverseAvatar.rotateTo()。方法未执行
|
|
|
rotateTo({point, offset=0, speed=3} = {})
|
|
|
{
|
|
|
return this.sendData({
|
|
@@ -428,7 +420,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 用于Debug.getPointsAndRender()
|
|
|
+ // 显示呼吸点。用于Debug.getPointsAndRender()
|
|
|
getNeighborPoints({point, containSelf=!1, searchRange=500})
|
|
|
{
|
|
|
return this.sendData({
|
|
@@ -444,7 +436,7 @@ export default class ActionsHandler {
|
|
|
}).then(a=>a.nps)
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
playCG(cgName)
|
|
|
{
|
|
|
return this.sendData({
|
|
@@ -457,7 +449,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
audienceToVisitor({avatarId, avatarComponents, player, camera})
|
|
|
{
|
|
|
return logger.debug("send data: audience to visitor"),
|
|
@@ -474,7 +466,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
visitorToAudience({renderType, player, camera, areaName, attitude, pathName, person:personType, noMedia})
|
|
|
{
|
|
|
return logger.debug("send data: visitor to audience"),
|
|
@@ -500,7 +492,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
removeVisitor({removeType, userIDList, extraInfo=""})
|
|
|
{
|
|
|
return logger.debug("send data: remove visitor"),
|
|
@@ -516,7 +508,7 @@ export default class ActionsHandler {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
getUserWithAvatar(userType, roomID)
|
|
|
{
|
|
|
return logger.debug("send data: get user with avatar"),
|
|
@@ -545,7 +537,7 @@ export default class ActionsHandler {
|
|
|
}).then(o => o)
|
|
|
}
|
|
|
|
|
|
- // 方法未调用
|
|
|
+ // 方法未执行
|
|
|
setSyncPolicy({syncPolicy})
|
|
|
{
|
|
|
return this.sendData({
|