Skip to content

Commit

Permalink
feat: block player movement (#991)
Browse files Browse the repository at this point in the history
* Pointed to feature branch in protocol and built it in the SDK to generate the new classes

* Added proto-squad suggested approach to player freeze. Original or this one will be deleted after testing and choosing one.

* rebuild proto component with new optional params for testing

* updated protocol

* Updated protocol

* updated protocol to remove disableCamera property

* Updated protocol to point to latest. Added MapPin component ID to protocol-buffer-generation non-exposed list. Rebuilt proto classes. Added test for serialization of InputModifier component

* Formatting cleanup

* Prettier pass

* Test to fix lint check

* Another test fo fix lint errors

* add missing test

---------

Co-authored-by: Gonzalo DCL <gonzalo@decentraland.org>
  • Loading branch information
AlejandroAlvarezMelucciDCL and gonpombo8 authored Sep 4, 2024
1 parent b049f13 commit f652672
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 21 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/decentraland/js-sdk-toolchain/issues",
"dependencies": {
"@actions/core": "^1.10.0",
"@dcl/protocol": "1.0.0-10043247792.commit-428d1eb",
"@dcl/protocol": "1.0.0-10670971402.commit-227b327",
"@dcl/quickjs-emscripten": "^0.21.0-3680274614.commit-1808aa1",
"@dcl/ts-proto": "1.153.0",
"@types/fs-extra": "^9.0.12",
Expand Down
45 changes: 45 additions & 0 deletions packages/@dcl/playground-assets/etc/playground-assets.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ export const componentDefinitionByName: {
"core::EngineInfo": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBEngineInfo>>;
"core::GltfContainer": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBGltfContainer>>;
"core::GltfContainerLoadingState": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBGltfContainerLoadingState>>;
"core::InputModifier": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBInputModifier>>;
"core::Material": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMaterial>>;
"core::MeshCollider": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshCollider>>;
"core::MeshRenderer": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshRenderer>>;
Expand Down Expand Up @@ -1384,6 +1385,9 @@ export const enum InputAction {
IA_WALK = 9
}

// @public (undocumented)
export const InputModifier: LastWriteWinElementSetComponentDefinition<PBInputModifier>;

// @public
export const inputSystem: IInputSystem;

Expand Down Expand Up @@ -2303,6 +2307,47 @@ export namespace PBGltfContainerLoadingState {
export function encode(message: PBGltfContainerLoadingState, writer?: _m0.Writer): _m0.Writer;
}

// @public (undocumented)
export interface PBInputModifier {
// (undocumented)
mode?: {
$case: "standard";
standard: PBInputModifier_StandardInput;
} | undefined;
}

// @public (undocumented)
export namespace PBInputModifier {
// (undocumented)
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBInputModifier;
// (undocumented)
export function encode(message: PBInputModifier, writer?: _m0.Writer): _m0.Writer;
}

// @public (undocumented)
export interface PBInputModifier_StandardInput {
// (undocumented)
disableAll?: boolean | undefined;
// (undocumented)
disableEmote?: boolean | undefined;
// (undocumented)
disableJog?: boolean | undefined;
// (undocumented)
disableJump?: boolean | undefined;
// (undocumented)
disableRun?: boolean | undefined;
// (undocumented)
disableWalk?: boolean | undefined;
}

// @public (undocumented)
export namespace PBInputModifier_StandardInput {
// (undocumented)
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBInputModifier_StandardInput;
// (undocumented)
export function encode(message: PBInputModifier_StandardInput, writer?: _m0.Writer): _m0.Writer;
}

// @public (undocumented)
export interface PBMaterial {
// (undocumented)
Expand Down
18 changes: 9 additions & 9 deletions packages/@dcl/sdk-commands/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@dcl/sdk-commands/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@dcl/inspector": "file:../inspector",
"@dcl/linker-dapp": "^0.12.0",
"@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be",
"@dcl/protocol": "1.0.0-10043247792.commit-428d1eb",
"@dcl/protocol": "1.0.0-10670971402.commit-227b327",
"@dcl/quests-client": "^1.0.3",
"@dcl/quests-manager": "^0.1.4",
"@dcl/rpc": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion scripts/protocol-buffer-generation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import fs from 'fs-extra'
import { FileDescriptorStandardOption, runCommand } from '../utils/shellCommand'
import { PROTO_COMPILER_PATH, TS_PROTO_PLUGIN_PATH } from './protoConst'

const NON_EXPOSED_LIST: number[] = []
const NON_EXPOSED_LIST: number[] = [1097]

/**
* @param componentPath - Argument of execution '--component-path'
Expand Down
23 changes: 23 additions & 0 deletions test/ecs/components/InputModifier.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { components, Engine } from '../../../packages/@dcl/ecs/src'
import { testComponentSerialization } from './assertion'

describe('Generated InputModifier ProtoBuf', () => {
it('should serialize/deserialize InputModifier', () => {
const newEngine = Engine()
const InputModifier = components.InputModifier(newEngine)

testComponentSerialization(InputModifier, {
mode: {
$case: 'standard',
standard: {
disableAll: true,
disableWalk: true,
disableJog: true,
disableRun: true,
disableJump: true,
disableEmote: true
}
}
})
})
})
18 changes: 18 additions & 0 deletions test/ecs/components/MapPin.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Engine } from '../../../packages/@dcl/ecs/src'
import { MapPinSchema } from '../../../packages/@dcl/ecs/src/components/generated/MapPin.gen'
import { testComponentSerialization } from './assertion'

describe('Generated Billboard ProtoBuf', () => {
it('should serialize/deserialize Billboard', () => {
const newEngine = Engine()
const MapPin = newEngine.defineComponentFromSchema('core::MapPin', MapPinSchema)

testComponentSerialization(MapPin, {
description: 'casla',
iconSize: 8,
position: { x: 8, y: 8 },
title: 'boedo',
texture: undefined
})
})
})
4 changes: 2 additions & 2 deletions test/snapshots/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f652672

Please sign in to comment.