Configuration changes

This commit is contained in:
Bill 2022-03-15 15:11:57 -04:00
parent 80b2635a22
commit 9d00bdb4b9
5 changed files with 49 additions and 56 deletions

View File

@ -1,7 +0,0 @@
BROWSER=none
GENERATE_SOURCEMAP=false
REACT_APP_CONFIG_URLS=/renderer-config.json,/ui-config.json
REACT_APP_SOCKET_URL=wss://ws.server.com:2096
REACT_APP_ASSET_URL=https://nitro.server.com
REACT_APP_IMAGE_LIBRARY_URL=https://swf.server.com/c_images/
REACT_APP_HOF_FURNI_URL=https://swf.server.com/dcr/hof_furni

View File

@ -1,46 +1,50 @@
# Getting Started with Create React App
# Nitro React
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Prerequisites
## Available Scripts
- You must have [git](https://git-scm.com/) installed
- You must have [NodeJS](https://nodejs.org/) >= 16.13 installed
- We recommend you use [Yarn](https://yarnpkg.com/) over [npm](https://npmjs.com/)
- `npm i yarn -g`
In the project directory, you can run:
## Installation
### `npm start`
- First you should open terminal and navigate to the folder where you want to clone Nitro
- Clone Nitro
- `git clone https://git.krews.org/nitro/nitro-react.git`
- Install the dependencies
- `yarn install`
- This may take some time, please be patient
- Rename a few files
- Rename `public/renderer-config.json.example` to `public/renderer-config.json`
- Rename `public/ui-config.json.example` to `public/ui-config.json`
- Set your links
- Open `public/renderer-config.json`
- Update `socket.url, asset.url, image.library.url, & hof.furni.url`
- Open `public/ui-config.json`
- Update `camera.url, thumbnails.url, url.prefix, habbopages.url`
- You can override any variable by passing it to `NitroConfig` in the index.html
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
## Usage
The page will reload if you make edits.\
You will also see any lint errors in the console.
- To use Nitro you need `.nitro` assets generated, see [nitro-converter](https://git.krews.org/nitro/nitro-converter) for instructions
- See [Morningstar Websockets](https://git.krews.org/nitro/ms-websockets) for instructions on configuring websockets on your server
### `npm test`
### Development
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
Run Nitro in development mode when you are editing the files, this way you can see the changes in your browser instantly
### `npm run build`
```
yarn start
```
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
### Production
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
To build a production version of Nitro just run the following command
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
```
yarn build:prod
```
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
- A `build` folder will be generated, these are the files that must be uploaded to your webserver
- Consult your CMS documentation for compatibility with Nitro and how to add the production files

View File

@ -1,13 +1,14 @@
{
"name": "nitro-react",
"version": "0.1.0",
"version": "2.0.0",
"private": true,
"scripts": {
"start": "craco start",
"build": "craco --max_old_space_size=8048 build",
"build:prod": "npx browserslist@latest --update-db && yarn install && yarn build",
"build": "GENERATE_SOURCEMAP=false BROWSER=none craco build",
"build:prod": "npx browserslist@latest --update-db && yarn build",
"test": "craco test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"postinstall": "node ./post-install.js"
},
"dependencies": {
"@craco/craco": "^6.3.0",

View File

@ -22,12 +22,8 @@
<div id="root" class="w-100 h-100"></div>
<script>
const NitroConfig = {
"config.urls": ("%REACT_APP_CONFIG_URLS%").split(','),
"sso.ticket": (new URLSearchParams(window.location.search).get('sso') || null),
"socket.url": "%REACT_APP_SOCKET_URL%",
"asset.url": "%REACT_APP_ASSET_URL%",
"image.library.url": "%REACT_APP_IMAGE_LIBRARY_URL%",
"hof.furni.url": "%REACT_APP_HOF_FURNI_URL%"
"config.urls": [ '/renderer-config.json', '/ui-config.json' ],
"sso.ticket": (new URLSearchParams(window.location.search).get('sso') || null)
};
</script>
</body>

View File

@ -1,8 +1,8 @@
{
"socket.url": "",
"asset.url": "",
"image.library.url": "",
"hof.furni.url": "",
"socket.url": "wss://ws.website.com:2096",
"asset.url": "https://website.com",
"image.library.url": "https://website.com/c_images/",
"hof.furni.url": "https://website.com/dcr/hof_furni",
"images.url": "${asset.url}/images",
"gamedata.url": "${asset.url}/gamedata",
"sounds.url": "${asset.url}/sounds/%sample%.mp3",
@ -21,14 +21,13 @@
"pet.asset.url": "${asset.url}/bundled/pet/%libname%.nitro",
"generic.asset.url": "${asset.url}/bundled/generic/%libname%.nitro",
"badge.asset.url": "${image.library.url}album1584/%badgename%.gif",
"badge.asset.grouparts.url": "${image.library.url}Badgeparts/badgepart_%part%.png",
"furni.rotation.bounce.steps": 20,
"furni.rotation.bounce.height": 0.0625,
"enable.avatar.arrow": false,
"system.animation.fps": 24,
"system.limits.fps": false,
"system.dispatcher.log": false,
"system.packet.log": true,
"system.packet.log": false,
"system.pong.manually": true,
"system.pong.interval.ms": 20000,
"room.color.skip.transition": true,