mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-27 08:00:51 +01:00
Update api
This commit is contained in:
parent
bd9c7e001e
commit
88a8c2f015
6
src/api/nitro/GetConnection.ts
Normal file
6
src/api/nitro/GetConnection.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { IConnection, Nitro } from 'nitro-renderer';
|
||||
|
||||
export function GetConnection(): IConnection
|
||||
{
|
||||
return Nitro.instance.communication.connection;
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
export * from './avatar';
|
||||
export * from './GetConnection';
|
||||
export * from './room';
|
||||
export * from './session';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { RoomEngineObjectEvent, RoomObjectVariable } from 'nitro-renderer';
|
||||
import { GetSessionDataManager } from '../../../api';
|
||||
import { GetRoomEngine } from '../../../api/nitro/room/GetRoomEngine';
|
||||
import { GetSessionDataManager } from '../..';
|
||||
import { GetRoomEngine } from './GetRoomEngine';
|
||||
|
||||
export function IsFurnitureSelectionDisabled(event: RoomEngineObjectEvent): boolean
|
||||
{
|
@ -3,5 +3,6 @@ export * from './DispatchResizeEvent';
|
||||
export * from './DispatchTouchEvent';
|
||||
export * from './GetRoomEngine';
|
||||
export * from './InitializeRoomInstanceRenderingCanvas';
|
||||
export * from './IsFurnitureSelectionDisabled';
|
||||
export * from './ProcessRoomObjectOperation';
|
||||
export * from './SetActiveRoomId';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { IRoomSession, RoomControllerLevel } from 'nitro-renderer';
|
||||
import { GetSessionDataManager } from '../../../api';
|
||||
import { GetRoomEngine } from '../../../api/nitro/room/GetRoomEngine';
|
||||
import { GetSessionDataManager } from '../..';
|
||||
import { GetRoomEngine } from '../room/GetRoomEngine';
|
||||
import { IsOwnerOfFurniture } from './IsOwnerOfFurniture';
|
||||
|
||||
export function CanManipulateFurniture(roomSession: IRoomSession, objectId: number, category: number): boolean
|
30
src/api/nitro/session/GetBotInfoData.ts
Normal file
30
src/api/nitro/session/GetBotInfoData.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { RoomObjectVariable, RoomUserData } from 'nitro-renderer';
|
||||
import { GetRoomEngine } from '../room';
|
||||
import { GetRoomSession } from './GetRoomSession';
|
||||
import { GetSessionDataManager } from './GetSessionDataManager';
|
||||
import { UserInfoData } from './UserInfoData';
|
||||
|
||||
export function GetBotInfoData(roomId: number, objectId: number, category: number, userData: RoomUserData): UserInfoData
|
||||
{
|
||||
const userInfoData = new UserInfoData(UserInfoData.BOT);
|
||||
|
||||
userInfoData.name = userData.name;
|
||||
userInfoData.motto = userData.custom;
|
||||
userInfoData.webID = userData.webID;
|
||||
userInfoData.userRoomId = objectId;
|
||||
userInfoData.userType = userData.type;
|
||||
|
||||
const roomObject = GetRoomEngine().getRoomObject(roomId, objectId, category);
|
||||
|
||||
if(roomObject) userInfoData.carryItem = roomObject.model.getValue<number>(RoomObjectVariable.FIGURE_CARRY_OBJECT);
|
||||
|
||||
userInfoData.amIOwner = GetRoomSession().isRoomOwner;
|
||||
userInfoData.isGuildRoom = GetRoomSession().isGuildRoom;
|
||||
userInfoData.roomControllerLevel = GetRoomSession().controllerLevel;
|
||||
userInfoData.amIAnyRoomController = GetSessionDataManager().isModerator;
|
||||
userInfoData.isAmbassador = GetSessionDataManager().isAmbassador;
|
||||
userInfoData.badges = [ 'BOT' ];
|
||||
userInfoData.figure = userData.figure;
|
||||
|
||||
return userInfoData;
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
import { IFurnitureData, Nitro, ObjectDataFactory, RoomObjectCategory, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter, Vector3d } from 'nitro-renderer';
|
||||
import { GetRoomEngine, GetRoomSession, GetSessionDataManager } from '../../../../../api';
|
||||
import { IsOwnerOfFurniture } from '../../../../room-host/utils/IsOwnerOfFurniture';
|
||||
import { GetRoomEngine } from '../room';
|
||||
import { FurnitureInfoData } from './FurnitureInfoData';
|
||||
import { GetRoomSession } from './GetRoomSession';
|
||||
import { GetSessionDataManager } from './GetSessionDataManager';
|
||||
import { IsOwnerOfFurniture } from './IsOwnerOfFurniture';
|
||||
|
||||
export function GetFurnitureInfoData(roomId: number, objectId: number, category: number): FurnitureInfoData
|
||||
{
|
31
src/api/nitro/session/GetRentableBotInfoData.ts
Normal file
31
src/api/nitro/session/GetRentableBotInfoData.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import { RoomObjectVariable, RoomUserData } from 'nitro-renderer';
|
||||
import { GetRoomEngine } from '../room';
|
||||
import { GetRoomSession } from './GetRoomSession';
|
||||
import { GetSessionDataManager } from './GetSessionDataManager';
|
||||
import { RentableBotInfoData } from './RentableBotInfoData';
|
||||
import { UserInfoData } from './UserInfoData';
|
||||
|
||||
export function GetRentableBotInfoData(roomId: number, objectId: number, category: number, userData: RoomUserData): RentableBotInfoData
|
||||
{
|
||||
const rentBotInfoData = new RentableBotInfoData(UserInfoData.BOT);
|
||||
|
||||
rentBotInfoData.name = userData.name;
|
||||
rentBotInfoData.motto = userData.custom;
|
||||
rentBotInfoData.webID = userData.webID;
|
||||
rentBotInfoData.userRoomId = objectId;
|
||||
rentBotInfoData.ownerId = userData.ownerId;
|
||||
rentBotInfoData.ownerName = userData.ownerName;
|
||||
rentBotInfoData.botSkills = userData.botSkills;
|
||||
|
||||
const roomObject = GetRoomEngine().getRoomObject(roomId, objectId, category);
|
||||
|
||||
if(roomObject) rentBotInfoData.carryItem = roomObject.model.getValue<number>(RoomObjectVariable.FIGURE_CARRY_OBJECT);
|
||||
|
||||
rentBotInfoData.amIOwner = GetRoomSession().isRoomOwner;
|
||||
rentBotInfoData.roomControllerLevel = GetRoomSession().controllerLevel;
|
||||
rentBotInfoData.amIAnyRoomController = GetSessionDataManager().isModerator;
|
||||
rentBotInfoData.badges = [ 'BOT' ];
|
||||
rentBotInfoData.figure = userData.figure;
|
||||
|
||||
return rentBotInfoData;
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
import { IFurnitureData, RoomObjectCategory, RoomObjectVariable } from 'nitro-renderer';
|
||||
import { GetRoomEngine, GetRoomSession, GetSessionDataManager } from '../../../../../api';
|
||||
import { GetRoomEngine } from '../room';
|
||||
import { GetRoomSession } from './GetRoomSession';
|
||||
import { GetSessionDataManager } from './GetSessionDataManager';
|
||||
import { RoomObjectNameData } from './RoomObjectNameData';
|
||||
|
||||
export function GetRoomObjectNameData(roomId: number, objectId: number, category: number): RoomObjectNameData
|
@ -1,5 +1,7 @@
|
||||
import { RoomControllerLevel, RoomModerationParser, RoomObjectType, RoomObjectVariable, RoomTradingLevelEnum, RoomUserData } from 'nitro-renderer';
|
||||
import { GetRoomEngine, GetRoomSession, GetSessionDataManager } from '../../../../../api';
|
||||
import { GetRoomEngine } from '../room';
|
||||
import { GetRoomSession } from './GetRoomSession';
|
||||
import { GetSessionDataManager } from './GetSessionDataManager';
|
||||
import { UserInfoData } from './UserInfoData';
|
||||
|
||||
export const _Str_18400: number = 0;
|
||||
@ -8,9 +10,11 @@ export const _Str_13798: number = 3;
|
||||
|
||||
export function GetUserInfoData(roomId: number, objectId: number, category: number, userData: RoomUserData): UserInfoData
|
||||
{
|
||||
const isOwnUser = false;
|
||||
let userDataType = UserInfoData.OWN_USER;
|
||||
|
||||
const userInfoData = new UserInfoData();
|
||||
if(userData.webID !== GetSessionDataManager().userId) userDataType = UserInfoData.PEER;
|
||||
|
||||
const userInfoData = new UserInfoData(userDataType);
|
||||
|
||||
userInfoData.isSpectatorMode = GetRoomSession().isSpectator;
|
||||
userInfoData.name = userData.name;
|
||||
@ -24,7 +28,7 @@ export function GetUserInfoData(roomId: number, objectId: number, category: numb
|
||||
|
||||
if(roomObject) userInfoData.carryItem = roomObject.model.getValue<number>(RoomObjectVariable.FIGURE_CARRY_OBJECT);
|
||||
|
||||
if(isOwnUser)
|
||||
if(userDataType === UserInfoData.OWN_USER)
|
||||
{
|
||||
userInfoData.realName = GetSessionDataManager().realName;
|
||||
userInfoData.allowNameChange = GetSessionDataManager().canChangeName;
|
||||
@ -36,7 +40,7 @@ export function GetUserInfoData(roomId: number, objectId: number, category: numb
|
||||
userInfoData.amIAnyRoomController = GetSessionDataManager().isModerator;
|
||||
userInfoData.isAmbassador = GetSessionDataManager().isAmbassador;
|
||||
|
||||
if(!isOwnUser)
|
||||
if(userDataType === UserInfoData.PEER)
|
||||
{
|
||||
// userInfoData.canBeAskedAsFriend = this._container.friendService.canBeAskedForAFriend(userData.webID);
|
||||
|
70
src/api/nitro/session/ProcessFurniAction.ts
Normal file
70
src/api/nitro/session/ProcessFurniAction.ts
Normal file
@ -0,0 +1,70 @@
|
||||
import { RoomAdsUpdateComposer, RoomObjectOperationType, SecurityLevel } from 'nitro-renderer';
|
||||
import { GetConnection } from '../GetConnection';
|
||||
import { GetRoomEngine } from '../room';
|
||||
import { GetSessionDataManager } from './GetSessionDataManager';
|
||||
|
||||
export class FurniAction
|
||||
{
|
||||
public static ROTATE: string = 'FA_ROTATE';
|
||||
public static MOVE: string = 'FA_MOVE';
|
||||
public static PICKUP: string = 'FA_PICKUP';
|
||||
public static EJECT: string = 'FA_EJECT';
|
||||
public static USE: string = 'FA_USE';
|
||||
public static OPEN_WELCOME_GIFT: string = 'FA_OPEN_WELCOME_GIFT';
|
||||
public static SAVE_STUFF_DATA: string = 'FA_SAVE_STUFF_DATA';
|
||||
}
|
||||
|
||||
export function ProcessFurniAction(type: string, objectId: number, category: number, offerId = -1, objectData: string = null): void
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case FurniAction.ROTATE:
|
||||
GetRoomEngine().processRoomObjectOperation(objectId, category, RoomObjectOperationType.OBJECT_ROTATE_POSITIVE);
|
||||
return;
|
||||
case FurniAction.MOVE:
|
||||
GetRoomEngine().processRoomObjectOperation(objectId, category, RoomObjectOperationType.OBJECT_MOVE);
|
||||
return;
|
||||
case FurniAction.PICKUP:
|
||||
GetRoomEngine().processRoomObjectOperation(objectId, category, RoomObjectOperationType.OBJECT_PICKUP);
|
||||
return;
|
||||
case FurniAction.EJECT:
|
||||
GetRoomEngine().processRoomObjectOperation(objectId, category, RoomObjectOperationType.OBJECT_EJECT);
|
||||
return;
|
||||
case FurniAction.USE:
|
||||
GetRoomEngine().useRoomObject(objectId, category);
|
||||
return;
|
||||
case FurniAction.SAVE_STUFF_DATA: {
|
||||
if(objectData)
|
||||
{
|
||||
const mapData = new Map<string, string>();
|
||||
const dataParts = objectData.split('\t');
|
||||
|
||||
if(dataParts)
|
||||
{
|
||||
for(const part of dataParts)
|
||||
{
|
||||
const partPieces = part.split('=', 2);
|
||||
|
||||
if(partPieces && partPieces.length === 2)
|
||||
{
|
||||
const piece1 = partPieces[0];
|
||||
const piece2 = partPieces[1];
|
||||
|
||||
mapData.set(piece1, piece2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GetRoomEngine().processRoomObjectWallOperation(objectId, category, RoomObjectOperationType.OBJECT_SAVE_STUFF_DATA, mapData);
|
||||
|
||||
if(GetSessionDataManager().hasSecurity(SecurityLevel.MODERATOR))
|
||||
{
|
||||
GetConnection().send(new RoomAdsUpdateComposer(this._widget.furniData.id, mapData));
|
||||
}
|
||||
|
||||
mapData.clear();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
194
src/api/nitro/session/ProcessUserAction.ts
Normal file
194
src/api/nitro/session/ProcessUserAction.ts
Normal file
@ -0,0 +1,194 @@
|
||||
import { RoomUnitDropHandItemComposer, RoomUnitGiveHandItemComposer, RoomUserData } from 'nitro-renderer';
|
||||
import { GetConnection } from '../GetConnection';
|
||||
import { GetRoomSession } from './GetRoomSession';
|
||||
import { GetSessionDataManager } from './GetSessionDataManager';
|
||||
|
||||
export class UserAction
|
||||
{
|
||||
public static WHISPER_USER: string = 'UA_WHISPER_USER';
|
||||
public static IGNORE_USER: string = 'UA_IGNORE_USER';
|
||||
public static IGNORE_USER_BUBBLE: string = 'UA_IGNORE_USER_BUBBLE';
|
||||
public static UNIGNORE_USER: string = 'UA_UNIGNORE_USER';
|
||||
public static KICK_USER: string = 'UA_KICK_USER';
|
||||
public static BAN_USER_HOUR: string = 'UA_BAN_USER_HOUR';
|
||||
public static BAN_USER_DAY: string = 'UA_BAN_USER_DAY';
|
||||
public static BAN_USER_PERM: string = 'UA_BAN_USER_PERM';
|
||||
public static MUTE_USER_2MIN: string = 'UA_MUTE_USER_2MIN';
|
||||
public static MUTE_USER_5MIN: string = 'UA_MUTE_USER_5MIN';
|
||||
public static MUTE_USER_10MIN: string = 'UA_MUTE_USER_10MIN';
|
||||
public static SEND_FRIEND_REQUEST: string = 'UA_SEND_FRIEND_REQUEST';
|
||||
public static RESPECT_USER: string = 'UA_RESPECT_USER';
|
||||
public static GIVE_RIGHTS: string = 'UA_GIVE_RIGHTS';
|
||||
public static TAKE_RIGHTS: string = 'UA_TAKE_RIGHTS';
|
||||
public static START_TRADING: string = 'UA_START_TRADING';
|
||||
public static OPEN_HOME_PAGE: string = 'UA_OPEN_HOME_PAGE';
|
||||
public static REPORT: string = 'UA_REPORT';
|
||||
public static PICKUP_PET: string = 'UA_PICKUP_PET';
|
||||
public static MOUNT_PET: string = 'UA_MOUNT_PET';
|
||||
public static TOGGLE_PET_RIDING_PERMISSION: string = 'UA_TOGGLE_PET_RIDING_PERMISSION';
|
||||
public static TOGGLE_PET_BREEDING_PERMISSION: string = 'UA_TOGGLE_PET_BREEDING_PERMISSION';
|
||||
public static DISMOUNT_PET: string = 'UA_DISMOUNT_PET';
|
||||
public static SADDLE_OFF: string = 'UA_SADDLE_OFF';
|
||||
public static TRAIN_PET: string = 'UA_TRAIN_PET';
|
||||
public static RESPECT_PET: string = 'UA_ RESPECT_PET';
|
||||
public static TREAT_PET: string = 'UA_TREAT_PET';
|
||||
public static REQUEST_PET_UPDATE: string = 'UA_REQUEST_PET_UPDATE';
|
||||
public static START_NAME_CHANGE: string = 'UA_START_NAME_CHANGE';
|
||||
public static PASS_CARRY_ITEM: string = 'UA_PASS_CARRY_ITEM';
|
||||
public static DROP_CARRY_ITEM: string = 'UA_DROP_CARRY_ITEM';
|
||||
public static GIVE_CARRY_ITEM_TO_PET: string = 'UA_GIVE_CARRY_ITEM_TO_PET';
|
||||
public static GIVE_WATER_TO_PET: string = 'UA_GIVE_WATER_TO_PET';
|
||||
public static GIVE_LIGHT_TO_PET: string = 'UA_GIVE_LIGHT_TO_PET';
|
||||
public static REQUEST_BREED_PET: string = 'UA_REQUEST_BREED_PET';
|
||||
public static HARVEST_PET: string = 'UA_HARVEST_PET';
|
||||
public static REVIVE_PET: string = 'UA_REVIVE_PET';
|
||||
public static COMPOST_PLANT: string = 'UA_COMPOST_PLANT';
|
||||
public static GET_BOT_INFO: string = 'UA_GET_BOT_INFO';
|
||||
public static REPORT_CFH_OTHER: string = 'UA_REPORT_CFH_OTHER';
|
||||
public static AMBASSADOR_ALERT_USER: string = 'UA_AMBASSADOR_ALERT_USER';
|
||||
public static AMBASSADOR_KICK_USER: string = 'UA_AMBASSADOR_KICK_USER';
|
||||
public static AMBASSADOR_MUTE_USER_2MIN: string = 'UA_AMBASSADOR_MUTE_2MIN';
|
||||
public static AMBASSADOR_MUTE_USER_10MIN: string = 'UA_AMBASSADOR_MUTE_10MIN';
|
||||
public static AMBASSADOR_MUTE_USER_60MIN: string = 'UA_AMBASSADOR_MUTE_60MIN';
|
||||
public static AMBASSADOR_MUTE_USER_18HOUR: string = 'UA_AMBASSADOR_MUTE_18HOUR';
|
||||
}
|
||||
|
||||
export function ProcessUserAction(userId: number, type: string): void
|
||||
{
|
||||
let userData: RoomUserData = null;
|
||||
|
||||
const petMessages = [
|
||||
UserAction.REQUEST_PET_UPDATE,
|
||||
UserAction.RESPECT_PET,
|
||||
UserAction.PICKUP_PET,
|
||||
UserAction.MOUNT_PET,
|
||||
UserAction.TOGGLE_PET_RIDING_PERMISSION,
|
||||
UserAction.TOGGLE_PET_BREEDING_PERMISSION,
|
||||
UserAction.DISMOUNT_PET,
|
||||
UserAction.SADDLE_OFF,
|
||||
UserAction.GIVE_CARRY_ITEM_TO_PET,
|
||||
UserAction.GIVE_WATER_TO_PET,
|
||||
UserAction.GIVE_LIGHT_TO_PET,
|
||||
UserAction.TREAT_PET
|
||||
];
|
||||
|
||||
if(petMessages.indexOf(type) >= 0)
|
||||
{
|
||||
userData = GetRoomSession().userDataManager.getPetData(userId);
|
||||
}
|
||||
else
|
||||
{
|
||||
userData = GetRoomSession().userDataManager.getUserData(userId);
|
||||
}
|
||||
|
||||
if(!userData) return
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case UserAction.RESPECT_USER:
|
||||
GetSessionDataManager().giveRespect(userId);
|
||||
return;
|
||||
case UserAction.RESPECT_PET:
|
||||
GetSessionDataManager().givePetRespect(userId);
|
||||
return;
|
||||
// case UserAction.WHISPER_USER:
|
||||
// this._container.events.dispatchEvent(new RoomWidgetChatInputContentUpdateEvent(RoomWidgetChatInputContentUpdateEvent.WHISPER, userData.name));
|
||||
// return;
|
||||
case UserAction.IGNORE_USER:
|
||||
GetSessionDataManager().ignoreUser(userData.name);
|
||||
return;
|
||||
case UserAction.UNIGNORE_USER:
|
||||
GetSessionDataManager().unignoreUser(userData.name);
|
||||
return;
|
||||
case UserAction.KICK_USER:
|
||||
GetRoomSession().sendKickMessage(userId);
|
||||
return;
|
||||
case UserAction.BAN_USER_DAY:
|
||||
case UserAction.BAN_USER_HOUR:
|
||||
case UserAction.BAN_USER_PERM:
|
||||
GetRoomSession().sendBanMessage(userId, type);
|
||||
return;
|
||||
case UserAction.MUTE_USER_2MIN:
|
||||
GetRoomSession().sendMuteMessage(userId, 2);
|
||||
return;
|
||||
case UserAction.MUTE_USER_5MIN:
|
||||
GetRoomSession().sendMuteMessage(userId, 5);
|
||||
return;
|
||||
case UserAction.MUTE_USER_10MIN:
|
||||
GetRoomSession().sendMuteMessage(userId, 10);
|
||||
return;
|
||||
case UserAction.GIVE_RIGHTS:
|
||||
GetRoomSession().sendGiveRightsMessage(userId);
|
||||
return;
|
||||
case UserAction.TAKE_RIGHTS:
|
||||
GetRoomSession().sendTakeRightsMessage(userId);
|
||||
return;
|
||||
// case UserAction.START_TRADING:
|
||||
// if(userData) this._widget.inventoryTrading.startTrade(userData.roomIndex, userData.name);
|
||||
// return;
|
||||
// case UserAction.OPEN_HOME_PAGE:
|
||||
// GetSessionDataManager()._Str_21275(userId, _local_3.name);
|
||||
// return;
|
||||
// case UserAction.PICKUP_PET:
|
||||
// GetRoomSession()._Str_13781(_local_2);
|
||||
// return;
|
||||
// case UserAction.MOUNT_PET:
|
||||
// GetRoomSession()._Str_21066(_local_2);
|
||||
// return;
|
||||
// case UserAction.TOGGLE_PET_RIDING_PERMISSION:
|
||||
// GetRoomSession()._Str_21025(_local_2);
|
||||
// return;
|
||||
// case UserAction.TOGGLE_PET_BREEDING_PERMISSION:
|
||||
// GetRoomSession()._Str_21562(_local_2);
|
||||
// return;
|
||||
// case UserAction.DISMOUNT_PET:
|
||||
// GetRoomSession()._Str_19075(_local_2);
|
||||
// return;
|
||||
// case UserAction.SADDLE_OFF:
|
||||
// GetRoomSession()._Str_21635(_local_2);
|
||||
// return;
|
||||
case UserAction.PASS_CARRY_ITEM:
|
||||
GetConnection().send(new RoomUnitGiveHandItemComposer(userId));
|
||||
return;
|
||||
// case UserAction.GIVE_CARRY_ITEM_TO_PET:
|
||||
// GetConnection().send(new RoomUnitGiveHandItemPetComposer(userId));
|
||||
// return;
|
||||
// case UserAction.GIVE_WATER_TO_PET:
|
||||
// GetConnection().send(new _Str_7251(_local_2, PetSupplementEnum._Str_9473));
|
||||
// return;
|
||||
// case UserAction.GIVE_LIGHT_TO_PET:
|
||||
// GetConnection().send(new _Str_7251(_local_2, PetSupplementEnum._Str_8421));
|
||||
// return;
|
||||
// case UserAction.TREAT_PET:
|
||||
// GetConnection().send(new _Str_8184(_local_2));
|
||||
// return;
|
||||
case UserAction.DROP_CARRY_ITEM:
|
||||
GetConnection().send(new RoomUnitDropHandItemComposer());
|
||||
return;
|
||||
case UserAction.REQUEST_PET_UPDATE:
|
||||
GetRoomSession().userDataManager.requestPetInfo(userId);
|
||||
return;
|
||||
case UserAction.REPORT:
|
||||
return;
|
||||
case UserAction.REPORT_CFH_OTHER:
|
||||
return;
|
||||
case UserAction.AMBASSADOR_ALERT_USER:
|
||||
GetRoomSession().sendAmbassadorAlertMessage(userId);
|
||||
return;
|
||||
case UserAction.AMBASSADOR_KICK_USER:
|
||||
GetRoomSession().sendKickMessage(userId);
|
||||
return;
|
||||
case UserAction.AMBASSADOR_MUTE_USER_2MIN:
|
||||
GetRoomSession().sendMuteMessage(userId, 2);
|
||||
return;
|
||||
case UserAction.AMBASSADOR_MUTE_USER_10MIN:
|
||||
GetRoomSession().sendMuteMessage(userId, 10);
|
||||
return;
|
||||
case UserAction.AMBASSADOR_MUTE_USER_60MIN:
|
||||
GetRoomSession().sendMuteMessage(userId, 60);
|
||||
return;
|
||||
case UserAction.AMBASSADOR_MUTE_USER_18HOUR:
|
||||
GetRoomSession().sendMuteMessage(userId, 1080);
|
||||
return;
|
||||
}
|
||||
}
|
17
src/api/nitro/session/RentableBotInfoData.ts
Normal file
17
src/api/nitro/session/RentableBotInfoData.ts
Normal file
@ -0,0 +1,17 @@
|
||||
export class RentableBotInfoData
|
||||
{
|
||||
constructor(
|
||||
public name: string = '',
|
||||
public motto: string = '',
|
||||
public webID: number = 0,
|
||||
public figure: string = '',
|
||||
public badges: string[] = [],
|
||||
public carryItem: number = 0,
|
||||
public userRoomId: number = 0,
|
||||
public amIOwner: boolean = false,
|
||||
public amIAnyRoomController: boolean = false,
|
||||
public roomControllerLevel: number = 0,
|
||||
public ownerId: number = -1,
|
||||
public ownerName: string = '',
|
||||
public botSkills: number[] = []) {}
|
||||
}
|
@ -1,6 +1,11 @@
|
||||
export class UserInfoData
|
||||
{
|
||||
public static OWN_USER: string = 'UID_OWN_USER';
|
||||
public static PEER: string = 'UID_PEER';
|
||||
public static BOT: string = 'UID_BOT';
|
||||
|
||||
constructor(
|
||||
public type: string,
|
||||
public name: string = '',
|
||||
public motto: string = '',
|
||||
public achievementScore: number = 0,
|
@ -1,6 +1,20 @@
|
||||
export * from './CanManipulateFurniture';
|
||||
export * from './FurnitureInfoData';
|
||||
export * from './GetBotInfoData';
|
||||
export * from './GetFurnitureDataForProductOffer';
|
||||
export * from './GetFurnitureInfoData';
|
||||
export * from './GetProductDataForLocalization';
|
||||
export * from './GetRentableBotInfoData';
|
||||
export * from './GetRoomObjectNameData';
|
||||
export * from './GetRoomSession';
|
||||
export * from './GetRoomSessionManager';
|
||||
export * from './GetSessionDataManager';
|
||||
export * from './GetUserInfoData';
|
||||
export * from './IsOwnerOfFurniture';
|
||||
export * from './ProcessFurniAction';
|
||||
export * from './ProcessUserAction';
|
||||
export * from './RentableBotInfoData';
|
||||
export * from './RoomObjectNameData';
|
||||
export * from './SendChatTypingMessage';
|
||||
export * from './StartRoomSession';
|
||||
export * from './UserInfoData';
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { EventDispatcher, IEventDispatcher, IRoomSession, RoomBackgroundColorEvent, RoomEngineDimmerStateEvent, RoomEngineEvent, RoomEngineObjectEvent, RoomId, RoomObjectCategory, RoomObjectHSLColorEnabledEvent, RoomObjectOperationType, RoomSessionEvent, RoomZoomEvent } from 'nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { IsFurnitureSelectionDisabled } from '../../api/nitro/room/IsFurnitureSelectionDisabled';
|
||||
import { ProcessRoomObjectOperation } from '../../api/nitro/room/ProcessRoomObjectOperation';
|
||||
import { SetActiveRoomId } from '../../api/nitro/room/SetActiveRoomId';
|
||||
import { CanManipulateFurniture } from '../../api/nitro/session/CanManipulateFurniture';
|
||||
import { GetRoomSession } from '../../api/nitro/session/GetRoomSession';
|
||||
import { StartRoomSession } from '../../api/nitro/session/StartRoomSession';
|
||||
import { useRoomEngineEvent } from '../../hooks/events/nitro/room/room-engine-event';
|
||||
@ -10,8 +12,6 @@ import { RoomErrorHandler } from '../room-error-handler/RoomErrorHandler';
|
||||
import { RoomView } from '../room/RoomView';
|
||||
import { RoomWidgetRoomEngineUpdateEvent, RoomWidgetRoomObjectUpdateEvent } from '../room/widgets/events';
|
||||
import { RoomHostViewProps } from './RoomHostView.types';
|
||||
import { CanManipulateFurniture } from './utils/CanManipulateFurniture';
|
||||
import { IsFurnitureSelectionDisabled } from './utils/IsFurnitureSelectionDisabled';
|
||||
|
||||
export const RoomHostView: FC<RoomHostViewProps> = props =>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user