🎉
- Git
- MongoDB (not tested against other DBs)
- Node 10.x
The game is only tested against MongoDB. TypeORM currently lacks support for joins, etc and these are done manually. Additionally, the seed
process requires using MongoDB. This could be cleaned up in the future, but is not a priority right now.
Additionally, it is recommended to set up a mLab account for your MongoDB tests. This is what IdleLands uses. Some developers have reported trouble setting up a local MongoDB due to some strange errors that don't exist when using mLab.
- Clone the repo
npm install
npm run setup
- Create
.env
file (seeEnvironment Variables
)
Create a .env
file in the root of the cloned project and fill it with these values.
TYPEORM_CONNECTION
- the DB type (you probably want to usemongodb
)TYPEORM_URL
- the URL to connect to the DBTYPEORM_SYNCHRONIZE
- set totrue
TYPEORM_ENTITIES
- set tosrc/shared/models/entity/**/*.ts
These variables will change how the game plays.
GAME_DELAY
- the game loop delay (each tick is 1GAME_DELAY
). Default:5000
ms.SAVE_DELAY
- the number of ticks the game will save per interval. Default15
ticks.GRACE_PERIOD_DISCONNECT
- the delay between disconnect and character exiting game. Default:30000
ms.
Redis variables will enable use of Redis to scale horizontally.
SCC_BROKER_REDIS_HOST
- the URL to the Redis instanceSCC_BROKER_REDIS_PORT
- the port of the Redis instance
Firebase variables are used to set up Firebase, which is used only to sync accounts based on a uid.
FIREBASE_ADMIN_DATABASE
- the admin database URL for firebase. Should be in the formathttps://<DATABASE_NAME>.firebaseio.com
.FIREBASE_ADMIN_JSON
- the JSON blob (stringified) for a service account private key. You can read how to do that here. This needs to be encoded as base64 with LZUTF8.
Stripe variables need to be set up to accept payments via Stripe.
STRIPE_KEY
the private stripe key.
Discord variables are used to connect to Discord, which will sync chat between the game/Discord. You will also need to set up a Discord bot and give it sufficient permissions to post messages/emoji, create/modify channels, and create/modify roles. Your bot will either need to be an administrator or have these permissions.
DISCORD_SECRET
- the Discord API secret for your created Discord botDISCORD_GUILD_ID
- the Discord guild ID for the Discord bot to reside inDISCORD_CHANNEL_ID
- the Discord channel ID for the chat bridgeDISCORD_CUSTOM_ITEM_CHANNEL_ID
- the Discord channel ID to send custom item submissions toDISCORD_GUILD_CHANNEL_GROUP_ID
- the Discord channel CATEGORY ID to put guild channels in
You will also need the following roles:
Verified
Guild Mod
IL3 variables are used to connect to the old DB for the purposes of character imports.
IDLELANDS3_MONGODB_URI
- the MongoDB URI to the old IdleLands 3 Mongo instance
npm run start:server
- start the servernpm run start:client
- start the client
If you have trouble or slowness running IdleLands server on Windows, try using TS_NODE_TRANSPILE_ONLY=1
as an env variable. This will alleviate most issues.
To test any moderator-related features, you will need to be a GM. Doing so is as easy a quick DB query:
db.getCollection('player').update({ name: 'YOUR_CHARACTER_NAME' }, { $set: { modTier: 5 } });