diff --git a/packages/app-api/src/controllers/UserController.ts b/packages/app-api/src/controllers/UserController.ts index 7b9611e273..c09369f135 100644 --- a/packages/app-api/src/controllers/UserController.ts +++ b/packages/app-api/src/controllers/UserController.ts @@ -151,7 +151,7 @@ export class UserController { } @Get('/me') - @UseBefore(AuthService.getAuthMiddleware([])) + @UseBefore(AuthService.getAuthMiddleware([], false)) @ResponseSchema(MeOutoutDTOAPI) @OpenAPI({ summary: 'Get the current logged in user', diff --git a/packages/app-api/src/service/AuthService.ts b/packages/app-api/src/service/AuthService.ts index 1a61f36e38..c3c1212327 100644 --- a/packages/app-api/src/service/AuthService.ts +++ b/packages/app-api/src/service/AuthService.ts @@ -13,7 +13,7 @@ import { Routes, RESTGetAPICurrentUserGuildsResult } from 'discord-api-types/v10 import oauth from 'passport-oauth2'; import { DiscordService } from './DiscordService.js'; import { domainStateMiddleware } from '../middlewares/domainStateMiddleware.js'; -import { DomainService } from './DomainService.js'; +import { DOMAIN_STATES, DomainService } from './DomainService.js'; interface DiscordUserInfo { id: string; @@ -193,7 +193,15 @@ export class AuthService extends DomainScoped { log.warn(`No domain found for identity ${identity.id}`); throw new errors.UnauthorizedError(); } - domainId = domains[0].id; + // Find the first active domain + domainId = domains.find((d) => d.state === DOMAIN_STATES.ACTIVE)?.id; + + if (!domainId && domains.length) { + log.warn( + `No active domain found for identity (but domains found: ${domains.map((d) => ({ id: d.id, state: d.state })).join(',')})`, + ); + throw new errors.BadRequestError('Domain is disabled. Please contact support.'); + } // Set the domain cookie if (req.res?.cookie) @@ -215,6 +223,9 @@ export class AuthService extends DomainScoped { } catch (error) { // Not an ory session, throw a sanitized error log.warn(error); + // If we explicitly throw a BadRequestError, we want to pass it through + // So the client gets a meaningful error message + if (error instanceof errors.BadRequestError) throw error; throw new errors.UnauthorizedError(); } } @@ -250,6 +261,9 @@ export class AuthService extends DomainScoped { if (domainStateCheck) return domainStateMiddleware(req, _res, next); return next(); } catch (error) { + // If we explicitly throw a BadRequestError, we want to pass it through + // So the client gets a meaningful error message + if (error instanceof errors.BadRequestError) return next(error); log.error('Unexpected error in auth middleware', error); return next(new errors.ForbiddenError()); } diff --git a/packages/lib-apiclient/src/generated/api.ts b/packages/lib-apiclient/src/generated/api.ts index 33e30941f3..a9d3bcb950 100644 --- a/packages/lib-apiclient/src/generated/api.ts +++ b/packages/lib-apiclient/src/generated/api.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 03616c08df7ea6ffdaf381a9d38509a21fc1d5ff + * The version of the OpenAPI document: development - 7216ffc45f80fa8a42b6b7af120a0e6bb69a2064 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/base.ts b/packages/lib-apiclient/src/generated/base.ts index 7a8cbde3cd..a9ebc40063 100644 --- a/packages/lib-apiclient/src/generated/base.ts +++ b/packages/lib-apiclient/src/generated/base.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 03616c08df7ea6ffdaf381a9d38509a21fc1d5ff + * The version of the OpenAPI document: development - 7216ffc45f80fa8a42b6b7af120a0e6bb69a2064 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/common.ts b/packages/lib-apiclient/src/generated/common.ts index 509c275093..6a8b22374d 100644 --- a/packages/lib-apiclient/src/generated/common.ts +++ b/packages/lib-apiclient/src/generated/common.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 03616c08df7ea6ffdaf381a9d38509a21fc1d5ff + * The version of the OpenAPI document: development - 7216ffc45f80fa8a42b6b7af120a0e6bb69a2064 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/configuration.ts b/packages/lib-apiclient/src/generated/configuration.ts index 6c2788c6f2..940149f4d5 100644 --- a/packages/lib-apiclient/src/generated/configuration.ts +++ b/packages/lib-apiclient/src/generated/configuration.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 03616c08df7ea6ffdaf381a9d38509a21fc1d5ff + * The version of the OpenAPI document: development - 7216ffc45f80fa8a42b6b7af120a0e6bb69a2064 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/index.ts b/packages/lib-apiclient/src/generated/index.ts index a5479490a1..e84f9b7918 100644 --- a/packages/lib-apiclient/src/generated/index.ts +++ b/packages/lib-apiclient/src/generated/index.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 03616c08df7ea6ffdaf381a9d38509a21fc1d5ff + * The version of the OpenAPI document: development - 7216ffc45f80fa8a42b6b7af120a0e6bb69a2064 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-components/src/components/charts/GeoMercator/index.tsx b/packages/lib-components/src/components/charts/GeoMercator/index.tsx index 47c384798d..9c13f76b2e 100644 --- a/packages/lib-components/src/components/charts/GeoMercator/index.tsx +++ b/packages/lib-components/src/components/charts/GeoMercator/index.tsx @@ -1,6 +1,7 @@ import * as topojson from 'topojson-client'; import topology from './world.json'; import { Graticule, Mercator } from '@visx/geo'; +import { scaleLinear } from '@visx/scale'; import { ParentSize } from '@visx/responsive'; import { getDefaultTooltipStyles, InnerChartProps, Margin } from '../util'; @@ -9,7 +10,6 @@ import { useTooltip, Tooltip } from '@visx/tooltip'; import { Zoom } from '@visx/zoom'; import { useCallback } from 'react'; import { localPoint } from '@visx/event'; -import { shade } from 'polished'; import { ZoomControls } from '../ZoomControls'; import { alpha2ToAlpha3 } from './iso3166-alpha2-to-alpha3'; @@ -88,6 +88,11 @@ const Chart = ({ const centerY = height / 2 + 150; const scale = (width / 1000) * 100; + const colorScale = scaleLinear({ + domain: [Math.min(...data.map((d) => yAccessor(d))), Math.max(...data.map((d) => yAccessor(d)))], + range: [theme.colors.backgroundAlt, theme.colors.primary], + }); + const handleTooltip = useCallback( (event: React.TouchEvent | React.MouseEvent, countryData: T | undefined) => { const eventSvgCoords = localPoint(event); @@ -139,13 +144,15 @@ const Chart = ({ return xAccessor(d) === feature.id; }); + const fillColor = countryData ? colorScale(yAccessor(countryData)) : theme.colors.backgroundAlt; + return ( handleTooltip(e, countryData)} onTouchStart={(e) => handleTooltip(e, countryData)} diff --git a/packages/web-docs/assets/images/chatBridge/chatBridge_1_Takaro_settings.png b/packages/web-docs/assets/images/chatBridge/chatBridge_1_Takaro_settings.png new file mode 100644 index 0000000000..43ee814751 Binary files /dev/null and b/packages/web-docs/assets/images/chatBridge/chatBridge_1_Takaro_settings.png differ diff --git a/packages/web-docs/assets/images/chatBridge/chatBridge_3_Discord_bot.png b/packages/web-docs/assets/images/chatBridge/chatBridge_3_Discord_bot.png new file mode 100644 index 0000000000..43ee814751 Binary files /dev/null and b/packages/web-docs/assets/images/chatBridge/chatBridge_3_Discord_bot.png differ diff --git a/packages/web-docs/assets/images/chatBridge/chatBridge_4_DiscordChannelID.png b/packages/web-docs/assets/images/chatBridge/chatBridge_4_DiscordChannelID.png new file mode 100644 index 0000000000..43ee814751 Binary files /dev/null and b/packages/web-docs/assets/images/chatBridge/chatBridge_4_DiscordChannelID.png differ diff --git a/packages/web-docs/assets/images/chatBridge/chatBridge_5_Module_Channelid.png b/packages/web-docs/assets/images/chatBridge/chatBridge_5_Module_Channelid.png new file mode 100644 index 0000000000..43ee814751 Binary files /dev/null and b/packages/web-docs/assets/images/chatBridge/chatBridge_5_Module_Channelid.png differ diff --git a/packages/web-docs/assets/images/chatBridge/chatbridge_2_Takaro_Discord.png b/packages/web-docs/assets/images/chatBridge/chatbridge_2_Takaro_Discord.png new file mode 100644 index 0000000000..43ee814751 Binary files /dev/null and b/packages/web-docs/assets/images/chatBridge/chatbridge_2_Takaro_Discord.png differ diff --git a/packages/web-docs/assets/images/faq/roles-module-permissions.png b/packages/web-docs/assets/images/faq/roles-module-permissions.png deleted file mode 100644 index fbe8cb88e3..0000000000 Binary files a/packages/web-docs/assets/images/faq/roles-module-permissions.png and /dev/null differ diff --git a/packages/web-docs/docs/modules/chatBridge.mdx b/packages/web-docs/docs/modules/chatBridge.mdx index 69dd496a1a..051f3e4fc3 100644 --- a/packages/web-docs/docs/modules/chatBridge.mdx +++ b/packages/web-docs/docs/modules/chatBridge.mdx @@ -51,4 +51,60 @@ export function Module() { --- -{/* END AUTO-GENERATED CONTENT */} \ No newline at end of file +{/* END AUTO-GENERATED CONTENT */} + +## Step-by-step guide + +### Step 1: Connect Discord in Global Settings +- Go to **Global Game Server Settings > Discord** +![ChatBridge Settings](../../assets/images/chatBridge/chatBridge_1_Takaro_settings.png) +- Click **Add connection** +- Complete Discord authorization to allow Takaro to: + - Access your username, avatar and banner + - Access your email address + - Know what servers you're in +![ChatBridge Settings](../../assets/images/chatBridge/chatbridge_2_Takaro_Discord.png) +### Step 2: Add Takaro Bot to Your Server +1. Click **Invite Discord bot** in the same Global Settings page +2. Select your server from the dropdown +3. Authorize the bot permissions: + - Add a bot to a server + - Create commands +![ChatBridge Settings](../../assets/images/chatBridge/chatBridge_3_Discord_bot.png) +### Step 3: Enable Your Discord Server +1. Still in Global Settings, find the "Guilds" section +2. Toggle ON your Discord server (e.g., "Limon's server") + +### Step 4: Get Discord Channel ID + +1. Go to your Discord server +2. Right-click on the channel you want to use for the chat bridge +3. Click **Copy Channel ID** at the bottom of the menu + - If you don't see this option, make sure Developer Mode is enabled in Discord settings +![ChatBridge Settings](../../assets/images/chatBridge/chatBridge_4_DiscordChannelID.png) +### Step 5: Install and Configure ChatBridge + +1. Go to your game server's modules +2. Find and click "Install" on the ChatBridge module +3. Configure the settings: + + #### User Config + + - **Send Player Connected**: Toggle to announce joins + - **Send Player Disconnected**: Toggle to announce leaves + - **Only Global Chat**: Toggle to filter private/team chat + + #### System Config + + - Enable the module + - Set up Hooks: + - **DiscordToGame**: Enable and paste your copied Discord Channel ID + - **PlayerDisconnected**: Enable to track disconnects + - **GameToDiscord**: Enable game-to-Discord chat + - **PlayerConnected**: Enable to track connects + +![ChatBridge Settings](../../assets/images/chatBridge/chatBridge_5_Module_Channelid.png) + +### Step 6: Save Configuration + +- Click "Install module" to save all settings diff --git a/packages/web-docs/docs/modules/economyUtils.mdx b/packages/web-docs/docs/modules/economyUtils.mdx index 7855a0ed61..88be17f19c 100644 --- a/packages/web-docs/docs/modules/economyUtils.mdx +++ b/packages/web-docs/docs/modules/economyUtils.mdx @@ -181,4 +181,150 @@ export function Module() { --- -{/* END AUTO-GENERATED CONTENT */} \ No newline at end of file +{/* END AUTO-GENERATED CONTENT */} + +## Features +- Balance checking and transfers +- Administrative currency controls +- Automated kill rewards +- Shop integration +- Currency leaderboard + +## Permissions + +### ECONOMY_UTILS_MANAGE_CURRENCY +- Allows granting and revoking currency +- Typically for admins/moderators + +### ZOMBIE_KILL_REWARD_OVERRIDE +- Overrides default kill reward amount +- Can set different amounts per role +- Count value determines reward amount + +## Variables + +### Currency Related +- `lastZombieKillReward` + - Tracks last reward distribution time + - Used by automatic reward system + - Scoped to gameserver and module + +### Shop Related +- `lottery_tickets_bought` + - Stores ticket quantity + - Format: `{ "amount": number }` + - Scoped to player, gameserver, and module + +### Transfer Related +- `confirmTransfer` + - Stores pending transfer details + - Temporary storage for large transfers + +## Automatic Rewards + +### Kill Rewards System +- Auto-processes every 5 minutes +- Awards currency for entity kills +- Default amount configurable +- Role-based override example: + ``` + Default Player: 1 coin per kill + VIP Role: 3 coins per kill + Elite Role: 5 coins per kill + ``` + +### Setting Up Role Rewards +1. Navigate to Roles +2. Enable ZOMBIE_KILL_REWARD_OVERRIDE +3. Set count value for reward amount +4. Assign role to players + +## Commands & Usage Examples + +### Basic Currency Commands +``` +# Check your balance +/balance +> balance: 500 coins + +# View richest players +/topcurrency +> Richest players: +> 1. PlayerOne - 10000 coins +> 2. PlayerTwo - 8500 coins +> [...] +``` + +### Transfer System +``` +# Simple transfer +/transfer John 100 +> You successfully transferred 100 coins to John +> (John receives: You received 100 coins from PlayerName) + +# Large transfer requiring confirmation +/transfer Jane 1000 +> You are about to send 1000 coins to Jane. (Please confirm by typing /confirmtransfer) +/confirmtransfer +> You successfully transferred 1000 coins to Jane +``` + +### Shop System +``` +# Browse shop +/shop +> Available items: +> 1. Diamond Sword - 500 coins +> 2. Golden Apple - 100 coins +> [...] + +# View item details +/shop 1 2 +> Golden Apple - 100 coins +> Restores health instantly +> Type '/shop 1 2 buy' to purchase + +# Purchase item +/shop 1 2 buy +> You have purchased Golden Apple for 100 coins + +# Claim purchased items +/claim +> Claimed all pending orders: 3 items +``` + +### Admin Commands +``` +# Grant currency +/grantcurrency PlayerName 500 +> You successfully granted 500 coins to PlayerName + +# Remove currency +/revokecurrency PlayerName 200 +> You successfully revoked 200 coins from PlayerName's balance +``` + + +## Best Practices + +### Economy Management +- Set reasonable transfer confirmation thresholds +- Monitor currency circulation +- Adjust reward values based on server activity + +### Role Configuration +- Create clear reward tiers +- Balance rewards across different roles +- Consider server economy when setting values +## Troubleshooting +1. Transfer Failed + - Check sender's balance + - Verify player names + - Confirm if confirmation needed + - Check for pending transfer variable + +2. Rewards Not Processing + - Verify kill events recording + - Check role permissions + - Confirm cron job running + - Check lastZombieKillReward timestamp diff --git a/packages/web-docs/docs/modules/geoBlock.mdx b/packages/web-docs/docs/modules/geoBlock.mdx index abf3379597..77255ceb49 100644 --- a/packages/web-docs/docs/modules/geoBlock.mdx +++ b/packages/web-docs/docs/modules/geoBlock.mdx @@ -45,7 +45,43 @@ export function Module() { --- {/* END AUTO-GENERATED CONTENT */} -# How to Install and Configure the Geoblock Module + +## Core Functionality +- Country-based access control +- Configurable action settings (kick or ban) +- Customizable ban duration +- Immunity system through role permissions +- Custom messages for blocked players + +### Operation Modes +- **Allow Mode**: Only players from specified countries can join +- **Deny Mode**: Players from specified countries are blocked from joining + +## Configuration Options + +### Essential Settings +1. **Mode Selection** + - Allow: Whitelist mode - only listed countries can join + - Deny: Blacklist mode - listed countries are blocked + +2. **Action Settings** + - Ban (default: enabled) + - Ban Duration (default: 24 hours) + - Custom Message (default: "Your IP address is banned.") + +3. **Country List** + - Comprehensive list of countries to allow/deny + - Countries are selected using standard two-letter country codes + - Multiple countries can be selected simultaneously + +## Permissions + +### GeoBlock Immunity +- Permission Name: `GEOBLOCK_IMMUNITY` +- Description: Players with this permission will not be affected by GeoBlock restrictions +- Cannot have count value (boolean permission) + +## How to Install and Configure the Geoblock Module This guide explains how to install the Geoblock module, select countries to ban, and create roles to grant immunity to players from banned countries. Follow these steps to effectively manage your game server's access control. You can find more info related to built-in modules in [built-in modules](../modules/overview.mdx). @@ -58,85 +94,85 @@ This guide explains how to install the Geoblock module, select countries to ban, allowFullScreen /> -## Install the module to your game server +### Install the module to your game server -### Step 1: Navigate to the Modules Section +#### Step 1: Navigate to the Modules Section Go to the main menu and find the 'Modules' section in your game server's administration interface. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyu8vexg000s356obenz1bji-annotated.png) -### Step 2: Start the Installation +#### Step 2: Start the Installation Click on the 'Install New Module' button and search for the 'Geoblock' module in the list of available modules. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyu9m3uc0019356o4qyrrfz4-annotated.png) -### Step 3: Select Countries to Block +##$# Step 3: Select Countries to Block During the installation process, you'll be prompted to select the countries you want to block. Use the provided interface to choose the countries from the list. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyu8w3u5000v356ollrkog5f-annotated.png) -### Step 4: Install the Geoblock Module +#$## Step 4: Install the Geoblock Module After selecting the countries, click the 'Install' button to complete the installation of the Geoblock module. ![](https://d1kbuqctacnbc1.cloudfront.net/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyrqudxg000i033p1tf3bd8h-annotated.png) -## Assign the permission to the right role +### Assign the permission to the right role -### Step 5: Navigate to the Roles Section +#### Step 5: Navigate to the Roles Section After installing the Geoblock module, go back to the main menu and find the 'Roles' section in the administration interface. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyu8wfq1000w356oq30mzzv2-annotated.png) -### Step 6: Create a New Role +#### Step 6: Create a New Role Click the 'Create New Role' button to start the process of creating a role that will grant ban immunity. ![](https://d1kbuqctacnbc1.cloudfront.net/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyrquk53000k033pdmokia11-annotated.png) -### Step 7: Name Your New Role +#### Step 7: Name Your New Role Give your new role a recognizable name that indicates it grants immunity, such as 'Ban Immunity'. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyu8xfyq000y356ocm8nwgiy-annotated.png) -### Step 8: Confirm Role Name +#### Step 8: Confirm Role Name After entering the name, click the 'Confirm' button to save the new role. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyu8xi2s000z356omzq4gqax-annotated.png) -## Assign the role to the right player +### Assign the role to the right player -### Step 9: Go to Players Section +#### Step 9: Go to Players Section Navigate to the 'Players' section from the main menu to assign the new role to specific players. ![](https://d1kbuqctacnbc1.cloudfront.net/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyrquw3q000p033pepixxr01-annotated.png) -### Step 10: Select Player for Role Assignment +#### Step 10: Select Player for Role Assignment Find and select the player you want to assign the new role to from the list of registered players. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyu94gla0013356oopo1k4ik-annotated.png) -### Step 11: Assign the newly created role +#### Step 11: Assign the newly created role Assign the newly created role to the selected player by checking the role in the player's profile. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyu94jia0014356o8gg38rd2-annotated.png) -### Step 12: Decide Role Activation Scope +#### Step 12: Decide Role Activation Scope Choose whether to activate this role across all game servers or specific individual game servers by configuring the settings as needed. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyrqtuvs0016jo0cdutlvhl6/clyu97xk80017356oi0tv43q0-annotated.png) -### Step 13: Save Changes +#### Step 13: Save Changes Click the 'Save changes' button to apply all the configurations and finalize the process. diff --git a/packages/web-docs/docs/modules/gimme.mdx b/packages/web-docs/docs/modules/gimme.mdx index 69ff9210ad..834266facb 100644 --- a/packages/web-docs/docs/modules/gimme.mdx +++ b/packages/web-docs/docs/modules/gimme.mdx @@ -38,4 +38,25 @@ export function Module() { --- -{/* END AUTO-GENERATED CONTENT */} \ No newline at end of file +{/* END AUTO-GENERATED CONTENT */} + +## Key Features +- Randomly selects and distributes items from a configurable list +- Can execute random server commands from a predefined list +- Single command usage: `/gimme` + +## How It Works +1. When a player uses `/gimme`, the module: + - Randomly selects between giving an item and executing a command +2. Notifies the player of what they received + +## Setup Steps +1. Install the module from the selected game server +2. Configure item and command lists +3. Save configuration +4. Players can immediately start using `/gimme` + +## Best Practices +- Balance reward values to maintain game economy + +This module requires no special permissions and is accessible to all players by default. \ No newline at end of file diff --git a/packages/web-docs/docs/modules/highPingKicker.mdx b/packages/web-docs/docs/modules/highPingKicker.mdx index b6e68fb8c2..9c192fb20c 100644 --- a/packages/web-docs/docs/modules/highPingKicker.mdx +++ b/packages/web-docs/docs/modules/highPingKicker.mdx @@ -36,4 +36,102 @@ export function Module() { --- -{/* END AUTO-GENERATED CONTENT */} \ No newline at end of file +{/* END AUTO-GENERATED CONTENT */} + +## Key Features + +- Automatic ping monitoring +- Configurable ping thresholds +- Warning system before kicks +- Customizable number of warnings +- Player immunity options through permissions + +## Configuration Options + +### 1. Ping Threshold + +- Default value: 200ms +- Purpose: Defines the maximum acceptable ping value +- When a player's ping exceeds this threshold, they begin receiving warnings +- Can be adjusted based on your server's requirements and geographical location + +### 2. Warnings Before Kick + +- Default value: 3 warnings +- Purpose: Determines how many warnings a player receives before being kicked +- Provides players with opportunities to resolve connection issues +- Each warning is tracked individually per player + +## How It Works + +The module operates on a 5-minute cycle (configured via cron job: `*/5 * * * *`) and performs the following steps: + +1. **Monitoring**: Checks all online players' ping values +2. **Warning System**: + - If a player's ping exceeds the threshold, they receive a warning + - Warnings are tracked using Takaro's variable system + - Each subsequent high ping check increments the warning count +3. **Kick Action**: + - When warnings reach the configured limit, the player is kicked + - Kick message includes their ping value for reference + - Warning count is reset after a kick + +Example warning message: +`Server is shutting down in 5 minutes for daily maintenance. We'll be back online in ~10 minutes. Please find a safe spot!` + +## Implementation Details + +The module uses Takaro's variable system to track warnings with the key `highPingKicker:warnings`. This ensures persistence across server restarts and allows for accurate warning tracking. + +### Warning Process: + +1. First high ping detection: Creates warning variable +2. Subsequent detections: Increments warning count +3. Final warning: Executes kick and resets counter + +### Permissions + +The module includes one permission: + +- `GEOBLOCK_IMMUNITY`: Players with this permission will not be kicked regardless of their ping + - Useful for administrators or trusted players + - Can be assigned through Takaro's role system + +### Installation + +1. Navigate to your server's Modules section +2. Select "Install New Module" +3. Find and select "highPingKicker" +4. Configure the desired ping threshold and warning count +5. Save and activate the module + +## Best Practices + +1. **Initial Setup**: + - Start with default values (200ms ping threshold, 3 warnings) + - Monitor player feedback and server logs + - Adjust values based on your community's needs +2. **Threshold Configuration**: + - Consider your server's geographical location + - Account for typical ping ranges in your target regions + - Set thresholds that balance performance with accessibility +3. **Warning Management**: + - Use enough warnings to allow for temporary connection issues + - Keep warning count reasonable to maintain server performance + - Consider time between checks (default 5 minutes) + +## Troubleshooting + +Common issues and solutions: + +1. **Too Many Kicks**: + - Increase ping threshold + - Add more warnings before kick + - Review server performance metrics +2. **Ineffective Management**: + - Decrease ping threshold + - Reduce warning count + - Decrease check interval +3. **False Positives**: + - Grant immunity to affected players + - Adjust threshold based on time of day \ No newline at end of file diff --git a/packages/web-docs/docs/modules/lottery.mdx b/packages/web-docs/docs/modules/lottery.mdx index 356b25a9a8..a63c75ecc0 100644 --- a/packages/web-docs/docs/modules/lottery.mdx +++ b/packages/web-docs/docs/modules/lottery.mdx @@ -79,4 +79,109 @@ export function Module() { --- -{/* END AUTO-GENERATED CONTENT */} \ No newline at end of file +{/* END AUTO-GENERATED CONTENT */} + +## Overview + +The lottery system works by: + +- Players can purchase tickets using server currency +- A scheduled draw determines winners automatically +- Winners receive a prize pool based on ticket sales +- Configurable profit margin for the server +- Daily automated draws + +## Commands + +|Command|Description|Arguments| +|---|---|---| +|`/buyTicket`|Purchase lottery tickets|`amount`: Number of tickets to buy| +|`/viewTickets`|View your currently held tickets|None| +|`/nextDraw`|Check when the next lottery draw will occur|None| + +## Permissions + +The module includes two main permissions that can be assigned to roles: + +- **LOTTERY_BUY**: Allows players to purchase lottery tickets +- **LOTTERY_VIEW_TICKETS**: Allows players to view their currently held tickets + +## Configuration + +### Module Settings + +|Setting|Description|Default| +|---|---|---| +|`profitMargin`|Percentage of ticket sales kept by the server (0-1)|0.1 (10%)| + +### System Configuration + +The lottery draw is scheduled using a cron job that runs at `0 0 * * *` (midnight every day). + +## How It Works + +1. **Ticket Purchase**: + - Players use the `/buyTicket` command to purchase tickets + - Each ticket costs a configurable amount of currency + - Players can purchase multiple tickets at once + - Tickets are tracked per player until the next draw +2. **Prize Pool**: + - Total prize pool = (Total ticket sales) * (1 - profit margin) + - Server keeps the profit margin percentage + - The remaining amount goes to the winner +3. **Draw Process**: + - Occurs automatically at configured time + - One winner is randomly selected from all ticket holders + - More tickets = higher chance of winning + - Prize is automatically distributed to winner + - All tickets are cleared after each draw +4. **Safeguards**: + - Lottery cancels if only one player bought tickets + - Players receive refunds if lottery is cancelled + - Server announces winner and prize amount to all players + +## Setup Guide + +1. **Install the Module**: + - Navigate to your server's Modules section + - Find "lottery" in the module list + - Click Install + - Configure the profit margin as desired +2. **Configure Permissions**: + - Go to Roles section + - Assign LOTTERY_BUY and LOTTERY_VIEW_TICKETS permissions to appropriate roles + - Set any cost requirements for permissions if desired +3. **Verify Installation**: + - Check that commands are working using `/help lottery` + - Ensure draw schedule is active by using `/nextDraw` + - Test ticket purchase with `/buyTicket 1` + +## Best Practices + +1. **Economy Balance**: + - Set appropriate ticket costs based on your server's economy + - Adjust profit margin to control prize pool sizes + - Monitor ticket sales and adjust parameters as needed +2. **Player Communication**: + - Announce lottery events in advance + - Use server messages to remind players about upcoming draws + - Celebrate winners to encourage participation +3. **Permission Management**: + - Consider creating specific lottery roles + - Use permission costs to prevent abuse + - Monitor for unusual buying patterns + +## Troubleshooting + + +**Players can't buy tickets**: + - Verify LOTTERY_BUY permission is assigned + - Check if player has sufficient currency + - Ensure economy system is enabled + +## Notes + +- Tickets do not persist between draws +- Players must be online to receive win notifications +- The module requires an active economy system +- All transactions are logged for administrative review \ No newline at end of file diff --git a/packages/web-docs/docs/modules/playerOnboarding.mdx b/packages/web-docs/docs/modules/playerOnboarding.mdx index a2dd3bc608..db39c0f33a 100644 --- a/packages/web-docs/docs/modules/playerOnboarding.mdx +++ b/packages/web-docs/docs/modules/playerOnboarding.mdx @@ -44,4 +44,70 @@ export function Module() { --- -{/* END AUTO-GENERATED CONTENT */} \ No newline at end of file +{/* END AUTO-GENERATED CONTENT */} + +## Features + +### Welcome Messages + +- Automatically triggers when a player connects to the server +- Supports player name variables using player placeholder +- Customizable message content +- Helps create a welcoming atmosphere for new players + +### Starter Kit System + +- Players can claim a starter kit using the `/starterkit` command +- One-time use per player per server +- Configurable item list with support for: + - Item quantities + - Item quality levels + - Multiple items per kit + +## Configuration + +### Message Configuration + +- **Message**: Customize the welcome message that players receive when joining +- Default message: "Welcome player to the server!" +- Use player to include the player's name in the message + +### Starter Kit Configuration + +- **Items**: Configure a list of items to be given to players +- Each item entry supports: + - Item name (must match exact game item ID) + - Amount + - Quality level (where applicable) + - Usage percentage +## Commands + +### /starterkit + +- **Usage**: `/starterkit` +- **Description**: Claims the starter kit items +- **Limitations**: + - Can only be used once per player per server + - Requires starter kit items to be configured +- **Response Messages**: + - Success: "Gave [X] items, enjoy!" + - Already claimed: "You already used starterkit on this server" + - No items configured: "No starter kit items configured. Please ask your server administrator to configure this." + +## Variables + +The module uses Takaro's variable system to track starter kit claims: +- Creates a variable with key 't_starterkit_lock' when a player claims their kit +- Checks this variable to prevent multiple claims +- Variables are server-specific, allowing players to claim starter kits on different servers + +## Best Practices + +1. **Welcome Message** + - Keep messages concise and informative + - Include essential server information or rules + - Use the player placeholder to personalize the message +2. **Starter Kit Items** + - Balance items to help new players without making them overpowered + - Consider your server's economy when selecting items + diff --git a/packages/web-docs/docs/modules/serverMessages.mdx b/packages/web-docs/docs/modules/serverMessages.mdx index 49faf5752d..2062b20e88 100644 --- a/packages/web-docs/docs/modules/serverMessages.mdx +++ b/packages/web-docs/docs/modules/serverMessages.mdx @@ -36,4 +36,107 @@ export function Module() { --- -{/* END AUTO-GENERATED CONTENT */} \ No newline at end of file +{/* END AUTO-GENERATED CONTENT */} + +## Overview + +The Server Messages module sends automated messages to players on your server at regular intervals. Messages are broadcast in sequential order from your configured list. + +## Configuration + +### Basic Setup + +1. Install the module from your server's Modules section +2. Configure at least one message in the messages array +3. Messages must be between 5 and 1024 characters + +### Message Configuration + +```json +{ + "messages": [ + "Welcome to our server! Type /help for commands", // First message + "Join our Discord community: discord.gg/example", // Second message + "Vote daily for rewards at /vote", // Third message + "Check out our shop with /shop" // Fourth message, then cycles back to first + ] +} +``` + +### Scheduling + +- Default: Every 30 minutes (`*/30 * * * *`) +- Common schedules: + ``` + */30 * * * * Every 30 minutes + 0 * * * * Every hour + 0 */4 * * * Every 4 hours + 0 0 * * * Daily at midnight + 0 12 * * * Daily at noon + ``` + +## How It Works + +1. When the cron job triggers (default: every 30 minutes) +2. The next message in sequence is selected from your list +3. After reaching the last message, it starts again from the beginning +4. Example sequence: + ``` + 12:00 - First message + 12:30 - Second message + 13:00 - Third message + 13:30 - Fourth message + 14:00 - First message (cycle repeats) + ``` + +## Best Practices + +### Effective Message Examples + +**Server Rules & Guidelines (Ordered by Priority)** + ``` + PvP is only allowed in designated zones. Type /pvp for info + Protect your base! Use /claim to secure your territory + Raiding is allowed, but no griefing. See /rules + Be respectful in chat. Toxicity = ban + ``` +**Game Tips & Features (Ordered by Progression)** + ``` + New? Type /help to see all commands + Ready to trade? Visit /shop for items + Want a challenge? Join events with /events + Veteran player? Help newbies for rewards! + ``` + +**Community Engagement (Ordered by Importance)** + ``` + Join our Discord for important updates: discord.gg/example + Support us by voting at /vote - daily rewards! + Follow announcements at @serverName + Questions? Our staff team is here to help + ``` + +### Optimization Tips + +1. **Message Order** + - Arrange messages by priority or logical sequence + - Put most important messages first + - Group related messages together + - Consider time between messages when ordering + +2. **Message Categories** + - Start with essential information + - Follow with gameplay tips + - End with community/social messages + - Keep consistent themes together + +3. **Timing** + - Match interval to message count + - Consider peak player times + - Longer intervals for important messages + - Shorter intervals for tips/reminders + +4. **Format** + - Keep messages concise + - Include clear calls to action + - Specify commands when relevant \ No newline at end of file diff --git a/packages/web-docs/docs/modules/teleports.mdx b/packages/web-docs/docs/modules/teleports.mdx index 44225d71d6..25a4b0106f 100644 --- a/packages/web-docs/docs/modules/teleports.mdx +++ b/packages/web-docs/docs/modules/teleports.mdx @@ -183,7 +183,108 @@ export function Module() { --- {/* END AUTO-GENERATED CONTENT */} -# How to add teleports module to your game server +## Features + +- Personal teleport points +- Public/private teleport management +- Waypoint system +- Configurable cooldowns +- Permission-based access control + +## Configuration Options + +When installing the module, administrators can configure: + +- **Timeout**: The cooldown period between teleports (in seconds) +- **Allow Public Teleports**: Toggle whether players can create public teleport points +- **Command Costs**: Set currency costs for teleport commands + +## Permissions System + +### Core Permissions + +1. **Use Teleports** (`TELEPORTS_USE`) + - Allows basic teleport functionality + - Can be configured with a count limit + - Required for using `/tp` and `/tplist` commands +2. **Create Public Teleports** (`TELEPORTS_CREATE_PUBLIC`) + - Allows creation of public teleport points + - Can be configured with a count limit + - Required for `/setpublic` command +3. **Manage Waypoints** (`TELEPORTS_MANAGE_WAYPOINTS`) + - Administrative permission for waypoint management + - Required for `/setwaypoint` and `/deletewaypoint` commands + - No count limit applicable + +### Setting Up Role Permissions + +## Basic Player Access + +1. Edit the default "Player" role +2. Enable "Use Teleports" permission +3. Set maximum number of teleports (recommended: 3-5) +4. Save changes + +## VIP/Donor Setup + +1. Create a new role (e.g., "VIP") +2. Enable both "Use Teleports" and "Create Public Teleports" +3. Set higher teleport limits (recommended: 10-15) +4. Assign to VIP players + +## Admin Configuration + +1. Edit admin role or create dedicated teleport admin role +2. Enable all teleport permissions +3. Enable "Manage Waypoints" permission +4. No need to set count limits + +## Command examples + +| Command | Description | Example | +| ------------------------ | ---------------------------------- | ----------------------- | +| `/tp ` | Teleport to a saved location | `/tp home` | +| `/tplist` | List all available teleport points | `/tplist` | +| `/settp ` | Create a new teleport point | `/settp base` | +| `/deletetp ` | Remove a teleport point | `/deletetp base` | +| `/setpublic ` | Make a teleport point public | `/setpublic shop` | +| `/setprivate ` | Make a teleport point private | `/setprivate base` | +| `/setwaypoint ` | Create a waypoint (admin only) | `/setwaypoint spawn` | +| `/deletewaypoint ` | Delete a waypoint (admin only) | `/deletewaypoint spawn` | +| `/waypoints` | List all available waypoints | `/waypoints` | +| | | | + + +## Best Practices + +1. **Permission Hierarchy** + - Start with basic permissions for all players + - Add additional capabilities for trusted/VIP players + - Reserve waypoint management for administrators +2. **Teleport Limits** + - Set reasonable limits based on server size + - Consider increasing limits for loyal players + - Monitor usage patterns and adjust as needed +3. **Public Teleports** + - Consider restricting public teleport creation to trusted players + - Monitor public teleport locations for abuse + - Use waypoints for essential server locations + +## Troubleshooting + +- If players cannot teleport, check their permission setup +- Verify timeout settings if teleports seem unresponsive +- Check currency requirements if teleports fail +- Ensure waypoint permissions are properly configured for administrators + +## Security Considerations + +- Regularly review public teleport locations +- Monitor for teleport abuse or exploitation +- Consider implementing stricter timeout periods in PvP areas +- Use waypoints instead of public teleports for crucial locations like traders + +## How to add teleports module to your game server This guide walks you through the process of integrating the Teleports module into your game servers. You'll learn how to set up teleport permissions for different player roles, create custom teleport roles for enhanced privileges, and manage teleport-related features effectively. @@ -196,85 +297,85 @@ This guide walks you through the process of integrating the Teleports module int allowFullScreen /> -## Install the module to your game server +### step-by-step guide to install the module to your game server -### Step 1: Navigate to game servers +#### Step 1: Navigate to game servers ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrki4hl00e8356vnaco8xn0-annotated.png) -### Step 2: Select the game server you want the module to be installed on +#### Step 2: Select the game server you want the module to be installed on ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrf44cb002d356vzrgud1i3-annotated.png) -### Step 3: Navigate to Modules of the selected game server +#### Step 3: Navigate to Modules of the selected game server ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyr6qier0009356vyv6luu30-annotated.png) -### Step 4: Click the install button +#### Step 4: Click the install button ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrkmfi000eb356vgb4jcsjl-annotated.png) -### Step 5: This opens the module config +#### Step 5: This opens the module config You will see a list of settings that you can configure. You will also find the list of commands that are part of this module. $tplist - Lists all your set locations. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrfgxmx0030356vcsdn6949-annotated.png) -### Step 6: $teleportwaypoint command +#### Step 6: $teleportwaypoint command The module will install aliases for this command corresponding to the waypoint names. The $teleportwaypoint command is a base command that won't be used directly. Instead, the module will create custom commands for each waypoint name you set up. This allows players to teleport to specific locations easily. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrfh0ch0031356veuthxwdw-annotated.png) -### Step 7: Select the amount of currency one teleport command costs +#### Step 7: Select the amount of currency one teleport command costs $teleport command teleports you to one of your set locations. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrkn7bf00ee356vec8w2jac-annotated.png) -### Step 8: $setwaypoint creates a new waypoint +#### Step 8: $setwaypoint creates a new waypoint ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrfh2zj0032356vxpdnfcao-annotated.png) -### Step 9: $settp sets a location to teleport to +#### Step 9: $settp sets a location to teleport to ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrfh6ci0033356v20yp6mlv-annotated.png) -### Step 10: $setpublic sets a teleport to be public, allowing other players to teleport to it +#### Step 10: $setpublic sets a teleport to be public, allowing other players to teleport to it ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrfflru002w356vejuvlnyy-annotated.png) -### Step 11: $setprivate sets a teleport to be private, only the teleport owner can teleport to it +#### Step 11: $setprivate sets a teleport to be private, only the teleport owner can teleport to it ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrfhf6t0034356v8zo9l6ei-annotated.png) -### Step 12: $listwaypoints lists all waypoints +#### Step 12: $listwaypoints lists all waypoints ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrffrkd002y356vehfrrtgl-annotated.png) -### Step 13: $deletewaypoint deletes a waypoint +#### Step 13: $deletewaypoint deletes a waypoint ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrfhzvi0037356vdm1sez5x-annotated.png) -### Step 14: Click Install module button when you are finished with the config +#### Step 14: Click Install module button when you are finished with the config ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrkndxi00ef356vjx98hsqg-annotated.png) -## Assign the permission to the right role +### Assign the permission to the right role -### Step 15: Now you need to assign the permission to the right role +#### Step 15: Now you need to assign the permission to the right role Now that you've installed the Teleports module, the next step is to set up the appropriate permissions. Navigate to the "Roles" section in the global navigation to begin assigning teleport-related permissions to player roles. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrenji3001q356vs5b8uta8-annotated.png) -### Step 16: Now you need to assign the permission to the right role +#### Step 16: Now you need to assign the permission to the right role You can decide to add this permission to the standard Player role, or you can create a new role dedicated for teleports. In this guide, we are going to do both. We will first start with the Player role. The Player role is the role that all players will have when they join your game server. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrejj8w0011356vg8t94k5p-annotated.png) -### Step 17: Teleports Module Permissions Overview +#### Step 17: Teleports Module Permissions Overview Create Public Teleports: Allows players to create teleport points accessible to others. Use Teleports: Enables players to use existing teleport points. Manage Waypoints: Permits creating, modifying, and deleting personal or shared waypoints. @@ -284,55 +385,55 @@ Toggle the switch to the right (on position). Set a cost in the "Amount" field i ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyre55ge000x356vqh7cq87h-annotated.png) -### Step 18: Click Save changes button +#### Step 18: Click Save changes button ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrknird00eg356vsmu74np2-annotated.png) -### Step 19: Add a custom role for Teleports +#### Step 19: Add a custom role for Teleports Creating a dedicated teleport role allows for more flexible permission management. This is useful when you want to give enhanced teleport capabilities to certain players without changing permissions for all users. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrknlij00eh356v8bmmu32u-annotated.png) -### Step 20: Give your new role a recognizable name +#### Step 20: Give your new role a recognizable name ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrew0c9001v356v6qdqb47a-annotated.png) -### Step 21: Configure teleport permissions for the new role +#### Step 21: Configure teleport permissions for the new role You'll see the same options as in Step 17: Create Public Teleports Use Teleports Manage Waypoints ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyreielj0010356vdutepys1-annotated.png) -## Assign the role to the right player +### Assign the role to the right player -### Step 22: Go to Players to assign the right role +#### Step 22: Go to Players to assign the right role ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrknq0d00ei356vbuve02c5-annotated.png) -### Step 23: Navigate to the player you want to assign the special role to +#### Step 23: Navigate to the player you want to assign the special role to ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrepqj1001u356v5fepto4w-annotated.png) -### Step 24: Click Assign role button +#### Step 24: Click Assign role button ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrf8n5a002e356vmyn5b9ee-annotated.png) -### Step 25: Select the right role +#### Step 25: Select the right role ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrknuo400ej356vbbjkv8uh-annotated.png) -### Step 26: Choose extra teleports from the list +#### Step 26: Choose extra teleports from the list ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrf8wcs002f356vacwkzk01-annotated.png) -### Step 27: Choose your preferred game server +#### Step 27: Choose your preferred game server Choose to activate the teleport role on individual game servers or globally across all servers, allowing flexible permission management based on your game's structure and needs. ![](https://layerpath-recording-prod.s3-accelerate.amazonaws.com/clyr0pthc0008ju0cpgk6zvy7/clyr4po6b0065l90ch2iwjbq3/clyrfj6jk0039356vwo9846tm-annotated.png) -### Step 28: Click Save changes button +#### Step 28: Click Save changes button You made it to the end! diff --git a/packages/web-docs/docs/modules/timedShutdown.mdx b/packages/web-docs/docs/modules/timedShutdown.mdx index f94a73bba5..e23f3ea6d5 100644 --- a/packages/web-docs/docs/modules/timedShutdown.mdx +++ b/packages/web-docs/docs/modules/timedShutdown.mdx @@ -41,4 +41,77 @@ export function Module() { --- -{/* END AUTO-GENERATED CONTENT */} \ No newline at end of file +{/* END AUTO-GENERATED CONTENT */} + +The Timed Shutdown module provides automated server shutdown functionality with configurable warning messages to players. This guide explains how to configure and use the module effectively. + +## Overview + +The Timed Shutdown module performs two main functions: + +1. Sends a warning message to all players before shutdown +2. Automatically shuts down the server at a specified time + +## Configuration + +### Warning Message + +- **Setting**: `warningMessage` +- **Default**: "Server is shutting down in 5 minutes!" +- **Description**: The message that will be broadcast to all players 5 minutes before shutdown +- **Length Limits**: 1-1024 characters + +### Timing + +The module operates by default on a fixed schedule: + +- **Warning Time**: 3:25 AM (server time) +- **Shutdown Time**: 3:30 AM (server time) + +These times are set using cron expressions: + +- Warning message: `3 25 * * *` +- Server shutdown: `3 30 * * *` + +You can change the cron jobs to your liking. + +## Installation Steps + +1. Navigate to your game server's Modules section +2. Click "Install New Module" +3. Search for "timedShutdown" +4. Configure your warning message +5. Click Install + +## Best Practices + +### Warning Message Format + +Consider including: + +- Specific time remaining until shutdown +- Reason for shutdown (e.g., maintenance, daily restart) +- When the server will be back online + +Example message: + +`Server is shutting down in 5 minutes for daily maintenance. We'll be back online in ~10 minutes. Please find a safe spot!` + +### Server Time Considerations + +- Ensure your server's time zone is correctly set +- Choose shutdown times during low-activity periods +- Account for regular maintenance windows + +## Troublesh ooting + +Common issues and solutions: + +1. **Shutdown not occurring** + - Verify server time matches expected shutdown time + - Check module installation status + - Review server logs for errors +2. **Warning message not displaying** + - Confirm message is properly configured + - Check chat/message system functionality + - Verify module permissions \ No newline at end of file diff --git a/packages/web-docs/docs/modules/utils.mdx b/packages/web-docs/docs/modules/utils.mdx index 0684f3cb4d..6970e60fea 100644 --- a/packages/web-docs/docs/modules/utils.mdx +++ b/packages/web-docs/docs/modules/utils.mdx @@ -53,4 +53,50 @@ export function Module() { --- -{/* END AUTO-GENERATED CONTENT */} \ No newline at end of file +{/* END AUTO-GENERATED CONTENT */} + +## Features + +### Commands + +## 1. Ping Command + +- **Trigger**: `/ping` +- **Description**: A simple command that replies with "Pong!". This command is useful for: + - Testing if the server connection is working + - Verifying command functionality + - Checking player permissions + - Basic latency testing + +## 2. Help Command + +- **Trigger**: `/help [command]` +- **Description**: Provides information about available commands and their usage +- **Arguments**: + - `command` (optional): The specific command to get help for + - Default: Shows all available commands if no specific command is specified + +### Usage Examples + + +`/ping > Response: "Pong!" /help > Response: Lists all available commands` +`/help ping > Response: Shows detailed help for the ping command` + +## Technical Details + +### Module Configuration + +The Utils module has a minimal configuration schema with no required settings, making it simple to deploy and maintain. + +### Permissions + +The Utils module's commands are typically available to all players by default, as they provide essential functionality for server interaction. + +## Best Practices + +1. **Server Setup** + - Install the Utils module first when setting up a new server + - Keep it enabled to ensure players can always access basic commands +3. **Troubleshooting** + - Use the ping command as a first step in diagnosing connection issues + - Refer players to the help command when they're unsure about command usage \ No newline at end of file diff --git a/packages/web-main/src/routes/_auth/domain.select.tsx b/packages/web-main/src/routes/_auth/domain.select.tsx index 55dc034542..ff8d8fa168 100644 --- a/packages/web-main/src/routes/_auth/domain.select.tsx +++ b/packages/web-main/src/routes/_auth/domain.select.tsx @@ -1,5 +1,5 @@ import { Card, Chip, Company, styled } from '@takaro/lib-components'; -import { DomainOutputDTO } from '@takaro/apiclient'; +import { DomainOutputDTO, DomainOutputDTOStateEnum } from '@takaro/apiclient'; import { createFileRoute, useNavigate } from '@tanstack/react-router'; import { useUserSetSelectedDomain, userMeQueryOptions } from 'queries/user'; import { MdDomain as DomainIcon } from 'react-icons/md'; @@ -78,8 +78,12 @@ function DomainCard({ domain, isCurrentDomain }: DomainCardProps) { const navigate = useNavigate(); const { mutate, isSuccess } = useUserSetSelectedDomain(); const queryClient = useQueryClient(); + const isDisabled = domain.state === DomainOutputDTOStateEnum.Disabled; const handleDomainSelectedClick = () => { + // Logging into a disabled domain is going to error out + if (isDisabled) return; + if (isCurrentDomain === false) { mutate({ domainId: domain.id }); } else { @@ -99,6 +103,7 @@ function DomainCard({ domain, isCurrentDomain }: DomainCardProps) {
{isCurrentDomain && } + {isDisabled && }

{domain.name}