Skip to content

Commit

Permalink
Merge branch 'master' into pr/217
Browse files Browse the repository at this point in the history
  • Loading branch information
digisomni committed Apr 11, 2024
2 parents e33ee6c + 527315b commit 5fdc491
Show file tree
Hide file tree
Showing 12 changed files with 1,238 additions and 5,972 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,7 @@ npm run build-desktop
```sh
npm run update-contributors
```

## Development of Worlds

To develop worlds faster, you may put local models into the `public/local-assets` folder, then reference them in your entity tree like so `/local-assets/yourModel.glb`. The asset should now be available to you in-world.
7,169 changes: 1,209 additions & 5,960 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vircadia-web",
"version": "2023.1.5",
"version": "2024.1.0",
"description": "Vircadia open source metaverse web interface for agent-based virtual worlds.",
"productName": "Vircadia Web",
"author": "DigiSomni LLC | Vircadia Contributors",
Expand All @@ -24,7 +24,7 @@
"@babylonjs/inspector": "^6.24.0",
"@babylonjs/loaders": "^6.24.0",
"@quasar/extras": "^1.0.0",
"@vircadia/web-sdk": "^2023.1.2",
"@vircadia/web-sdk": "^2024.1.0",
"@vueuse/core": "^10.1.2",
"ammojs-typed": "^1.0.6",
"dompurify": "^3.0.3",
Expand Down Expand Up @@ -73,4 +73,3 @@
"Julien Merzoug <julien.merzoug@protonmail.com>"
]
}

Binary file added public/local-assets/test.glb
Binary file not shown.
Binary file removed public/test.glb
Binary file not shown.
1 change: 1 addition & 0 deletions quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ module.exports = configure(function(ctx) {
env: {
// Default Connection Config
VRCA_DEFAULT_METAVERSE_URL: process.env.VRCA_DEFAULT_METAVERSE_URL ?? "https://metaverse.vircadia.com/live",
VRCA_DEFAULT_ICE_SERVERS: process.env.VRCA_DEFAULT_ICE_SERVERS ?? '[ { "urls": ["stun:stun1.l.google.com:19302", "stun:stun4.l.google.com:19302"] } ]',
VRCA_DEFAULT_DOMAIN_PROTOCOL: process.env.VRCA_DEFAULT_DOMAIN_PROTOCOL ?? "wss:",
VRCA_DEFAULT_DOMAIN_PORT: process.env.VRCA_DEFAULT_DOMAIN_PORT ?? "40102",
VRCA_DEFAULT_DOMAIN_URL: process.env.VRCA_DEFAULT_DOMAIN_URL ?? "wss://antares.digisomni.com/0,0,0/0,0,0,1",
Expand Down
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ declare namespace NodeJS {
VUE_ROUTER_MODE: "hash" | "history" | "abstract" | undefined;
VUE_ROUTER_BASE: string | undefined;
VRCA_DEFAULT_METAVERSE_URL: string;
VRCA_DEFAULT_ICE_SERVERS: string;
VRCA_DEFAULT_DOMAIN_PROTOCOL: string;
VRCA_DEFAULT_DOMAIN_PORT: string;
VRCA_DEFAULT_DOMAIN_URL: string;
Expand Down
8 changes: 5 additions & 3 deletions src/modules/account/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ export const Account = {
*/
async createAccount(pUsername: string, pPassword: string, pEmail: string): Promise<PostUsersResponse | false> {
const request = {
username: pUsername,
password: pPassword,
email: pEmail
user: {
username: pUsername,
password: pPassword,
email: pEmail
}
} as PostUsersRequest;
try {
const response = await API.post(API.endpoints.users, request) as PostUsersResponse;
Expand Down
5 changes: 3 additions & 2 deletions src/modules/domain/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Allow getters to be compact.
/* eslint-disable @typescript-eslint/brace-style */

import { DomainServer, SignalEmitter, Camera, EntityServer } from "@vircadia/web-sdk";
import { DomainServer, SignalEmitter, Camera, EntityServer, IceServerConfig } from "@vircadia/web-sdk";
import { Account } from "@Modules/account";
import { DomainAudioClient } from "@Modules/domain/audio";
import { DomainMessageClient } from "@Modules/domain/message";
Expand Down Expand Up @@ -135,7 +135,8 @@ export class Domain {
}

Log.debug(Log.types.NETWORK, `Creating a new DomainServer.`);
this._domain = new DomainServer();
const iceServers = JSON.parse(applicationStore.defaultConnectionConfig.DEFAULT_ICE_SERVERS) as Array<IceServerConfig>;
this._domain = new DomainServer(iceServers);
this._domain.metaverseServerURL = this.getMetaverseUrl();
this._domain.account.authRequired.connect(() => {
console.debug("AUTH REQUIRED: Open login dialog");
Expand Down
8 changes: 7 additions & 1 deletion src/modules/metaverse/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ export class API {
*/
public static async post(path: string, body: FormData | KeyedCollection, metaverseUrl?: string): Promise<unknown> {
const requestConfig = this.buildRequestConfig("POST");
requestConfig.body = body;
requestConfig.body = body instanceof FormData ? body : JSON.stringify(body);
if (!(body instanceof FormData)) {
requestConfig.headers = {
"Accept": "application/json",
"Content-Type": "application/json"
};
}
const response = await fetch(this.buildUrl(path, metaverseUrl), requestConfig);
const data = await response.json() as APIResponse;
// The info and token endpoints do not return data in the usual format.
Expand Down
8 changes: 5 additions & 3 deletions src/modules/metaverse/APIAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ export interface GetAccountByIdResponse {
// Create an account.
export const PostUsersAPI = "/api/v1/users";
export interface PostUsersRequest extends KeyedCollection {
"username": string,
"password": string,
"email": string
"user": {
"username": string,
"password": string,
"email": string
}
}
export interface PostUsersResponse {
"accountId": string,
Expand Down
1 change: 1 addition & 0 deletions src/stores/application-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const useApplicationStore = defineStore("application", {
},
defaultConnectionConfig: {
DEFAULT_METAVERSE_URL: process.env.VRCA_DEFAULT_METAVERSE_URL,
DEFAULT_ICE_SERVERS: process.env.VRCA_DEFAULT_ICE_SERVERS,
DEFAULT_DOMAIN_PROTOCOL: process.env.VRCA_DEFAULT_DOMAIN_PROTOCOL,
DEFAULT_DOMAIN_PORT: process.env.VRCA_DEFAULT_DOMAIN_PORT,
DEFAULT_DOMAIN_URL: process.env.VRCA_DEFAULT_DOMAIN_URL
Expand Down

0 comments on commit 5fdc491

Please sign in to comment.