Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #497 from mcottontensor/new_cirrus
Browse files Browse the repository at this point in the history
Add new Common and signalling libs and rewrite Cirrus (now Wilbur) to use them
  • Loading branch information
mcottontensor committed Feb 28, 2024
2 parents df94ba7 + ddc5151 commit 240e712
Show file tree
Hide file tree
Showing 180 changed files with 17,805 additions and 10,961 deletions.
5 changes: 3 additions & 2 deletions Common/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
dist
build
node_modules
types
package-lock.json
package.json
tsconfig.json
.eslintrc.js
.eslintrc.js
src/Messages/signalling_messages.ts
15 changes: 13 additions & 2 deletions Common/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended']
plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
"tsdoc/syntax": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
]
}
};
24 changes: 7 additions & 17 deletions Common/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
## lib-pixelstreamingcommon
# lib-pixelstreamingcommon

The common library for the browser/client side of Pixel Streaming experiences. This library exposes common functionality for frontend applications of the pixel streaming ecosystem.

See [lib-pixelstreamingfrontend](/Frontend/library) for an example of how to implement this library.
For examples of how to implement this library.
- See [lib-pixelstreamingfrontend](/Frontend/library)
- See [lib-pixelstreamingsignalling](/Signalling)
- Also see [Wilbur](/SignallingWebServer) which uses the signalling library to implement a full signalling server.

Currently exposed.
### Logger
A small helper class for handling logging across the pixel streaming infrastructure.

### ITransport
An interface to a transport protocol that is in charge of sending and receiving signalling messages. Users can make use of supplied transport protocols or implement their own transport protocol via extending this interface. They can then pass the transport into the constructor of `SignallingProtocol` which is explained below.

### WebSocketTransport
An `ITransport` implementation that sends signalling messages over a websocket. This is currently the only transport in use by the official pixel streaming frontend.

### SignallingProtocol
This is the object where the user should send/receive messages. Currently there are specific functions for specific messages sent, but in the future this should change to be more generic. You can specify your own transport protocol by passing an implementation of `ITransport` to this class, allowing you to send and receive messages through any protocol you wish.

### Adding it to your project
`npm i @epicgames-ps/lib-pixelstreamingcommon-ue5.5`
## Documentation
The API is documented [here](docs).
1 change: 1 addition & 0 deletions Common/docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
17 changes: 17 additions & 0 deletions Common/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@epicgames-ps/lib-pixelstreamingcommon-ue5.5

# @epicgames-ps/lib-pixelstreamingcommon-ue5.5

## Table of contents

### Modules

- [Logger/Logger](modules/Logger_Logger.md)
- [Messages/base\_message](modules/Messages_base_message.md)
- [Messages/message\_helpers](modules/Messages_message_helpers.md)
- [Messages/message\_registry](modules/Messages_message_registry.md)
- [Protocol/SignallingProtocol](modules/Protocol_SignallingProtocol.md)
- [Transport/ITransport](modules/Transport_ITransport.md)
- [Transport/WebSocketTransport](modules/Transport_WebSocketTransport.md)
- [Transport/WebSocketTransportNJS](modules/Transport_WebSocketTransportNJS.md)
- [pixelstreamingcommon](modules/pixelstreamingcommon.md)
206 changes: 206 additions & 0 deletions Common/docs/classes/Logger_Logger.Logger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
[@epicgames-ps/lib-pixelstreamingcommon-ue5.5](../README.md) / [Logger/Logger](../modules/Logger_Logger.md) / Logger

# Class: Logger

[Logger/Logger](../modules/Logger_Logger.md).Logger

A basic console logger utilized by the Pixel Streaming frontend to allow
logging to the browser console.

## Table of contents

### Constructors

