diff --git a/api/src/api.ts b/api/src/api.ts index 0dd0598c..df874925 100644 --- a/api/src/api.ts +++ b/api/src/api.ts @@ -7,6 +7,7 @@ import morgan from 'morgan'; import { adminRoutes, avatarRoutes, + blackmarketRoutes, blockRoutes, clubRoutes, colonyRoutes, @@ -63,6 +64,7 @@ app.use('/api/messageboard', messageboardRoutes); app.use('/api/admin', adminRoutes); app.use('/api/inbox', inboxRoutes); app.use('/api/mall', mallRoutes); +app.use('/api/blackmarket', blackmarketRoutes); app.use('/api/fleamarket', fleamarketRoutes); app.use('/api/club', clubRoutes); app.use('/api/vote', voteRoutes); diff --git a/api/src/controllers/blackmarket.controller.ts b/api/src/controllers/blackmarket.controller.ts new file mode 100644 index 00000000..f8f9314b --- /dev/null +++ b/api/src/controllers/blackmarket.controller.ts @@ -0,0 +1,41 @@ +import { Request, Response } from 'express'; +import { Container } from 'typedi'; + +import { + MemberService, + BlackMarketService, +} from '../services'; + +class BlackmarketController { + constructor( + private memberService: MemberService, + private blackMarketService: BlackMarketService, + + ) {} + + public async canAdmin(request: Request, response: Response): Promise { + const { apitoken } = request.headers; + + try { + const session = this.memberService.decodeMemberToken(apitoken); + if (!session || !(await this.blackMarketService.canAdmin(session.id))) { + response.status(400).json({ + error: 'Invalid or missing token or access denied.', + }); + return; + } + response.status(200).json({ status: 'success' }); + } catch (error) { + console.error(error); + response.status(400).json({ error }); + } + } + + +} +const memberService = Container.get(MemberService); +const blackmarketService = Container.get(BlackMarketService); +export const blackmarketController = new BlackmarketController( + memberService, + blackmarketService, +); diff --git a/api/src/controllers/index.ts b/api/src/controllers/index.ts index 8b70ceec..2d35e7fe 100644 --- a/api/src/controllers/index.ts +++ b/api/src/controllers/index.ts @@ -1,5 +1,6 @@ export * from './admin.controller'; export * from './avatar.controller'; +export * from './blackmarket.controller'; export * from './block.controller'; export * from './club.controller'; export * from './colony.controller'; diff --git a/api/src/controllers/object-instance.controller.ts b/api/src/controllers/object-instance.controller.ts index e258ae50..bc67b363 100644 --- a/api/src/controllers/object-instance.controller.ts +++ b/api/src/controllers/object-instance.controller.ts @@ -1,6 +1,11 @@ import { Request, Response } from 'express'; import { Container } from 'typedi'; -import { MemberService, ObjectInstanceService, PlaceService, FleaMarketService } from '../services'; +import { + MemberService, + ObjectInstanceService, + PlaceService, + FleaMarketService, + BlackMarketService } from '../services'; import * as badwords from 'badwords-list'; class ObjectInstanceController { @@ -9,6 +14,7 @@ class ObjectInstanceController { private placeService: PlaceService, private memberService: MemberService, private fleaMarketService: FleaMarketService, + private blackMarketService: BlackMarketService, ) {} /** Stores the position of an object instance in the database */ @@ -36,6 +42,9 @@ class ObjectInstanceController { if(place.slug === 'fleamarket'){ adminStatus = await this.fleaMarketService.canAdmin(session.id); } + if(place.slug === 'blackmarket'){ + adminStatus = await this.blackMarketService.canAdmin(session.id); + } if (!adminStatus && objectInstance.member_id != session.id) { throw new Error('Not the owner of this object'); } @@ -74,7 +83,10 @@ class ObjectInstanceController { const objectInstance = await this.objectInstanceService.find(id); const place = await this.placeService.findById(Number.parseInt(request.body.placeId)); - if (place.slug !== 'fleamarket' && place.member_id != session.id) { + if ( + place.slug !== 'fleamarket' && + place.slug !== 'blackmarket' && + place.member_id != session.id) { throw new Error('Not the owner of this place'); } @@ -235,6 +247,9 @@ class ObjectInstanceController { if(place.slug === 'fleamarket'){ adminStatus = await this.fleaMarketService.canAdmin(session.id); } + if(place.slug === 'blackmarket'){ + adminStatus = await this.blackMarketService.canAdmin(session.id); + } if (!adminStatus && objectInstance.member_id != session.id) { throw new Error('Not the owner of this object'); @@ -251,9 +266,11 @@ const objectInstanceService = Container.get(ObjectInstanceService); const placeService = Container.get(PlaceService); const memberService = Container.get(MemberService); const fleaMarketService = Container.get(FleaMarketService); +const blackMarketService = Container.get(BlackMarketService); export const objectInstanceController = new ObjectInstanceController( objectInstanceService, placeService, memberService, fleaMarketService, + blackMarketService, ); diff --git a/api/src/routes/blackmarket.routes.ts b/api/src/routes/blackmarket.routes.ts new file mode 100644 index 00000000..fffbdb9c --- /dev/null +++ b/api/src/routes/blackmarket.routes.ts @@ -0,0 +1,14 @@ +import Router from 'express'; + +import { blackmarketController } from '../controllers'; + +/** + * This file sets up routing for home routes. + * @note All paths used here will be prepended with `/api/home`. + */ + +const blackmarketRoutes = Router(); +blackmarketRoutes.get('/can_admin', (request, response) => + blackmarketController.canAdmin(request, response)); + +export { blackmarketRoutes }; diff --git a/api/src/routes/index.ts b/api/src/routes/index.ts index ea117504..f3da49a6 100644 --- a/api/src/routes/index.ts +++ b/api/src/routes/index.ts @@ -1,5 +1,6 @@ export * from './admin.routes'; export * from './avatar.routes'; +export * from './blackmarket.routes'; export * from './block.routes'; export * from './club.routes'; export * from './colony.routes'; diff --git a/api/src/services/blackmarket/blackmarket.service.ts b/api/src/services/blackmarket/blackmarket.service.ts new file mode 100644 index 00000000..ceba759a --- /dev/null +++ b/api/src/services/blackmarket/blackmarket.service.ts @@ -0,0 +1,31 @@ +import { Service } from 'typedi'; + +import { + RoleAssignmentRepository, + RoleRepository, +} from '../../repositories'; + +/** Service for dealing with the flea market */ +@Service() +export class BlackMarketService { + constructor( + private roleAssignmentRepository: RoleAssignmentRepository, + private roleRepository: RoleRepository, + ) {} + + public async canAdmin(memberId: number): Promise { + const roleAssignments = await this.roleAssignmentRepository.getByMemberId(memberId); + if ( + roleAssignments.find(assignment => { + return [ + this.roleRepository.roleMap.Admin, + this.roleRepository.roleMap.BlackMarketDeputy, + this.roleRepository.roleMap.BlackMarketChief, + ].includes(assignment.role_id); + }) + ) { + return true; + } + return false; + } +} diff --git a/api/src/services/index.ts b/api/src/services/index.ts index 2b5b8cd1..9c0b10ec 100644 --- a/api/src/services/index.ts +++ b/api/src/services/index.ts @@ -1,5 +1,6 @@ export * from './admin/admin.services'; export * from './avatar/avatar.service'; +export * from './blackmarket/blackmarket.service'; export * from './block/block.service'; export * from './club/club.service'; export * from './colony/colony.service'; diff --git a/spa/assets/worlds/blackmarket/vrml/blackmarket.wrl b/spa/assets/worlds/blackmarket/vrml/blackmarket.wrl index dffa04a5..b3f9726a 100644 --- a/spa/assets/worlds/blackmarket/vrml/blackmarket.wrl +++ b/spa/assets/worlds/blackmarket/vrml/blackmarket.wrl @@ -7,418 +7,50 @@ EXTERNPROTO HUD[ eventIn MFNode removeChildren ] ["/externprotos/nodes_xite.wrl#HUD"] -#Inline { -#url "http://www.cybertown.com/places/no_cache/blackmarket/temp.wrl" -#} -PROTO SharedObject [ -exposedField SFVec3f translation 0 0 0 -exposedField SFRotation rotation 0 1 0 0 -exposedField SFString name "" -exposedField SFString id "" -exposedField MFNode children [ -] + +EXTERNPROTO BlaxxunZone [ +eventIn MFNode addEvents +eventIn MFNode removeEvents +eventIn MFNode addAvatars +eventIn MFNode removeAvatars +exposedField MFNode events +exposedField MFNode avatars +eventOut MFNode events_added +eventOut MFNode events_removed +eventOut MFNode avatars_added +eventOut MFNode avatars_removed +eventIn SFInt32 set_myAvatarGesture +eventIn SFInt32 myAvatarGestureFromServer +eventOut SFInt32 myAvatarGesture_changed +eventOut SFInt32 myAvatarGestureToServer +exposedField MFString sendToChat +exposedField SFFloat beamToDistance +exposedField MFString groupChatName +exposedField MFString groupChat +] "/externprotos/shared_xite.wrl#BlaxxunZone" + +EXTERNPROTO SharedObject [ +exposedField SFVec3f translation +exposedField SFRotation rotation +exposedField MFNode children +exposedField SFString name +exposedField SFString id eventIn SFBool startMove -eventOut SFTime touchTime eventOut SFBool isOver +eventOut SFTime touchTime eventOut SFVec3f newPosition eventOut SFRotation newRotation -exposedField MFFloat range [ -30 -] -] -{ -DEF T1 Transform { -translation IS translation -rotation IS rotation -children [ -DEF TS TouchSensor { -isOver IS isOver -touchTime IS touchTime -} +] "/externprotos/shared_xite.wrl#SharedObject" -LOD { -range IS range -level [ -Group { -children IS children -} -Group { -} -] -} -] -} -#BEGIN MOVE HUD CODE# -DEF SOSwitch Switch { -choice [ -Collision { -collide FALSE -children [ -DEF HUD HUD { -children [ -Transform { -translation .15 .08 -.3 -scale .8 .8 .8 -children [ -DirectionalLight { -} -Transform { -#Done Button -translation -.033 -.063 0 -scale .08 .08 .08 -children [ -DEF DoneButton TouchSensor { -} -Shape { -appearance Appearance { -material Material { -diffuseColor 0 1 0 -specularColor 0 1 0 -} -} -geometry IndexedFaceSet { -coord Coordinate { -point [ -0 0 0, -.15 .1 0, -.05 .15 0, 0 .05 0, .085 .3 0, .2 .25 0, +EXTERNPROTO SharedEvent [ +exposedField SFString name +exposedField SFString type +eventIn SFTime set_time +eventOut SFTime timeToServer +eventIn SFTime timeFromServer +eventOut SFTime time_changed +] [ "/externprotos/shared_xite.wrl#SharedEvent" ] -] -} -coordIndex [ -0 3 2 1 -1, 5 4 3 0 -1, -] -} -} -Transform { -translation 0 .1 0 -children Shape { -appearance Appearance { -material Material { -transparency 1 -} -} -geometry Sphere { -radius .3 -} -} -} -] -} -#END DoneButton -Transform { -#CancelButton -translation .033 -.054 0 -scale .07 .07 .07 -children [ -DEF CancelButton TouchSensor { -} -Shape { -appearance Appearance { -material Material { -diffuseColor 1 0 0 -specularColor 1 0 0 -} -} -geometry IndexedFaceSet { -coord Coordinate { -point [ -0 0 0, .15 -.1 0, .1 -.15 0, .15 .1 0, .1 .15 0, -.15 -.1 0, --.1 -.15 0, -.15 .1 0, -.1 .15 0, -] -} -coordIndex [ -0 2 1 -1, 0 3 4 -1, 0 5 6 -1, 0 8 7 -1, -] -} -} -Shape { -appearance Appearance { -material Material { -transparency 1 -} -} -geometry Sphere { -radius .2 -} -} -] -} -#END CancelButton -Transform { -#Rotation Control -translation 0 -.054 0 -scale .16 .16 .16 -children [ -DEF RotControlKnob Transform { -scale 1 .5 1 -children [ -Shape { -appearance Appearance { -material Material { -diffuseColor 0 0 .5 -specularColor 1 1 1 -} -} -geometry Sphere { -radius .1 -} -} -] -} -DEF RotControlSensor CylinderSensor { -minAngle -3.142 -maxAngle 3.142 -} -] -} -#END RotationControl -Transform { -#Panel -scale .1 .1 .1 -children [ -Transform { -translation .14 -.05 -.3 -children [ -Shape { -appearance Appearance { -material Material { -diffuseColor 0 0 0 -transparency .5 -} -} -geometry Box { -size 1 1.2 .01 -} -} -] -} -Transform { -# Y-axis -children [ -Transform { -translation 0 .05 0 -children [ -Shape { -appearance Appearance { -material Material { -transparency .1 -diffuseColor 0 1 0 -specularColor 0 1 0 -} -} -geometry DEF arrow IndexedFaceSet { -solid FALSE -coord Coordinate { -point [ --.05 0 0, -.05 .2 0, -.15 .2 0, 0 .35 0, .15 .2 0, .05 .2 0, -.05 0 0, -] -} -coordIndex [ -0 1 5 6 -1, 2 3 4 -1, -] -} -} -] -} -Transform { -translation 0 -.05 0 -rotation 0 0 1 3.142 -children [ -Shape { -appearance Appearance { -material Material { -diffuseColor 0 1 0 -specularColor 0 1 0 -} -} -geometry USE arrow -} -] -} -DEF Y PlaneSensor { -} -] -} -#END Y-axis -Transform { -# X-axis -children [ -Transform { -translation -.05 0 0 -rotation 0 0 1 1.571 -children [ -Shape { -appearance Appearance { -material Material { -diffuseColor 1 0 0 -specularColor 1 0 0 -} -} -geometry USE arrow -} -] -} -Transform { -translation .05 0 0 -rotation 0 0 1 -1.571 -children [ -Shape { -appearance Appearance { -material Material { -diffuseColor 1 0 0 -specularColor 1 0 0 -} -} -geometry USE arrow -} -] -} -DEF X PlaneSensor { -} -] -} -#END X-axis -Transform { -rotation 1 -.2 0 .8 -children [ -Transform { -#Z-axis -rotation 1 0 0 1.571 -children [ -Transform { -translation 0 .05 0 -rotation 0 0 1 -.1 -children [ -Shape { -appearance Appearance { -material Material { -transparency .1 -diffuseColor .2 .2 1 -specularColor 0 0 1 -} -} -geometry USE arrow -} -] -} -Transform { -translation 0 -.05 0 -rotation 0 0 1 3.042 -children [ -Shape { -appearance Appearance { -material Material { -diffuseColor .2 .2 1 -specularColor 0 0 1 -} -} -geometry USE arrow -} -] -} -DEF Z PlaneSensor { -} -] -} -#END Z-axis -] -} -] -} -#END panel -DEF SOScript Script { -eventIn SFVec3f set_X -eventIn SFVec3f set_Y -eventIn SFVec3f set_Z -eventIn SFRotation set_rotation -eventIn SFBool set_done -eventIn SFBool set_cancel -eventIn SFBool set_enable IS startMove -exposedField SFString name IS name exposedField SFString id IS id exposedField -SFFloat rate 10 field SFVec3f initialPosition IS translation -field SFRotation initialRotation IS rotation -field SFVec3f currentPosition 0 0 0 -field SFRotation currentRotation 0 0 0 0 -field SFVec3f XlastChange 0 0 0 -field SFVec3f YlastChange 0 0 0 -field SFVec3f ZlastChange 0 0 0 -field SFFloat ROTlastChange 0 -eventOut SFVec3f position_changed -eventOut SFRotation rotation_changed -eventOut SFVec3f new_position IS newPosition -eventOut SFRotation new_rotation IS newRotation -eventOut SFInt32 choice_changed -url "vrmlscript: -function set_enable(v,t){ -if(!v){return;} -choice_changed = 0; -} -function set_X(v,t){ -newPosition = (Browser.viewpointOrientation.multVec((new SFVec3f(v[0],0,0)).subtract(XlastChange))).multiply(rate); -currentPosition = currentPosition.add(newPosition); -position_changed = currentPosition; -XlastChange = new SFVec3f(v[0],0,0); -} -function set_Y(v,t){ -newPosition = (Browser.viewpointOrientation.multVec((new SFVec3f(0,v[1],0)).subtract(YlastChange))).multiply(rate); -currentPosition = currentPosition.add(newPosition); -position_changed = currentPosition; -YlastChange = new SFVec3f(0,v[1],0); -} -function set_Z(v,t){ -newPosition = (Browser.viewpointOrientation.multVec((new SFVec3f(0,0,v[1])).subtract(ZlastChange))).multiply(rate); -currentPosition = currentPosition.add(newPosition); -position_changed = currentPosition; -ZlastChange = new SFVec3f(0,0,v[1]); -} -function set_rotation(v,t){ -rotation_changed = v; -currentRotation = v; -} -function set_done(v,t){ -if(!v){return;} -new_position = currentPosition; -new_rotation = currentRotation; -initialRotation = currentRotation; -initialPosition = currentPosition; -choice_changed = -1; -} -function set_cancel(v,t){ -if(!v){return;} -choice_changed = -1; -position_changed = initialPosition; -rotation_changed = initialRotation; -} -function initialize() { -currentRotation = initialRotation; -currentPosition = initialPosition; -} -" -} -] -} -#END Collision -] -} -#END HUD -] -} -] -} -#END SOSwitch -ROUTE X.translation_changed TO SOScript.set_X -ROUTE Y.translation_changed TO SOScript.set_Y -ROUTE Z.translation_changed TO SOScript.set_Z -ROUTE RotControlSensor.rotation_changed TO RotControlKnob.set_rotation -ROUTE RotControlSensor.rotation_changed TO SOScript.set_rotation -ROUTE SOScript.position_changed TO T1.set_translation -ROUTE SOScript.rotation_changed TO T1.set_rotation -ROUTE DoneButton.isActive TO SOScript.set_done -ROUTE CancelButton.isActive TO SOScript.set_cancel -ROUTE SOScript.choice_changed TO SOSwitch.set_whichChoice -#END MOVE HUD CODE# -} -#END SharedObject PROTO NavigationInfo { avatarSize [0.25 1.75 0.75] visibilityLimit 0.0 @@ -1965,6 +1597,40 @@ children DEF TM TransportMessage { #&##################################################################### #End HUD ######################################################################## + +PROTO BlaxxunZone [#PROTO supplied by BLAXXUN +eventIn MFNode addEvents +eventIn MFNode removeEvents +eventIn MFNode addAvatars +eventIn MFNode removeAvatars +exposedField MFNode events [] +exposedField MFNode avatars [] +exposedField SFString myAvatarURL "" +exposedField SFString myAvatarName "" +exposedField SFFloat number_avatars 0 +eventOut MFNode avatars_added +eventOut MFNode avatars_removed +exposedField MFNode avatarLOD [] +exposedField MFFloat avatarRange [] +]{ +Transform { +addChildren IS addEvents +removeChildren IS removeEvents +children IS events +} +Transform { + addChildren IS addAvatars + removeChildren IS removeAvatars + children IS avatars +} +}# END BlaxxunZone + +DEF SharedZone BlaxxunZone { + events [ + + ] +} + #####blackmarket doors PROTO Transporter [ field SFBool enabled TRUE diff --git a/spa/assets/worlds/enter/vrml/enter.wrl b/spa/assets/worlds/enter/vrml/enter.wrl index a8bab070..c892094b 100644 --- a/spa/assets/worlds/enter/vrml/enter.wrl +++ b/spa/assets/worlds/enter/vrml/enter.wrl @@ -9,6 +9,81 @@ EXTERNPROTO HUD[ ] ["/externprotos/nodes_xite.wrl#HUD"] +EXTERNPROTO BlaxxunZone [ +eventIn MFNode addEvents +eventIn MFNode removeEvents +eventIn MFNode addAvatars +eventIn MFNode removeAvatars +exposedField MFNode events +exposedField MFNode avatars +eventOut MFNode events_added +eventOut MFNode events_removed +eventOut MFNode avatars_added +eventOut MFNode avatars_removed +eventIn SFInt32 set_myAvatarGesture +eventIn SFInt32 myAvatarGestureFromServer +eventOut SFInt32 myAvatarGesture_changed +eventOut SFInt32 myAvatarGestureToServer +exposedField MFString sendToChat +exposedField SFFloat beamToDistance +exposedField MFString groupChatName +exposedField MFString groupChat +] "/externprotos/shared_xite.wrl#BlaxxunZone" + +EXTERNPROTO SharedObject [ +exposedField SFVec3f translation +exposedField SFRotation rotation +exposedField MFNode children +exposedField SFString name +exposedField SFString id +eventIn SFBool startMove +eventOut SFBool isOver +eventOut SFTime touchTime +eventOut SFVec3f newPosition +eventOut SFRotation newRotation +] "/externprotos/shared_xite.wrl#SharedObject" + +EXTERNPROTO SharedEvent [ +exposedField SFString name +exposedField SFString type +eventIn SFTime set_time +eventOut SFTime timeToServer +eventIn SFTime timeFromServer +eventOut SFTime time_changed +] [ "/externprotos/shared_xite.wrl#SharedEvent" ] + +PROTO BlaxxunZone [#PROTO supplied by BLAXXUN +eventIn MFNode addEvents +eventIn MFNode removeEvents +eventIn MFNode addAvatars +eventIn MFNode removeAvatars +exposedField MFNode events [] +exposedField MFNode avatars [] +exposedField SFString myAvatarURL "" +exposedField SFString myAvatarName "" +exposedField SFFloat number_avatars 0 +eventOut MFNode avatars_added +eventOut MFNode avatars_removed +exposedField MFNode avatarLOD [] +exposedField MFFloat avatarRange [] +]{ +Transform { +addChildren IS addEvents +removeChildren IS removeEvents +children IS events +} +Transform { + addChildren IS addAvatars + removeChildren IS removeAvatars + children IS avatars +} +}# END BlaxxunZone + +DEF SharedZone BlaxxunZone { + events [ + + ] +} DEF Scene Group {} diff --git a/spa/assets/worlds/fleamarket/vrml/fleamarket.wrl b/spa/assets/worlds/fleamarket/vrml/fleamarket.wrl index 792690eb..d14b2d3a 100644 --- a/spa/assets/worlds/fleamarket/vrml/fleamarket.wrl +++ b/spa/assets/worlds/fleamarket/vrml/fleamarket.wrl @@ -122,74 +122,6 @@ function set_vec3f (value, time){if(debug){print(name + ' sent vec3f ev "} } -PROTO BlaxxunZone [#PROTO supplied by BLAXXUN -eventIn MFNode addEvents -eventIn MFNode removeEvents -eventIn MFNode addAvatars -eventIn MFNode removeAvatars -exposedField MFNode events [] -exposedField MFNode avatars [] -exposedField SFString myAvatarURL "" -exposedField SFString myAvatarName "" -exposedField SFFloat number_avatars 0 -eventOut MFNode avatars_added -eventOut MFNode avatars_removed -exposedField MFNode avatarLOD [] -exposedField MFFloat avatarRange [] -]{ -Transform { -addChildren IS addEvents -removeChildren IS removeEvents -children IS events -} -Transform { - addChildren IS addAvatars - removeChildren IS removeAvatars - children IS avatars -} -}# END BlaxxunZone - -DEF SharedZone BlaxxunZone { - events [ - - ] -} -DEF S Script { - eventIn MFNode addEvents IS addEvents - eventIn MFNode removeEvents IS removeEvents - eventIn MFNode addAvatars IS addAvatars - eventIn MFNode removeAvatars IS removeAvatars - eventIn MFNode addObjects IS addObjects - eventIn MFNode removeObjects IS removeObjects - eventIn SFString set_myAvatarURL IS set_myAvatarURL - eventOut MFNode events_added IS events_added - eventOut MFNode events_removed IS events_removed - eventOut MFNode avatars_added IS avatars_added - eventOut MFNode avatars_removed IS avatars_removed - eventOut MFNode objects_added IS objects_added - eventOut MFNode objects_removed IS objects_removed - eventIn SFInt32 set_myAvatarGesture IS set_myAvatarGesture - eventIn SFInt32 myAvatarGestureFromServer IS myAvatarGestureFromServer - eventOut SFInt32 myAvatarGesture_changed IS myAvatarGesture_changed - eventOut SFInt32 myAvatarGestureToServer IS myAvatarGestureToServer - eventOut SFString myAvatarURL_changed IS myAvatarURL_changed - exposedField MFString sendToChat IS sendToChat - exposedField SFFloat beamToDistance IS beamToDistance - exposedField MFString groupChatName IS groupChatName - exposedField MFString groupChat IS groupChat -url "vrmlscript: - function addEvents(value, time) { events_added = value; } - function addAvatars(value, time) { avatars_added = value; } - function addObjects(value, time) { objects_added = value; } - function removeEvents(value, time) { events_removed = value; } - function removeAvatars(value, time) { avatars_removed = value; } - function removeObjects(value, time) { objects_removed = value; } - function set_myAvatarGesture(value, time) { myAvatarGestureToServer = value; } - function myAvatarGestureFromServer(value, time) { myAvatarGesture_changed = value; } - function set_myAvatarURL(value, time) { myAvatarURL_changed = value; } -" -} - PROTO Booth[ field MFString number "15" field SFString description "Booth 15" diff --git a/spa/src/components/Chat.vue b/spa/src/components/Chat.vue index 05b94f89..f54e1d10 100644 --- a/spa/src/components/Chat.vue +++ b/spa/src/components/Chat.vue @@ -749,6 +749,7 @@ export default Vue.extend({ this.$store.data.view3d && ( this.$store.data.place.slug === 'fleamarket' || + this.$store.data.place.slug === 'blackmarket' || this.$store.data.place.member_id === this.$store.data.user.id )){ this.menuDrop = true; @@ -776,6 +777,11 @@ export default Vue.extend({ 'id': this.$store.data.user.id }); } + if(this.$store.data.place.slug === 'blackmarket'){ + admin = await this.$http.get("/blackmarket/can_admin", { + 'id': this.$store.data.user.id + }); + } if(admin && admin.data.status === 'success'){ this.canModify = true; if(this.$store.data.view3d){