- [constructor](Logger_Logger.Logger.md#constructor)

### Properties

- [verboseLogLevel](Logger_Logger.Logger.md#verboseloglevel)

### Methods

- [CommonLog](Logger_Logger.Logger.md#commonlog)
- [Error](Logger_Logger.Logger.md#error)
- [GetStackTrace](Logger_Logger.Logger.md#getstacktrace)
- [Info](Logger_Logger.Logger.md#info)
- [Log](Logger_Logger.Logger.md#log)
- [SetLoggerVerbosity](Logger_Logger.Logger.md#setloggerverbosity)
- [Warning](Logger_Logger.Logger.md#warning)

## Constructors

### constructor

**new Logger**(): [`Logger`](Logger_Logger.Logger.md)

#### Returns

[`Logger`](Logger_Logger.Logger.md)

## Properties

### verboseLogLevel

`Static` **verboseLogLevel**: `number` = `5`

#### Defined in

[Logger/Logger.ts:8](https://github.com/mcottontensor/PixelStreamingInfrastructure/blob/1d8a258/Common/src/Logger/Logger.ts#L8)

## Methods

### CommonLog

**CommonLog**(`level`, `stack`, `message`): `void`

The common log function that all other log functions call to.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `level` | `string` | the level of this log message. |
| `stack` | `string` | an optional stack trace string from where the log message was called. |
| `message` | `string` | the message to be logged. |

#### Returns

`void`

#### Defined in

[Logger/Logger.ts:87](https://github.com/mcottontensor/PixelStreamingInfrastructure/blob/1d8a258/Common/src/Logger/Logger.ts#L87)

___

### Error

**Error**(`stack`, `message`): `void`

The standard logging output

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `stack` | `string` | the stack trace |
| `message` | `string` | the message to be logged |

#### Returns

`void`

#### Defined in

[Logger/Logger.ts:68](https://github.com/mcottontensor/PixelStreamingInfrastructure/blob/1d8a258/Common/src/Logger/Logger.ts#L68)

___

### GetStackTrace

**GetStackTrace**(): `string`

Captures the stack and returns it

#### Returns

`string`

the current stack

#### Defined in

[Logger/Logger.ts:14](https://github.com/mcottontensor/PixelStreamingInfrastructure/blob/1d8a258/Common/src/Logger/Logger.ts#L14)

___

### Info

**Info**(`stack`, `message`, `verbosity?`): `void`

The standard logging output

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `stack` | `string` | the stack trace |
| `message` | `string` | the message to be logged |
| `verbosity?` | `number` | the verbosity level |

#### Returns

`void`

#### Defined in

[Logger/Logger.ts:55](https://github.com/mcottontensor/PixelStreamingInfrastructure/blob/1d8a258/Common/src/Logger/Logger.ts#L55)

___

### Log

**Log**(`stack`, `message`, `verbosity?`): `void`

The standard logging output

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `stack` | `string` | the stack trace |
| `message` | `string` | the message to be logged |
| `verbosity?` | `number` | the verbosity level |

#### Returns

`void`

#### Defined in

[Logger/Logger.ts:41](https://github.com/mcottontensor/PixelStreamingInfrastructure/blob/1d8a258/Common/src/Logger/Logger.ts#L41)

___

### SetLoggerVerbosity

**SetLoggerVerbosity**(`verboseLogLevel`): `void`

Set the log verbosity level

#### Parameters

| Name | Type |
| :------ | :------ |
| `verboseLogLevel` | `number` |

#### Returns

`void`

#### Defined in

[Logger/Logger.ts:29](https://github.com/mcottontensor/PixelStreamingInfrastructure/blob/1d8a258/Common/src/Logger/Logger.ts#L29)

___

### Warning

**Warning**(`stack`, `message`): `void`

The standard logging output

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `stack` | `string` | the stack trace |
| `message` | `string` | the message to be logged |

#### Returns

`void`

#### Defined in

[Logger/Logger.ts:77](https://github.com/mcottontensor/PixelStreamingInfrastructure/blob/1d8a258/Common/src/Logger/Logger.ts#L77)

0 comments on commit 240e712

Please sign in to comment.