mirror of
https://github.com/gmod-integration/lua.git
synced 2025-07-07 01:23:58 +00:00
Compare commits
131 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d32a418a9f | ||
46f1496e4c | |||
0f4c8bdaac | |||
![]() |
4b453bfde3 | ||
eb08999b28 | |||
![]() |
5d51b6c4be | ||
65749eab7a | |||
![]() |
bfcf5c834a | ||
73d49fc01d | |||
![]() |
a7341b65f2 | ||
f1740caf77 | |||
![]() |
704b57a745 | ||
6e8d669d05 | |||
78148f2a24 | |||
ff051ef47d | |||
4563d28755 | |||
ee3f141c74 | |||
![]() |
a269b85698 | ||
f72cb13f09 | |||
082abb2d1a | |||
![]() |
6137da8860 | ||
9753888551 | |||
![]() |
607807518f | ||
1dd624502d | |||
![]() |
8ccc949a93 | ||
ece3ae774a | |||
![]() |
112f059e26 | ||
c81a3be7b4 | |||
![]() |
d3e79a741a | ||
162130d415 | |||
d2cfe9f17c | |||
![]() |
92fc9ca707 | ||
4b0a74f8c7 | |||
![]() |
672d373cc7 | ||
457975481d | |||
![]() |
23652148b5 | ||
31b5e518bf | |||
![]() |
e6419ed723 | ||
fa5ce198b0 | |||
995fa249b0 | |||
4dabad1127 | |||
c1e3c4a178 | |||
![]() |
53d1fd9c53 | ||
29a1d07705 | |||
![]() |
15f05a3c0d | ||
63173cbc80 | |||
![]() |
74a854d25f | ||
6ddffe4eec | |||
eefb99f3a9 | |||
d1893e88a1 | |||
![]() |
502caab754 | ||
18e4db2851 | |||
![]() |
c2c91362d1 | ||
0165e62d7c | |||
02e3408d37 | |||
a9c63a94f6 | |||
ed7044be58 | |||
1ad7010b97 | |||
![]() |
d085a1f55e | ||
2b076a84b8 | |||
8bd9460455 | |||
23ed1507ce | |||
![]() |
99d70b8146 | ||
6651bc2e68 | |||
![]() |
b32eb2f663 | ||
dd310332b6 | |||
![]() |
f96b3fd309 | ||
241d8424e1 | |||
b78b8a1cad | |||
1b700fd31c | |||
e9e435eb13 | |||
e468b2fa96 | |||
5cd3608309 | |||
6a1d4228cc | |||
106363e846 | |||
bad8fc2877 | |||
2cadfc343a | |||
7442efd6f5 | |||
c98afda1d3 | |||
39db1436b2 | |||
de480a8934 | |||
6ceeaf1535 | |||
f7dbb0250d | |||
6eebe5f165 | |||
0db418ef4a | |||
b322f58a70 | |||
423ca3175a | |||
3534141410 | |||
8bdf3b4bc0 | |||
60551eee07 | |||
09727be01b | |||
18b904f64a | |||
fbf27f4d40 | |||
7401c81a86 | |||
deac3ef966 | |||
0a391e022d | |||
baadebd517 | |||
083aadefe3 | |||
0eb8109ac2 | |||
d0880366e4 | |||
ac54b3db55 | |||
a605d9fbe7 | |||
d6a378ec45 | |||
91e8b3d2ef | |||
499c382066 | |||
da9b9d2392 | |||
be3a44760d | |||
3ebd9c0989 | |||
06efe727e2 | |||
9e9a2dfe01 | |||
94ebf5cba6 | |||
8231f4a9ac | |||
5aee9272cd | |||
c29a12dfd2 | |||
e7b9953185 | |||
1661173526 | |||
4caed5845f | |||
5c78fae9a6 | |||
d7930c9194 | |||
2ea0bf00e2 | |||
4ab93e1afe | |||
0a7ae28a75 | |||
a6ab55dd4a | |||
4572d64017 | |||
2d2275d0cb | |||
03bb2052f3 | |||
af77c08976 | |||
03c6585cff | |||
d3e5546f14 | |||
f361bd884a | |||
![]() |
34d22baab9 |
304
.github/workflows/auto-release.yml
vendored
Normal file
304
.github/workflows/auto-release.yml
vendored
Normal file
|
@ -0,0 +1,304 @@
|
|||
name: Auto Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version_type:
|
||||
description: 'Version bump type'
|
||||
required: true
|
||||
default: 'patch'
|
||||
type: choice
|
||||
options:
|
||||
- patch
|
||||
- minor
|
||||
- major
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
version:
|
||||
name: Calculate Version & Update Code
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
new_version: ${{ steps.calc_version.outputs.new_version }}
|
||||
new_tag: ${{ steps.calc_version.outputs.new_tag }}
|
||||
latest_tag: ${{ steps.get_tag.outputs.latest_tag }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get latest tag
|
||||
id: get_tag
|
||||
run: |
|
||||
git fetch --tags
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
||||
echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||
echo "Latest tag: $LATEST_TAG"
|
||||
|
||||
- name: Calculate new version
|
||||
id: calc_version
|
||||
run: |
|
||||
LATEST_TAG="${{ steps.get_tag.outputs.latest_tag }}"
|
||||
VERSION_TYPE="${{ github.event.inputs.version_type || 'patch' }}"
|
||||
|
||||
# Remove 'v' prefix if present
|
||||
VERSION=${LATEST_TAG#v}
|
||||
|
||||
# Split version into parts
|
||||
IFS='.' read -ra VERSION_PARTS <<< "$VERSION"
|
||||
MAJOR=${VERSION_PARTS[0]:-0}
|
||||
MINOR=${VERSION_PARTS[1]:-0}
|
||||
PATCH=${VERSION_PARTS[2]:-0}
|
||||
|
||||
# Increment based on type
|
||||
case $VERSION_TYPE in
|
||||
major)
|
||||
MAJOR=$((MAJOR + 1))
|
||||
MINOR=0
|
||||
PATCH=0
|
||||
;;
|
||||
minor)
|
||||
MINOR=$((MINOR + 1))
|
||||
PATCH=0
|
||||
;;
|
||||
patch)
|
||||
PATCH=$((PATCH + 1))
|
||||
;;
|
||||
esac
|
||||
|
||||
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
|
||||
NEW_TAG="v$NEW_VERSION"
|
||||
|
||||
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT
|
||||
echo "New version: $NEW_VERSION"
|
||||
|
||||
- name: Update version in code
|
||||
run: |
|
||||
NEW_VERSION="${{ steps.calc_version.outputs.new_version }}"
|
||||
sed -i "s/gmInte\.version = \"[^\"]*\"/gmInte.version = \"$NEW_VERSION\"/g" lua/autorun/gmod_integration.lua
|
||||
grep "gmInte.version" lua/autorun/gmod_integration.lua
|
||||
|
||||
- name: Commit and tag
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add lua/autorun/gmod_integration.lua
|
||||
git commit -m "chore: bump version to ${{ steps.calc_version.outputs.new_version }}" || exit 0
|
||||
|
||||
NEW_TAG="${{ steps.calc_version.outputs.new_tag }}"
|
||||
git tag $NEW_TAG
|
||||
git push origin $NEW_TAG
|
||||
git push origin HEAD
|
||||
|
||||
changelog:
|
||||
name: Generate Changelog
|
||||
runs-on: ubuntu-latest
|
||||
needs: version
|
||||
outputs:
|
||||
changelog: ${{ steps.changelog.outputs.changelog }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ needs.version.outputs.new_tag }}
|
||||
|
||||
- name: Generate changelog
|
||||
id: changelog
|
||||
run: |
|
||||
LATEST_TAG="${{ needs.version.outputs.latest_tag }}"
|
||||
NEW_TAG="${{ needs.version.outputs.new_tag }}"
|
||||
|
||||
echo "## What's Changed" > CHANGELOG.md
|
||||
echo "" >> CHANGELOG.md
|
||||
|
||||
if [ "$LATEST_TAG" != "v0.0.0" ]; then
|
||||
git log --pretty=format:"* %s (%h)" $LATEST_TAG..HEAD >> CHANGELOG.md
|
||||
else
|
||||
git log --pretty=format:"* %s (%h)" >> CHANGELOG.md
|
||||
fi
|
||||
|
||||
echo "" >> CHANGELOG.md
|
||||
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/$LATEST_TAG...$NEW_TAG" >> CHANGELOG.md
|
||||
|
||||
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
||||
cat CHANGELOG.md >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
name: Build Release Archive
|
||||
runs-on: ubuntu-latest
|
||||
needs: version
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.version.outputs.new_tag }}
|
||||
|
||||
- name: Create release archive
|
||||
run: |
|
||||
mkdir -p gmod-integration-release/addons/gmod-integration
|
||||
cp -r lua/ gmod-integration-release/addons/gmod-integration/
|
||||
[ -f LICENSE ] && cp LICENSE gmod-integration-release/addons/gmod-integration/
|
||||
|
||||
# Copy README.md to both addon folder and root of zip
|
||||
[ -f README.md ] && cp README.md gmod-integration-release/addons/gmod-integration/
|
||||
[ -f README.md ] && cp README.md gmod-integration-release/
|
||||
|
||||
cat > gmod-integration-release/addons/gmod-integration/addon.json << EOF
|
||||
{
|
||||
"title": "Gmod Integration",
|
||||
"type": "ServerContent",
|
||||
"tags": ["fun", "roleplay"],
|
||||
"ignore": [
|
||||
"*.git*",
|
||||
"*.md",
|
||||
"*.yml",
|
||||
"*.yaml"
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
cd gmod-integration-release
|
||||
zip -r ../gmod-integration-${{ needs.version.outputs.new_version }}.zip .
|
||||
cd ..
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-archive
|
||||
path: gmod-integration-${{ needs.version.outputs.new_version }}.zip
|
||||
|
||||
github-release:
|
||||
name: Create GitHub Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [version, changelog, build]
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-archive
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: ${{ needs.version.outputs.new_tag }}
|
||||
name: ${{ needs.version.outputs.new_tag }}
|
||||
body: ${{ needs.changelog.outputs.changelog }}
|
||||
files: |
|
||||
gmod-integration-${{ needs.version.outputs.new_version }}.zip
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
gmodstore-release:
|
||||
name: Publish to GMod Store
|
||||
runs-on: ubuntu-latest
|
||||
needs: [version, changelog, build, github-release]
|
||||
if: success()
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-archive
|
||||
|
||||
- name: Publish to GMod Store
|
||||
run: |
|
||||
NEW_VERSION="${{ needs.version.outputs.new_version }}"
|
||||
CHANGELOG="${{ needs.changelog.outputs.changelog }}"
|
||||
|
||||
# Prepare changelog for API
|
||||
API_CHANGELOG=$(echo "$CHANGELOG" | sed 's/## What'\''s Changed/What'\''s Changed:/g' | sed 's/\*\*Full Changelog\*\*/Full Changelog:/g' | head -c 9000)
|
||||
|
||||
# Upload to GMod Store
|
||||
curl -X POST "https://api.pivity.com/v3/products/${{ secrets.GMODSTORE_PRODUCT_ID }}/versions" \
|
||||
-H "Authorization: Bearer ${{ secrets.GMODSTORE_API_TOKEN }}" \
|
||||
-F "name=v$NEW_VERSION" \
|
||||
-F "changelog=$API_CHANGELOG" \
|
||||
-F "file=@gmod-integration-$NEW_VERSION.zip" \
|
||||
-F "releaseType=stable" \
|
||||
--fail-with-body || echo "Failed to publish to GMod Store - check your API token and product ID"
|
||||
env:
|
||||
GMODSTORE_API_TOKEN: ${{ secrets.GMODSTORE_API_TOKEN }}
|
||||
GMODSTORE_PRODUCT_ID: ${{ secrets.GMODSTORE_PRODUCT_ID }}
|
||||
|
||||
publish_workshop:
|
||||
name: Publish to Steam Workshop
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, version, changelog, github-release]
|
||||
|
||||
steps:
|
||||
- name: Checkout gmod-integration
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.version.outputs.new_tag }}
|
||||
|
||||
- name: Clone gmod-workshop-cicd
|
||||
run: |
|
||||
git clone https://github.com/linventif/gmod-workshop-cicd.git gmod-workshop-cicd
|
||||
|
||||
- name: Build gmod-uploader image
|
||||
run: |
|
||||
docker build -t gmod-uploader ./gmod-workshop-cicd
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install steampy
|
||||
run: pip install steampy
|
||||
|
||||
- name: Generate Steam Guard OTP
|
||||
id: steam_otp
|
||||
env:
|
||||
STEAM_SHARED_SECRET: ${{ secrets.STEAM_SHARED_SECRET }}
|
||||
run: |
|
||||
echo "otp=$(python3 otp.py)" >> $GITHUB_OUTPUT
|
||||
working-directory: ${{ github.workspace }}/gmod-workshop-cicd
|
||||
|
||||
- name: Publish to Workshop
|
||||
env:
|
||||
STEAM_USER: ${{ secrets.STEAM_USER }}
|
||||
STEAM_PASS: ${{ secrets.STEAM_PASS }}
|
||||
STEAM_SHARED_SECRET: ${{ secrets.STEAM_SHARED_SECRET }}
|
||||
STEAM_GUARD: ${{ steps.steam_otp.outputs.otp }}
|
||||
PUBLISHED_FILE_ID: ${{ secrets.GMOD_INTEGRATION_PUBLISHED_FILE_ID }}
|
||||
CONTENT_PATH: /workshop
|
||||
PREVIEW_FILE: /workshop/materials/gmod_integration/logo.png
|
||||
TITLE: Gmod Integration v${{ needs.version.outputs.new_version }}
|
||||
DESCRIPTION: Workshop Content of gmod-integration.com – all information on the website.
|
||||
VISIBILITY: '0'
|
||||
CHANGE_NOTE: |
|
||||
${{ needs.changelog.outputs.changelog }}
|
||||
run: |
|
||||
mkdir -p workshop
|
||||
cp -r lua/ workshop/
|
||||
cp -r materials/ workshop/
|
||||
cp addon.json workshop/
|
||||
|
||||
docker run --rm \
|
||||
-e STEAM_USER \
|
||||
-e STEAM_PASS \
|
||||
-e STEAM_SHARED_SECRET \
|
||||
-e STEAM_GUARD \
|
||||
-e CONTENT_PATH \
|
||||
-e PREVIEW_FILE \
|
||||
-e TITLE \
|
||||
-e DESCRIPTION \
|
||||
-e VISIBILITY \
|
||||
-e CHANGE_NOTE \
|
||||
-e PUBLISHED_FILE_ID \
|
||||
-v ${{ github.workspace }}/workshop:/workshop:ro \
|
||||
gmod-uploader
|
192
README.md
Normal file
192
README.md
Normal file
|
@ -0,0 +1,192 @@
|
|||
# Gmod Integration
|
||||
|
||||
**Connect your Garry's Mod server to Discord with powerful integration features!**
|
||||
|
||||
Gmod Integration is a comprehensive addon that bridges your GMod server with Discord, providing real-time player verification, server statistics, admin tools, and much more. Whether you're running a small community server or managing a large gaming network, our addon enhances your server management experience with seamless Discord integration.
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- **Player Verification**: Automatic Discord account linking and verification
|
||||
- **Real-time Statistics**: Live server status and player count updates
|
||||
- **Admin Panel**: In-game configuration interface with multi-language support
|
||||
- **Server Protection**: Anti-cheat integration and player filtering
|
||||
- **Custom Webhooks**: Send server events to Discord channels
|
||||
- **Multi-language Support**: Available in English, German, French, Spanish, Italian, Dutch, Russian, Polish, and Turkish
|
||||
- **Premium Features**: Advanced analytics, priority support, and extended functionality
|
||||
...
|
||||
|
||||
## 📋 Prerequisites
|
||||
|
||||
Before installing Gmod Integration, ensure you have:
|
||||
|
||||
- A Garry's Mod dedicated server
|
||||
- Discord server with Administrator permissions
|
||||
- Basic knowledge of server file management
|
||||
|
||||
## 🛠️ Installation
|
||||
|
||||
### Method 1: Steam Workshop (Recommended)
|
||||
|
||||
1. **Subscribe to the addon** on Steam Workshop
|
||||
|
||||
- Search for "Gmod Integration" on the Steam Workshop
|
||||
- Click "Subscribe" to add it to your server
|
||||
|
||||
2. **Install the DLL** (Required for full functionality)
|
||||
- Download the latest DLL from our [GitHub Releases](https://github.com/gmod-integration/releases)
|
||||
- Place `gmsv_gmod_integration_loader_<YOUR-SERVER-OS>.dll` in your server's `garrysmod/lua/bin/` directory or create the directory if it doesn't exist
|
||||
- Restart your server to apply changes
|
||||
|
||||
### Method 2: Manual Installation
|
||||
|
||||
1. **Download the addon**
|
||||
|
||||
- Get the latest release from [GitHub](https://github.com/gmod-integration/releases)
|
||||
- Extract the zip file
|
||||
|
||||
2. **Install files**
|
||||
|
||||
- Copy the `gmod-integration` folder to your `garrysmod/addons/` directory
|
||||
- Install the DLL as described in Method 1
|
||||
|
||||
3. **Restart your server**
|
||||
- Restart your Garry's Mod server to load the addon
|
||||
|
||||
## ⚙️ Basic Configuration
|
||||
|
||||
1. **Start your server** and join as an admin
|
||||
2. **Open the admin panel** by typing `!gmi` in chat
|
||||
3. **Configure your settings**:
|
||||
- Enter your Server ID (found on the web panel)
|
||||
- Enter your Server Token (found on the web panel)
|
||||
- Test the connection to verify everything works
|
||||
|
||||
## 🌟 Premium Activation
|
||||
|
||||
### For GMod Store Purchasers
|
||||
|
||||
1. **Visit the Dashboard**
|
||||
|
||||
- Go to [Gmod Integration Dashboard](https://gmod-integration.com/dashboard)
|
||||
- Log in with your Discord account
|
||||
|
||||
2. **Activate Premium**
|
||||
|
||||
- Select your Discord server from the list
|
||||
- Click "Activate Premium" under your server card
|
||||
- A ⭐️ star badge will appear confirming activation
|
||||
|
||||
3. **Enjoy Premium Features**
|
||||
- Real-time server statistics
|
||||
- Custom webhook endpoints
|
||||
- Extended audit logs (90 days retention)
|
||||
- Priority Discord support
|
||||
- Monthly usage reports
|
||||
|
||||
### For BuiltByBit Purchasers
|
||||
|
||||
Since we don't have automated BuiltByBit integration yet, follow these steps:
|
||||
|
||||
1. **Gather your purchase proof**
|
||||
|
||||
- Take a screenshot of your BuiltByBit receipt
|
||||
- Include order ID, purchase date, and total amount
|
||||
|
||||
2. **Contact our support**
|
||||
|
||||
- Join our [Discord Server](https://gmod-integration.com/discord)
|
||||
- Post your receipt in the `#premium-support` channel
|
||||
- Mention that you're a BuiltByBit purchaser
|
||||
|
||||
3. **Manual activation**
|
||||
- Our team will manually verify and activate Premium
|
||||
- This usually takes less than 4 business hour during work days
|
||||
|
||||
## 🔧 Advanced Configuration
|
||||
|
||||
### DLL Installation Details
|
||||
|
||||
The DLL provides enhanced functionality including:
|
||||
|
||||
- Advanced authentication features
|
||||
- Improved performance and stability
|
||||
- Additional security measures
|
||||
- Extended API capabilities
|
||||
|
||||
**Installation paths:**
|
||||
|
||||
- **Linux32 (default)**: `garrysmod/lua/bin/gmsv_gmod_integration_loader_linux.dll`
|
||||
- **Linux64**: `garrysmod/lua/bin/gmsv_gmod_integration_loader_linux64.dll`
|
||||
- **Windows**: `garrysmod/lua/bin/gmsv_gmod_integration_loader_win32.dll`
|
||||
- **Windows64**: `garrysmod/lua/bin/gmsv_gmod_integration_loader_win64.dll`
|
||||
|
||||
### Configuration File
|
||||
|
||||
The addon automatically creates a configuration file at:
|
||||
`garrysmod/data/gm_integration/config.json`
|
||||
|
||||
Most settings can be changed through the in-game admin panel, but advanced users can edit this file directly.
|
||||
|
||||
## 🌍 Language Support
|
||||
|
||||
Gmod Integration supports multiple languages:
|
||||
|
||||
- 🇺🇸 English (Default)
|
||||
- 🇩🇪 German (Deutsch)
|
||||
- 🇫🇷 French (Français)
|
||||
- 🇪🇸 Spanish (Español)
|
||||
- 🇮🇹 Italian (Italiano)
|
||||
- 🇳🇱 Dutch (Nederlands)
|
||||
- 🇷🇺 Russian (Русский)
|
||||
- 🇵🇱 Polish (Polski)
|
||||
- 🇹🇷 Turkish (Türkçe)
|
||||
|
||||
Change the language in the admin panel under Settings > Language.
|
||||
|
||||
## 🆘 Support & Contact
|
||||
|
||||
Need help? We're here to assist you:
|
||||
|
||||
- **Discord Server**: [Join our community](https://gmod-integration.com/discord) for real-time support
|
||||
- **Documentation**: [Full documentation](https://gmod-integration.com/docs)
|
||||
|
||||
## 🔍 Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Addon not loading:**
|
||||
|
||||
- Ensure the addon is properly installed in the addons folder or in the workshop and verify the DLL is present
|
||||
- Check server console for error messages
|
||||
- Verify file permissions
|
||||
|
||||
**DLL not found error:**
|
||||
|
||||
- Make sure the DLL is in the correct `lua/bin/` directory or create the directory if it doesn't exist
|
||||
- Check that you're using the correct DLL for your operating system
|
||||
- Restart the server after installing the DLL
|
||||
|
||||
**Connection issues:**
|
||||
|
||||
- Verify your Server ID and Token are correct
|
||||
- Check your server's internet connection
|
||||
- Ensure firewall isn't blocking outbound connections
|
||||
|
||||
### Getting Help
|
||||
|
||||
If you're still experiencing issues:
|
||||
|
||||
1. Join our Discord server
|
||||
2. Provide your server console logs
|
||||
3. Describe the exact steps that led to the problem
|
||||
4. Include your server operating system and GMod version
|
||||
|
||||
## 📄 License
|
||||
|
||||
This addon is proprietary software. Usage is subject to the terms of service available on our website.
|
||||
|
||||
---
|
||||
|
||||
**Made with ❤️ by the Gmod Integration Team**
|
||||
|
||||
_Enhance your Garry's Mod server with the power of Discord integration!_
|
23
addon.json
Normal file
23
addon.json
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"title": "Gmod Integration",
|
||||
"type": "ServerContent",
|
||||
"tags": ["fun", "roleplay"],
|
||||
"ignore": [
|
||||
".git/**",
|
||||
".github/**",
|
||||
"README.md",
|
||||
"*.md",
|
||||
"*.yml",
|
||||
"*.yaml",
|
||||
"Dockerfile",
|
||||
"entrypoint.sh",
|
||||
"otp.py",
|
||||
"github-action.yml",
|
||||
"publish_gmod_addon.sh",
|
||||
"test.gma",
|
||||
"gmpublisher.gma",
|
||||
"ws-ci/**",
|
||||
"example_addon/**",
|
||||
"extracted/**"
|
||||
]
|
||||
}
|
|
@ -1,69 +1,154 @@
|
|||
if game.SinglePlayer() then return print("Gmod Integration is not supported in Singleplayer!") end
|
||||
local alreadyLoadGMI = gmInte
|
||||
local function dllInstalled()
|
||||
return file.Exists("lua/bin/gmsv_gmod_integration_loader_linux.dll", "GAME") || file.Exists("gmsv_gmod_integration_loader_linux64.dll", "GAME") || file.Exists("lua/bin/gmsv_gmod_integration_loader_win32.dll", "GAME") || file.Exists("gmsv_gmod_integration_loader_win64.dll", "GAME")
|
||||
end
|
||||
|
||||
local isLatest = debug.getinfo(1, "S").source == "@addons/_gmod_integration_latest/lua/autorun/_gmod_integration_latest.lua"
|
||||
local isLatestExist = file.Exists("_gmod_integration_latest", "LUA")
|
||||
if !alreadyLoadGMI then
|
||||
if dllInstalled() then
|
||||
if !file.Exists("gm_integration", "DATA") || !file.Exists("gm_integration/tmp.json", "DATA") then file.CreateDir("gm_integration") end
|
||||
file.Write("gm_integration/tmp.json", util.TableToJSON({
|
||||
gmod_integration_latest_updated = false,
|
||||
}, true))
|
||||
|
||||
require("gmod_integration_loader")
|
||||
local tmp = util.JSONToTable(file.Read("gm_integration/tmp.json", "DATA"))
|
||||
if tmp.gmod_integration_latest_updated then
|
||||
print(" | " .. os.date("%Y-%m-%d %H:%M:%S") .. " | Gmod Integration | " .. "Latest version of Gmod Integration is already installed, skipping update.")
|
||||
RunConsoleCommand("_restart")
|
||||
timer.Simple(1, function()
|
||||
RunConsoleCommand("_restart")
|
||||
end)
|
||||
return
|
||||
end
|
||||
|
||||
if !isLatest then return end
|
||||
end
|
||||
else
|
||||
if !isLatest && isLatestExist then return end
|
||||
end
|
||||
|
||||
gmInte = gmInte || {}
|
||||
gmInte.version = "0.4.3"
|
||||
gmInte.version = "5.0.22" // This will be automatically updated by GitHub Actions
|
||||
gmInte.config = {}
|
||||
gmInte.materials = {}
|
||||
local function loadServerConfig()
|
||||
gmInte.useDataConfig = true
|
||||
gmInte.dllInstalled = dllInstalled
|
||||
function gmInte.log(msg, onlyOndebug)
|
||||
if onlyOndebug && !gmInte.config.debug then return end
|
||||
print(" | " .. os.date(gmInte.config.logTimestamp || "%Y-%m-%d %H:%M:%S") .. " | Gmod Integration | " .. msg)
|
||||
end
|
||||
|
||||
function gmInte.logError(msg, onlyOndebug)
|
||||
if onlyOndebug && !gmInte.config.debug then return end
|
||||
gmInte.log("ERROR | " .. msg)
|
||||
end
|
||||
|
||||
function gmInte.logWarning(msg, onlyOndebug)
|
||||
if onlyOndebug && !gmInte.config.debug then return end
|
||||
gmInte.log("WARNING | " .. msg)
|
||||
end
|
||||
|
||||
function gmInte.logHint(msg, onlyOndebug)
|
||||
if onlyOndebug && !gmInte.config.debug then return end
|
||||
gmInte.log("HINT | " .. msg)
|
||||
end
|
||||
|
||||
local function loadConfig()
|
||||
RunConsoleCommand("sv_hibernate_think", "1")
|
||||
if !file.Exists("gm_integration", "DATA") || !file.Exists("gm_integration/config.json", "DATA") then
|
||||
file.CreateDir("gm_integration")
|
||||
file.Write("gm_integration/config.json", util.TableToJSON(gmInte.config, true))
|
||||
else
|
||||
if gmInte.config.id && gmInte.config.id != "" then return end
|
||||
if gmInte.config.id && gmInte.config.id != "" then
|
||||
gmInte.useDataConfig = false
|
||||
timer.Simple(1, function() gmInte.log("Using Data Config | This is not recommended, please revert change and use ig cmd !gmi to edit your config", true) end)
|
||||
return
|
||||
end
|
||||
|
||||
local oldConfig = util.JSONToTable(file.Read("gm_integration/config.json", "DATA"))
|
||||
if !oldConfig.version || (oldConfig.version < gmInte.version) then
|
||||
print(" | Merging Config | gmod_integration/sv_config.lua")
|
||||
if !oldConfig.version || (oldConfig.version != gmInte.version) then
|
||||
table.Merge(gmInte.config, oldConfig)
|
||||
gmInte.config.version = gmInte.version
|
||||
file.Write("gm_integration/config.json", util.TableToJSON(gmInte.config, true))
|
||||
else
|
||||
gmInte.config = oldConfig
|
||||
end
|
||||
|
||||
gmInte.log("Using Data Config: Data config loaded from data/gm_integration/config.json")
|
||||
end
|
||||
end
|
||||
|
||||
local function loadAllFiles(folder)
|
||||
local files, folders = file.Find(folder .. "/*", "LUA")
|
||||
for k, fileName in SortedPairs(files) do
|
||||
local path = folder .. "/" .. fileName
|
||||
print(" | Loading File | " .. path)
|
||||
if string.StartWith(fileName, "cl_") then
|
||||
if SERVER then
|
||||
AddCSLuaFile(path)
|
||||
else
|
||||
include(path)
|
||||
end
|
||||
elseif string.StartWith(fileName, "sv_") then
|
||||
if SERVER then include(path) end
|
||||
elseif string.StartWith(fileName, "sh_") then
|
||||
if SERVER then AddCSLuaFile(path) end
|
||||
local loadedFiles = {}
|
||||
local function loadFile(folder, fileName)
|
||||
local path = folder .. "/" .. fileName
|
||||
if loadedFiles[path] then return end
|
||||
loadedFiles[path] = true
|
||||
if string.StartWith(fileName, "cl_") then
|
||||
if SERVER then
|
||||
AddCSLuaFile(path)
|
||||
else
|
||||
include(path)
|
||||
end
|
||||
|
||||
if fileName == "sv_config.lua" then
|
||||
loadServerConfig()
|
||||
continue
|
||||
end
|
||||
elseif string.StartWith(fileName, "sv_") then
|
||||
if SERVER then include(path) end
|
||||
elseif string.StartWith(fileName, "sh_") then
|
||||
if SERVER then AddCSLuaFile(path) end
|
||||
include(path)
|
||||
end
|
||||
|
||||
for k, v in SortedPairs(folders, true) do
|
||||
loadAllFiles(folder .. "/" .. v, name)
|
||||
if fileName == "sv_config.lua" then loadConfig() end
|
||||
gmInte.log("File Loaded: " .. path)
|
||||
end
|
||||
|
||||
local function loadFolder(folder)
|
||||
local files, folders = file.Find(folder .. "/*", "LUA")
|
||||
for k, fileName in SortedPairs(files) do
|
||||
loadFile(folder, fileName)
|
||||
end
|
||||
|
||||
for k, subFolder in SortedPairs(folders) do
|
||||
loadFolder(folder .. "/" .. subFolder)
|
||||
end
|
||||
end
|
||||
|
||||
print(" ")
|
||||
print(" ")
|
||||
print(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
|
||||
print(" - - ")
|
||||
print(" - Gmod Integration v" .. gmInte.version .. " - ")
|
||||
print(" - - ")
|
||||
print(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
|
||||
print(" - - ")
|
||||
print(" - Thanks for using Gmod Integration ! - ")
|
||||
print(" - If you have any questions, please contact us on Discord! - ")
|
||||
print(" - https://gmod-integration.com/discord - ")
|
||||
print(" - - ")
|
||||
print(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
|
||||
print(" ")
|
||||
loadAllFiles("gmod_integration")
|
||||
if SERVER then
|
||||
print(" ")
|
||||
print(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
|
||||
print(" - - ")
|
||||
print(" - Gmod Integration v" .. gmInte.version .. " - ")
|
||||
print(" - - ")
|
||||
print(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
|
||||
print(" - - ")
|
||||
print(" - Thanks for using Gmod Integration ! - ")
|
||||
print(" - If you have any questions, please contact us on Discord! - ")
|
||||
print(" - https://gmod-integration.com/discord - ")
|
||||
print(" - - ")
|
||||
print(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
|
||||
print(" ")
|
||||
else
|
||||
print(" ")
|
||||
print(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
|
||||
print(" - - ")
|
||||
print(" - Gmod Integration v" .. gmInte.version .. " - ")
|
||||
print(" - - ")
|
||||
print(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
|
||||
print(" - - ")
|
||||
print(" - Thanks for using Gmod Integration ! - ")
|
||||
print(" - If you have any questions, please contact us on Discord! - ")
|
||||
print(" - https://gmod-integration.com/discord - ")
|
||||
print(" - - ")
|
||||
print(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
|
||||
print(" ")
|
||||
end
|
||||
|
||||
gmInte.execFolder = debug.getinfo(1, "S").source:match("([^/\\]+)$"):gsub("%.lua$", "") || "gmod_integration"
|
||||
loadFile(gmInte.execFolder, "sv_config.lua")
|
||||
loadFolder(gmInte.execFolder .. "/languages")
|
||||
loadFolder(gmInte.execFolder .. "/core/utils")
|
||||
loadFolder(gmInte.execFolder .. "/core/ui")
|
||||
loadFolder(gmInte.execFolder .. "/core")
|
||||
loadFolder(gmInte.execFolder .. "/modules")
|
||||
loadFolder(gmInte.execFolder)
|
||||
print(" ")
|
|
@ -1,35 +0,0 @@
|
|||
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows", {
|
||||
icon = "gmod_integration/logo_context.png",
|
||||
title = "GM Integration",
|
||||
width = 960,
|
||||
height = 700,
|
||||
onewindow = true,
|
||||
init = function(icon, window)
|
||||
window:Close()
|
||||
gmInte.openAdminConfig()
|
||||
end
|
||||
})
|
||||
|
||||
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows:ReportBug", {
|
||||
icon = "gmod_integration/logo_context_report.png",
|
||||
title = "Report Bug",
|
||||
width = 960,
|
||||
height = 700,
|
||||
onewindow = true,
|
||||
init = function(icon, window)
|
||||
window:Close()
|
||||
gmInte.openReportBug()
|
||||
end
|
||||
})
|
||||
|
||||
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows:SendScreen", {
|
||||
icon = "gmod_integration/logo_context_screen.png",
|
||||
title = "Screenshot",
|
||||
width = 960,
|
||||
height = 700,
|
||||
onewindow = true,
|
||||
init = function(icon, window)
|
||||
window:Close()
|
||||
gmInte.contextScreenshot()
|
||||
end
|
||||
})
|
|
@ -1,9 +0,0 @@
|
|||
hook.Add("InitPostEntity", "gmInte:Ply:Ready", function() gmInte.SendNet("ready") end)
|
||||
hook.Add("OnPlayerChat", "gmInte:OnPlayerChat:AdminCmd", function(ply, strText, bTeamOnly, bPlayerIsDead)
|
||||
if ply != LocalPlayer() then return end
|
||||
strText = string.lower(strText)
|
||||
if strText == "/gmi" || strText == "!gmi" then
|
||||
gmInte.openAdminConfig()
|
||||
return true
|
||||
end
|
||||
end)
|
|
@ -1,89 +0,0 @@
|
|||
function gmInte.chatAddText(...)
|
||||
local args = {...}
|
||||
table.insert(args, 1, Color(255, 130, 92))
|
||||
table.insert(args, 2, "[Gmod Integration] ")
|
||||
chat.AddText(unpack(args))
|
||||
end
|
||||
|
||||
function gmInte.chatAddTextFromTable(data)
|
||||
local args = {}
|
||||
for _, v in ipairs(data) do
|
||||
table.insert(args, v.color || Color(255, 255, 255))
|
||||
table.insert(args, v.text)
|
||||
end
|
||||
|
||||
gmInte.chatAddText(unpack(args))
|
||||
end
|
||||
|
||||
function gmInte.showTestConnection(data)
|
||||
if data && data.id then
|
||||
gmInte.chatAddText(Color(89, 194, 89), gmInte.getTranslation("chat.authentication_success", "Successfully Authenticated"), Color(255, 255, 255), gmInte.getTranslation("chat.server_link", ", server linked as {1}.", data.name))
|
||||
else
|
||||
gmInte.chatAddText(Color(228, 81, 81), gmInte.getTranslation("chat.authentication_failed", "Failed to Authenticate"), Color(255, 255, 255), gmInte.getTranslation("chat.server_fail", ", check your ID and Token."))
|
||||
end
|
||||
end
|
||||
|
||||
function gmInte.openAdminConfig()
|
||||
if !LocalPlayer():gmIntIsAdmin() then
|
||||
gmInte.chatAddText(Color(228, 81, 81), gmInte.getTranslation("chat.missing_permissions", "You do not have permission to do this action."))
|
||||
return
|
||||
end
|
||||
|
||||
gmInte.SendNet("getConfig")
|
||||
end
|
||||
|
||||
hook.Add("HUDPaint", "gmInte:HUD:ShowScreenshotInfo", function()
|
||||
if !gmInte.showScreenshotInfo then return end
|
||||
local screenInfo = {
|
||||
{
|
||||
txt = "Server ID",
|
||||
val = gmInte.config.id
|
||||
},
|
||||
{
|
||||
txt = "SteamID64",
|
||||
val = LocalPlayer():SteamID64()
|
||||
},
|
||||
{
|
||||
txt = "Date",
|
||||
val = os.date("%Y-%m-%d %H:%M:%S")
|
||||
},
|
||||
{
|
||||
txt = "Position",
|
||||
val = function()
|
||||
local pos = LocalPlayer():GetPos()
|
||||
local newPos = ""
|
||||
for i = 1, 3 do
|
||||
newPos = newPos .. math.Round(pos[i])
|
||||
if i < 3 then newPos = newPos .. ", " end
|
||||
end
|
||||
return newPos
|
||||
end
|
||||
},
|
||||
{
|
||||
txt = "Map",
|
||||
val = game.GetMap()
|
||||
},
|
||||
{
|
||||
txt = "Ping",
|
||||
val = LocalPlayer():Ping()
|
||||
},
|
||||
{
|
||||
txt = "FPS",
|
||||
val = function() return math.Round(1 / FrameTime()) end
|
||||
},
|
||||
{
|
||||
txt = "Size",
|
||||
val = ScrW() .. "x" .. ScrH()
|
||||
}
|
||||
}
|
||||
|
||||
local concatInfo = ""
|
||||
for k, v in pairs(screenInfo) do
|
||||
local val = v.val
|
||||
if type(val) == "function" then val = val() end
|
||||
concatInfo = concatInfo .. v.txt .. ": " .. val
|
||||
if k < #screenInfo then concatInfo = concatInfo .. " - " end
|
||||
end
|
||||
|
||||
draw.SimpleText(concatInfo, "DermaDefault", ScrW() / 2, ScrH() - 15, Color(255, 255, 255, 119), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end)
|
|
@ -1,43 +0,0 @@
|
|||
local ImageCache = {}
|
||||
function gmInte.createImgurMaterials(materials, addon_var, folder, name)
|
||||
if !file.Exists(folder, "DATA") then file.CreateDir(folder) end
|
||||
local function getMatFromUrl(url, id)
|
||||
materials[id] = Material("nil")
|
||||
if file.Exists(folder .. "/" .. id .. ".png", "DATA") && !gmInte.config.redownloadMaterials then
|
||||
addon_var[id] = Material("../data/" .. folder .. "/" .. id .. ".png", "noclamp smooth")
|
||||
gmInte.log("materials", name .. " - Image Loaded - " .. id .. ".png")
|
||||
return
|
||||
end
|
||||
|
||||
http.Fetch(url, function(body)
|
||||
file.Write(folder .. "/" .. id .. ".png", body)
|
||||
addon_var[id] = Material("../data/" .. folder .. "/" .. id .. ".png", "noclamp smooth")
|
||||
ImageCache[table.Count(ImageCache) + 1] = {
|
||||
["folder"] = folder,
|
||||
["addon_var"] = addon_var,
|
||||
["id"] = id
|
||||
}
|
||||
|
||||
gmInte.log("materials", name .. " - Image Downloaded - " .. id .. ".png")
|
||||
end)
|
||||
end
|
||||
|
||||
for k, v in pairs(materials) do
|
||||
getMatFromUrl("https://i.imgur.com/" .. v .. ".png", k)
|
||||
end
|
||||
end
|
||||
|
||||
function gmInte.redowloadMaterials()
|
||||
for k, v in pairs(ImageCache) do
|
||||
v.addon_var[v.id] = Material("../data/" .. v.folder .. "/" .. v.id .. ".png", "noclamp smooth")
|
||||
gmInte.log("materials", v.name .. " - Image Redownloaded - " .. v.id .. ".png")
|
||||
end
|
||||
end
|
||||
|
||||
concommand.Add("gmod_integration_reload_materials", gmInte.redowloadMaterials)
|
||||
concommand.Add("gmi_reload_materials", gmInte.redowloadMaterials)
|
||||
local materialsList = {
|
||||
["logo"] = "y3Mypbn"
|
||||
}
|
||||
|
||||
gmInte.createImgurMaterials(materialsList, gmInte.materials, "gmod_integration/material", "Gmod Integration")
|
|
@ -1,38 +0,0 @@
|
|||
local netSend = {
|
||||
["ready"] = 0,
|
||||
["testConnection"] = 1,
|
||||
["getConfig"] = 2,
|
||||
["saveConfig"] = 3,
|
||||
["takeScreenShot"] = 4,
|
||||
["restartMap"] = 5,
|
||||
["verifyMe"] = 6,
|
||||
}
|
||||
|
||||
function gmInte.SendNet(id, args, func)
|
||||
net.Start("gmIntegration")
|
||||
net.WriteUInt(netSend[id], 8)
|
||||
net.WriteString(util.TableToJSON(args || {}))
|
||||
if func then func() end
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local netReceive = {
|
||||
[1] = function(data) gmInte.discordSyncChatPly(data) end,
|
||||
[2] = function(data) gmInte.openConfigMenu(data) end,
|
||||
[3] = function(data) gmInte.showTestConnection(data) end,
|
||||
[5] = function(data)
|
||||
gmInte.config = table.Merge(gmInte.config, data.config)
|
||||
gmInte.version = data.other.version
|
||||
gmInte.loadTranslations()
|
||||
if !data.other.aprovedCredentials then RunConsoleCommand("gmod_integration_admin") end
|
||||
end,
|
||||
[6] = function(data) gmInte.chatAddTextFromTable(data) end,
|
||||
[7] = function() gmInte.openVerifPopup() end,
|
||||
[8] = function(data) gmInte.config.token = data.token end
|
||||
}
|
||||
|
||||
net.Receive("gmIntegration", function()
|
||||
local id = net.ReadUInt(8)
|
||||
local args = util.JSONToTable(net.ReadString())
|
||||
if netReceive[id] then netReceive[id](args) end
|
||||
end)
|
|
@ -5,12 +5,16 @@ function gmInte.getPlayerFormat(ply)
|
|||
["steamID64"] = ply:SteamID64(),
|
||||
["userGroup"] = ply:GetUserGroup(),
|
||||
["team"] = gmInte.getTeamFormat(ply:Team()),
|
||||
["branch"] = ply:gmInteGetBranch(),
|
||||
["name"] = ply:Nick(),
|
||||
["kills"] = ply:Frags(),
|
||||
["deaths"] = ply:Deaths(),
|
||||
["customValues"] = ply:gmIntGetCustomValues(),
|
||||
["connectTime"] = math.Round(RealTime() - ply:gmIntGetConnectTime()),
|
||||
["connectTime"] = math.Round(math.Round(RealTime() - ply:gmIntGetConnectTime())),
|
||||
["timeLastTeamChange"] = math.Round(RealTime() - ply:gmIntGetTimeLastTeamChange()),
|
||||
["adjustedTime"] = math.Round(ply:getAdjustedTime()),
|
||||
["ping"] = ply:Ping(),
|
||||
["fps"] = ply:gmIntGetFPS(),
|
||||
["position"] = gmInte.getVectorFormat(ply:GetPos()),
|
||||
["angle"] = gmInte.getAngleFormat(ply:EyeAngles()),
|
||||
["weapon"] = gmInte.getWeaponFormat(ply:GetActiveWeapon())
|
|
@ -108,6 +108,7 @@ local function flushLogs()
|
|||
end
|
||||
|
||||
hook.Add("ShutDown", "gmInte:Server:ShutDown:FlushLogs", flushLogs)
|
||||
hook.Add("GMI:SaveBeforeCrash", "gmInte:Server:BeforeCrash:SavePlayers", flushLogs)
|
||||
timer.Create("gmInte:http:flushLogs", 3, 0, flushLogs)
|
||||
function gmInte.http.postLog(endpoint, data)
|
||||
table.insert(nextLogPacket, {
|
9
lua/gmod_integration/core/api/sh_main.lua
Normal file
9
lua/gmod_integration/core/api/sh_main.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
function gmInte.sendToAPI(endpoint, method, data, onSuccess, onFailed)
|
||||
gmInte.http.requestAPI({
|
||||
["endpoint"] = endpoint,
|
||||
["method"] = method,
|
||||
["body"] = data,
|
||||
["success"] = onSuccess,
|
||||
["failed"] = onFailed
|
||||
})
|
||||
end
|
95
lua/gmod_integration/core/api/sv_websocket.lua
Normal file
95
lua/gmod_integration/core/api/sv_websocket.lua
Normal file
|
@ -0,0 +1,95 @@
|
|||
local function websocketDLLExist()
|
||||
local files, _ = file.Find("lua/bin/*", "GAME")
|
||||
for k, v in ipairs(files) do
|
||||
if v:find("gwsockets") then return true end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
if !websocketDLLExist() then
|
||||
timer.Simple(4, function()
|
||||
gmInte.logHint("GWSockets is not installed !, Syncronize feature will not work !")
|
||||
gmInte.logHint("Please install it from https://github.com/FredyH/GWSockets/releases")
|
||||
end)
|
||||
return
|
||||
end
|
||||
|
||||
require("gwsockets")
|
||||
local function getWebSocketURL()
|
||||
local method = gmInte.isPrivateIP(gmInte.config.websocketFQDN) && "ws" || "wss"
|
||||
return method .. "://" .. gmInte.config.websocketFQDN
|
||||
end
|
||||
|
||||
function gmInte.setupWebSocket()
|
||||
local callbacks_ = {}
|
||||
gmInte.websocket = GWSockets.createWebSocket(getWebSocketURL())
|
||||
gmInte.websocket:setHeader("id", gmInte.config.id)
|
||||
gmInte.websocket:setHeader("token", gmInte.config.token)
|
||||
gmInte.websocket:open()
|
||||
function gmInte.websocket:onConnected()
|
||||
gmInte.log("WebSocket Connected", true)
|
||||
end
|
||||
|
||||
function gmInte.websocket:onMessage(txt)
|
||||
gmInte.log("WebSocket Message: " .. txt, true)
|
||||
local data = util.JSONToTable(txt)
|
||||
if gmInte[data.method] then
|
||||
gmInte[data.method](data)
|
||||
elseif data.id && callbacks_[data.id] then
|
||||
local callback = callbacks_[data.id]
|
||||
callbacks_[data.id] = nil
|
||||
if data.error then
|
||||
gmInte.logError("WebSocket Error: " .. data.error, true)
|
||||
callback(false, data.error)
|
||||
else
|
||||
callback(true, data.data)
|
||||
end
|
||||
else
|
||||
gmInte.logError("WebSocket Message: " .. txt .. " is not a valid method !", true)
|
||||
end
|
||||
end
|
||||
|
||||
function gmInte.websocket:onDisconnected()
|
||||
gmInte.log("WebSocket Disconnected", true)
|
||||
end
|
||||
|
||||
function gmInte.websocket:onError(txt)
|
||||
gmInte.logError("WebSocket Error: " .. txt, true)
|
||||
end
|
||||
|
||||
function gmInte.websocket:send(method, data, callback, hidePrint)
|
||||
if !self:isConnected() then
|
||||
if !hidePrint then
|
||||
gmInte.logError("WebSocket is not connected, cannot send data", true)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local id = tostring(SysTime()) .. "-" .. gmInte.generateRandomString(8)
|
||||
|
||||
local packet = {
|
||||
method = method,
|
||||
data = data,
|
||||
id = id
|
||||
}
|
||||
|
||||
if callback then
|
||||
callbacks_[id] = callback
|
||||
end
|
||||
|
||||
if !hidePrint then
|
||||
gmInte.log("WebSocket Send: " .. util.TableToJSON(packet), true)
|
||||
end
|
||||
self:write(util.TableToJSON(packet))
|
||||
end
|
||||
end
|
||||
|
||||
timer.Create("gmInte:WebSocket:CheckConnection", 4, 0, function()
|
||||
if (!gmInte.websocket || !gmInte.websocket:isConnected()) && gmInte.aprovedCredentials then
|
||||
gmInte.log("WebSocket is not connected, trying to connect", true)
|
||||
gmInte.setupWebSocket()
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("GmodIntegration:Websocket:Restart", "gmInte:WebSocket:Restart", function() gmInte.setupWebSocket() end)
|
||||
hook.Add("InitPostEntity", "gmInte:ServerReady:WebSocket", function() timer.Simple(1, function() gmInte.setupWebSocket() end) end)
|
|
@ -13,6 +13,43 @@ local colorTable = {
|
|||
["buttonTextHover"] = Color(255, 255, 255, 255),
|
||||
}
|
||||
|
||||
// function to open a msg info say in game config has been disabled because default sv_config.lua has been edited
|
||||
function gmInte.openDisabledConfig()
|
||||
local frame = vgui.Create("DFrame")
|
||||
frame:SetSize(400, 120)
|
||||
frame:Center()
|
||||
frame:SetTitle(gmInte.getFrameName(gmInte.getTranslation("admin.config_disabled", "Config Disabled")))
|
||||
frame:SetDraggable(true)
|
||||
frame:ShowCloseButton(true)
|
||||
frame:MakePopup()
|
||||
gmInte.applyPaint(frame)
|
||||
local messagePanel = vgui.Create("DPanel", frame)
|
||||
messagePanel:Dock(TOP)
|
||||
messagePanel:SetSize(300, 40)
|
||||
messagePanel:DockMargin(10, 0, 10, 10)
|
||||
messagePanel:SetBackgroundColor(Color(0, 0, 0, 0))
|
||||
local messageLabel = vgui.Create("DLabel", messagePanel)
|
||||
messageLabel:Dock(FILL)
|
||||
messageLabel:SetText(gmInte.getTranslation("admin.config_disabled_description", "The config has been disabled because the default sv_config.lua has been edited.\nPlease restore the default sv_config.lua to enable the config again."))
|
||||
messageLabel:SetContentAlignment(5)
|
||||
messageLabel:SetWrap(true)
|
||||
local buttonGrid = vgui.Create("DGrid", frame)
|
||||
buttonGrid:Dock(BOTTOM)
|
||||
buttonGrid:DockMargin(5, 10, 5, 5)
|
||||
buttonGrid:SetCols(1)
|
||||
buttonGrid:SetColWide(frame:GetWide() - 10)
|
||||
buttonGrid:SetRowHeight(35)
|
||||
local button = vgui.Create("DButton")
|
||||
button:SetText(gmInte.getTranslation("admin.ok", "OK"))
|
||||
button.DoClick = function() frame:Close() end
|
||||
button:SetSize(buttonGrid:GetColWide() - 10, buttonGrid:GetRowHeight())
|
||||
gmInte.applyPaint(button)
|
||||
buttonGrid:AddItem(button)
|
||||
frame.OnClose = function() gmInte.openAdminPanel = false end
|
||||
frame.OnRemove = function() gmInte.openAdminPanel = false end
|
||||
frame.OnKeyCodePressed = function(self, key) if key == KEY_ESCAPE then self:Close() end end
|
||||
end
|
||||
|
||||
function gmInte.needRestart()
|
||||
local frame = vgui.Create("DFrame")
|
||||
frame:SetSize(400, 120)
|
||||
|
@ -99,11 +136,12 @@ function gmInte.openConfigMenu(data)
|
|||
["reloadOnEdit"] = true,
|
||||
["category"] = gmInte.getTranslation("admin.main", "Main"),
|
||||
["values"] = {
|
||||
["en"] = "English",
|
||||
["fr"] = "Français",
|
||||
["de"] = "Deutsch",
|
||||
["en"] = "English",
|
||||
["es"] = "Español",
|
||||
["fr"] = "Français",
|
||||
["it"] = "Italiano",
|
||||
["pl"] = "Polski",
|
||||
["ru"] = "Русский",
|
||||
["tr"] = "Türkçe",
|
||||
}
|
||||
|
@ -122,9 +160,10 @@ function gmInte.openConfigMenu(data)
|
|||
["label"] = gmInte.getTranslation("admin.force_player_link", "Force Player Verif"),
|
||||
["description"] = gmInte.getTranslation("admin.force_player_link_description", "Force player verification."),
|
||||
["type"] = "checkbox",
|
||||
["reloadOnEdit"] = true,
|
||||
["value"] = function(setting, value) return value end,
|
||||
["onEdit"] = function(setting, value) saveConfig(setting, value) end,
|
||||
["category"] = gmInte.getTranslation("admin.main", "Main")
|
||||
["category"] = gmInte.getTranslation("admin.trust_safety", "Trust & Safety")
|
||||
},
|
||||
{
|
||||
["id"] = "supportLink",
|
||||
|
@ -136,6 +175,50 @@ function gmInte.openConfigMenu(data)
|
|||
["onEditDelay"] = 0.5,
|
||||
["category"] = gmInte.getTranslation("admin.trust_safety", "Trust & Safety")
|
||||
},
|
||||
{
|
||||
["id"] = "verifyFamilySharing",
|
||||
["label"] = gmInte.getTranslation("admin.verifyFamilySharing", "Block Family Sharing"),
|
||||
["description"] = gmInte.getTranslation("admin.verifyFamilySharing_description", "Block family sharing players."),
|
||||
["type"] = "checkbox",
|
||||
["value"] = function(setting, value) return value end,
|
||||
["onEdit"] = function(setting, value) saveConfig(setting, value) end,
|
||||
["category"] = gmInte.getTranslation("admin.trust_safety", "Trust & Safety")
|
||||
},
|
||||
{
|
||||
["id"] = "verifyOnJoin",
|
||||
["label"] = gmInte.getTranslation("admin.verify_on_join", "Verify on Join"),
|
||||
["description"] = gmInte.getTranslation("admin.verify_on_join_description", "Verify the player when they join the server or on player ready."),
|
||||
["type"] = "checkbox",
|
||||
["condition"] = function(data) return data.forcePlayerLink end,
|
||||
["value"] = function(setting, value) return value end,
|
||||
["onEdit"] = function(setting, value) saveConfig(setting, value) end,
|
||||
["category"] = gmInte.getTranslation("admin.trust_safety", "Trust & Safety")
|
||||
},
|
||||
{
|
||||
["id"] = "verifyOnReadyKickTime",
|
||||
["label"] = gmInte.getTranslation("admin.verify_on_ready_kick_time", "Kick Time if not Verified"),
|
||||
["description"] = gmInte.getTranslation("admin.verify_on_ready_kick_time_description", "Time in seconds before kicking a player that is not verified."),
|
||||
["type"] = "textEntry",
|
||||
["condition"] = function(data) return data.forcePlayerLink end,
|
||||
["value"] = function(setting, value) return value end,
|
||||
["onEdit"] = function(setting, value) saveConfig(setting, value) end,
|
||||
["category"] = gmInte.getTranslation("admin.trust_safety", "Trust & Safety")
|
||||
},
|
||||
{
|
||||
["id"] = "clientBranch",
|
||||
["label"] = gmInte.getTranslation("admin.client_force_branch", "Client Force Branch"),
|
||||
["description"] = gmInte.getTranslation("admin.client_force_branch_description", "The branch of the addon that the clients should use."),
|
||||
["type"] = "combo",
|
||||
["value"] = function(setting, value) return value end,
|
||||
["onEdit"] = function(setting, value) saveConfig(setting, value) end,
|
||||
["category"] = gmInte.getTranslation("admin.trust_safety", "Trust & Safety"),
|
||||
["values"] = {
|
||||
["any"] = "Any",
|
||||
["dev"] = "Dev",
|
||||
["prerelease"] = "Prerelease",
|
||||
["x86-64"] = "x86-64",
|
||||
}
|
||||
},
|
||||
{
|
||||
["id"] = "debug",
|
||||
["label"] = gmInte.getTranslation("admin.debug", "Debug"),
|
||||
|
@ -176,6 +259,21 @@ function gmInte.openConfigMenu(data)
|
|||
["onEditDelay"] = 0.5,
|
||||
["category"] = gmInte.getTranslation("admin.advanced", "Advanced")
|
||||
},
|
||||
{
|
||||
["id"] = "logTimestamp",
|
||||
["label"] = gmInte.getTranslation("admin.internal_log_format", "Internal Log Format"),
|
||||
["description"] = gmInte.getTranslation("admin.internal_log_format_description", "The timestamp format of the logs."),
|
||||
["type"] = "textEntry",
|
||||
["resetIfEmpty"] = true,
|
||||
["defaultValue"] = "%Y-%m-%d %H:%M:%S",
|
||||
["value"] = function(setting, value) return value end,
|
||||
["onEdit"] = function(setting, value)
|
||||
if !value || value == "" then return end
|
||||
saveConfig(setting, value)
|
||||
end,
|
||||
["onEditDelay"] = 0.5,
|
||||
["category"] = gmInte.getTranslation("admin.advanced", "Advanced")
|
||||
},
|
||||
}
|
||||
|
||||
local buttonsInfo = {
|
||||
|
@ -241,6 +339,7 @@ function gmInte.openConfigMenu(data)
|
|||
// Sort by position
|
||||
table.sort(categoryConfig, function(a, b) return (a.position || 0) < (b.position || 0) end)
|
||||
for k, actualConfig in ipairs(categoryConfig) do
|
||||
if actualConfig.condition && !actualConfig.condition(data) then continue end
|
||||
local panel = vgui.Create("DPanel", configList)
|
||||
panel:Dock(TOP)
|
||||
panel:SetSize(300, 25)
|
||||
|
@ -282,6 +381,10 @@ function gmInte.openConfigMenu(data)
|
|||
input.OnSelect = function(self, index, value)
|
||||
if actualConfig.restart then needRestart = true end
|
||||
actualConfig.onEdit(actualConfig.id, value == gmInte.getTranslation("admin.enabled", "Enabled") && true || false)
|
||||
if actualConfig.reloadOnEdit then
|
||||
frame:Close()
|
||||
RunConsoleCommand("gmi_admin")
|
||||
end
|
||||
end
|
||||
elseif actualConfig.type == "combo" then
|
||||
input = vgui.Create("DComboBox", panel)
|
||||
|
@ -292,7 +395,7 @@ function gmInte.openConfigMenu(data)
|
|||
input:AddChoice(v, k)
|
||||
end
|
||||
|
||||
input:SetText(actualConfig.values[data[actualConfig.id]] || actualConfig.values[actualConfig.defaultValue])
|
||||
input:SetText(actualConfig.values[data[actualConfig.id]] || actualConfig.values[actualConfig.defaultValue] || "<nil>")
|
||||
input.OnSelect = function(self, index, value)
|
||||
if actualConfig.restart then needRestart = true end
|
||||
actualConfig.onEdit(actualConfig.id, posibilities[index])
|
||||
|
@ -344,5 +447,66 @@ function gmInte.openConfigMenu(data)
|
|||
end
|
||||
end
|
||||
|
||||
local alreadySkipDll = false
|
||||
function gmInte.openDllInstall()
|
||||
if !LocalPlayer():gmIntIsAdmin() then return end
|
||||
if alreadySkipDll then return end
|
||||
alreadySkipDll = true
|
||||
local frame = vgui.Create("DFrame")
|
||||
frame:SetSize(400, 250)
|
||||
frame:Center()
|
||||
frame:SetTitle(gmInte.getFrameName(gmInte.getTranslation("admin.dll_install", "DLL Install")))
|
||||
frame:SetDraggable(true)
|
||||
frame:ShowCloseButton(true)
|
||||
frame:MakePopup()
|
||||
gmInte.applyPaint(frame)
|
||||
local messageLabel = vgui.Create("DLabel", frame)
|
||||
messageLabel:Dock(FILL)
|
||||
messageLabel:SetText(gmInte.getTranslation("admin.dll_install_problem", "The Gmod Integration DLL is missing!\n\nWithout this DLL, some features will not work correctly, including authentication and advanced integration.") .. "\n\n" .. gmInte.getTranslation("admin.dll_install_description", "Install:\n1. Download 'gmsv_gmod_integration_loader_{1}.dll' from: {2}\n2. Move it to the 'garrysmod/lua/bin' folder.\n3. Restart your server.", gmInte.serverOS, "https://github.com/gmod-integration/auto-loader/releases"))
|
||||
messageLabel:SetContentAlignment(5)
|
||||
messageLabel:SetWrap(true)
|
||||
local buttonGrid = vgui.Create("DGrid", frame)
|
||||
buttonGrid:Dock(BOTTOM)
|
||||
buttonGrid:DockMargin(5, 10, 5, 5)
|
||||
buttonGrid:SetCols(1)
|
||||
buttonGrid:SetColWide(frame:GetWide() - 10)
|
||||
buttonGrid:SetRowHeight(35)
|
||||
local button = vgui.Create("DButton")
|
||||
button:SetText(gmInte.getTranslation("admin.dll_install_button", "Install DLL"))
|
||||
button.DoClick = function()
|
||||
frame:Close()
|
||||
gui.OpenURL("https://github.com/gmod-integration/auto-loader/releases")
|
||||
end
|
||||
|
||||
button:SetSize(buttonGrid:GetColWide() - 10, buttonGrid:GetRowHeight())
|
||||
gmInte.applyPaint(button)
|
||||
buttonGrid:AddItem(button)
|
||||
end
|
||||
|
||||
function gmInte.openAdminConfig()
|
||||
if !LocalPlayer():gmIntIsAdmin() then
|
||||
gmInte.chatAddText(Color(228, 81, 81), gmInte.getTranslation("chat.missing_permissions", "You do not have permission to do this action."))
|
||||
return
|
||||
end
|
||||
|
||||
gmInte.SendNet("getConfig")
|
||||
end
|
||||
|
||||
function gmInte.showTestConnection(data)
|
||||
if data && data.id then
|
||||
gmInte.chatAddText(Color(89, 194, 89), gmInte.getTranslation("chat.authentication_success", "Successfully Authenticated"), Color(255, 255, 255), gmInte.getTranslation("chat.server_link", ", server linked as {1}.", data.name))
|
||||
else
|
||||
gmInte.chatAddText(Color(228, 81, 81), gmInte.getTranslation("chat.authentication_failed", "Failed to Authenticate"), Color(255, 255, 255), gmInte.getTranslation("chat.server_fail", ", check your ID and Token."))
|
||||
end
|
||||
end
|
||||
|
||||
concommand.Add("gmod_integration_admin", function() gmInte.SendNet("getConfig") end)
|
||||
concommand.Add("gmi_admin", function() gmInte.SendNet("getConfig") end)
|
||||
concommand.Add("gmi_admin", function() gmInte.SendNet("getConfig") end)
|
||||
hook.Add("OnPlayerChat", "gmInte:OnPlayerChat:AdminCmd", function(ply, strText, bTeamOnly, bPlayerIsDead)
|
||||
if ply != LocalPlayer() then return end
|
||||
strText = string.lower(strText)
|
||||
if strText == "/gmi" || strText == "!gmi" then
|
||||
gmInte.openAdminConfig()
|
||||
return true
|
||||
end
|
||||
end)
|
11
lua/gmod_integration/core/config/cl_context_menu.lua
Normal file
11
lua/gmod_integration/core/config/cl_context_menu.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows", {
|
||||
icon = "gmod_integration/logo_context.png",
|
||||
title = "GM Integration",
|
||||
width = 960,
|
||||
height = 700,
|
||||
onewindow = true,
|
||||
init = function(icon, window)
|
||||
window:Close()
|
||||
gmInte.openAdminConfig()
|
||||
end
|
||||
})
|
26
lua/gmod_integration/core/config/sv_con.lua
Normal file
26
lua/gmod_integration/core/config/sv_con.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
local conFuncs = {
|
||||
["version"] = function() print("Version: " .. gmInte.version) end,
|
||||
["set-setting"] = function(args) gmInte.saveSetting(args[2], args[3]) end,
|
||||
["show-settings"] = function() PrintTable(gmInte.config) end,
|
||||
["try"] = function() gmInte.tryConfig() end,
|
||||
["get-server-id"] = function() print(gmInte.config.id || "none") end,
|
||||
["export-warns"] = function() hook.Run("GmodIntegration:ExportWarns") end
|
||||
}
|
||||
|
||||
local function cmdExecuted(ply, cmd, args)
|
||||
if ply:IsPlayer() && !ply:gmIntIsAdmin() then return end
|
||||
if conFuncs[args[1]] then
|
||||
conFuncs[args[1]](args)
|
||||
else
|
||||
print("Unknown Command, available commands are:")
|
||||
print("version")
|
||||
print("set-setting <setting> <value>")
|
||||
print("show-settings")
|
||||
print("try")
|
||||
print("get-server-id")
|
||||
print("export-warns")
|
||||
end
|
||||
end
|
||||
|
||||
concommand.Add("gmi", cmdExecuted)
|
||||
concommand.Add("gmod-integration", cmdExecjsonuted)
|
|
@ -1,14 +1,10 @@
|
|||
function gmInte.saveSetting(setting, value)
|
||||
if gmInte.config[setting] == nil then
|
||||
gmInte.log("Unknown Setting")
|
||||
return
|
||||
end
|
||||
|
||||
if setting == "language" && !file.Exists("gmod_integration/shared/languages/sh_" .. value .. ".lua", "LUA") then
|
||||
gmInte.log("Unknown Language")
|
||||
gmInte.log("Unknown Setting " .. setting)
|
||||
return
|
||||
end
|
||||
|
||||
if setting == "id" || setting == "token" then gmInte.aprovedCredentials = false end
|
||||
// Boolean
|
||||
if value == "true" then value = true end
|
||||
if value == "false" then value = false end
|
||||
|
@ -42,14 +38,13 @@ function gmInte.testConnection(ply)
|
|||
gmInte.http.get("/servers/:serverID", function(code, body) if ply then gmInte.SendNet("testApiConnection", body, ply) end end, function(code, body) if ply then gmInte.SendNet("testApiConnection", body, ply) end end)
|
||||
end
|
||||
|
||||
function gmInte.refreshSettings()
|
||||
gmInte.config = util.JSONToTable(file.Read("gm_integration/config.json", "DATA"))
|
||||
gmInte.log("Settings Refreshed")
|
||||
gmInte.tryConfig()
|
||||
end
|
||||
|
||||
function gmInte.superadminGetConfig(ply)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) || !ply:gmIntIsAdmin() then return end
|
||||
if !gmInte.useDataConfig then
|
||||
gmInte.SendNet("notEditableConfig", {}, ply)
|
||||
return
|
||||
end
|
||||
|
||||
gmInte.config.websocket = GWSockets && true || false
|
||||
gmInte.SendNet("adminConfig", gmInte.config, ply)
|
||||
end
|
||||
|
@ -63,11 +58,15 @@ function gmInte.publicGetConfig(ply)
|
|||
["apiFQDN"] = gmInte.config.apiFQDN,
|
||||
["websocketFQDN"] = gmInte.config.websocketFQDN,
|
||||
["adminRank"] = gmInte.config.adminRank,
|
||||
["language"] = gmInte.config.language
|
||||
["language"] = gmInte.config.language,
|
||||
["clientBranch"] = gmInte.config.clientBranch,
|
||||
["logTimestamp"] = gmInte.config.logTimestamp
|
||||
},
|
||||
["other"] = {
|
||||
["aprovedCredentials"] = gmInte.aprovedCredentials,
|
||||
["version"] = gmInte.version,
|
||||
["dllExists"] = gmInte.dllInstalled(),
|
||||
["serverOS"] = gmInte.detectOS(),
|
||||
}
|
||||
}, ply)
|
||||
end
|
38
lua/gmod_integration/core/net/cl_net.lua
Normal file
38
lua/gmod_integration/core/net/cl_net.lua
Normal file
|
@ -0,0 +1,38 @@
|
|||
function gmInte.SendNet(id, args, func)
|
||||
net.Start("gmIntegration")
|
||||
net.WriteString(id)
|
||||
net.WriteString(util.TableToJSON(args || {}))
|
||||
if func then func() end
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local netReceive = {
|
||||
["wsRelayDiscordChat"] = function(data) gmInte.discordSyncChatPly(data) end,
|
||||
["adminConfig"] = function(data) gmInte.openConfigMenu(data) end,
|
||||
["testApiConnection"] = function(data) gmInte.showTestConnection(data) end,
|
||||
["publicConfig"] = function(data)
|
||||
gmInte.config = table.Merge(gmInte.config, data.config)
|
||||
gmInte.version = data.other.version
|
||||
gmInte.serverOS = data.other.serverOS
|
||||
gmInte.dllExists = data.other.dllExists
|
||||
if !gmInte.dllExists then gmInte.openDllInstall() end
|
||||
gmInte.loadTranslations()
|
||||
if gmInte.config.clientBranch != "any" && gmInte.config.clientBranch != BRANCH then gmInte.openWrongBranchPopup() end
|
||||
if !data.other.aprovedCredentials then RunConsoleCommand("gmod_integration_admin") end
|
||||
end,
|
||||
["chatColorMessage"] = function(data) gmInte.chatAddTextFromTable(data) end,
|
||||
["openVerifPopup"] = function() gmInte.openVerifPopup() end,
|
||||
["savePlayerToken"] = function(data) gmInte.config.token = data.token end,
|
||||
["notEditableConfig"] = function() gmInte.openDisabledConfig() end,
|
||||
}
|
||||
|
||||
net.Receive("gmIntegration", function()
|
||||
local id = net.ReadString()
|
||||
local args = util.JSONToTable(net.ReadString())
|
||||
if !netReceive[id] then return end
|
||||
netReceive[id](args)
|
||||
if gmInte.config.debug then
|
||||
gmInte.log("[net] Received net message: " .. id)
|
||||
gmInte.log("[net] Data: " .. util.TableToJSON(args))
|
||||
end
|
||||
end)
|
42
lua/gmod_integration/core/net/sv_net.lua
Normal file
42
lua/gmod_integration/core/net/sv_net.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
util.AddNetworkString("gmIntegration")
|
||||
function gmInte.SendNet(id, data, ply, func)
|
||||
net.Start("gmIntegration")
|
||||
net.WriteString(id)
|
||||
net.WriteString(util.TableToJSON(data || {}))
|
||||
if func then func() end
|
||||
if ply == nil then
|
||||
net.Broadcast()
|
||||
else
|
||||
net.Send(ply)
|
||||
end
|
||||
end
|
||||
|
||||
local netReceive = {
|
||||
["ready"] = function(ply, data)
|
||||
if ply.gmIntIsReady then return end
|
||||
ply.branch = data.branch
|
||||
hook.Run("gmInte:PlayerReady", ply)
|
||||
end,
|
||||
["testConnection"] = function(ply, data) gmInte.testConnection(ply, data) end,
|
||||
["getConfig"] = function(ply) gmInte.superadminGetConfig(ply) end,
|
||||
["saveConfig"] = function(ply, data) gmInte.superadminSetConfig(ply, data) end,
|
||||
["takeScreenShot"] = function(ply) gmInte.takeScreenshot(ply) end,
|
||||
["restartMap"] = function(ply)
|
||||
if !ply:gmIntIsAdmin() then return end
|
||||
RunConsoleCommand("changelevel", game.GetMap())
|
||||
end,
|
||||
["verifyMe"] = function(ply) gmInte.verifyPlayer(ply) end,
|
||||
["sendFPS"] = function(ply, data) ply:gmInteSetFPS(data.fps) end,
|
||||
}
|
||||
|
||||
net.Receive("gmIntegration", function(len, ply)
|
||||
if !ply || ply && !ply:IsValid() then return end
|
||||
local id = net.ReadString()
|
||||
local data = util.JSONToTable(net.ReadString() || "{}")
|
||||
if !netReceive[id] then return end
|
||||
netReceive[id](ply, data)
|
||||
if gmInte.config.debug then
|
||||
gmInte.log("[net] Received net message: " .. id .. " from " .. (ply && ply:Nick() || "Unknown"))
|
||||
gmInte.log("[net] Data: " .. util.TableToJSON(data))
|
||||
end
|
||||
end)
|
|
@ -37,5 +37,5 @@ function gmInte.sendPlayerToken(ply)
|
|||
end)
|
||||
end
|
||||
|
||||
hook.Add("gmInte:PlayerReady", "gmInte:Verif:PlayerReady", function(ply) gmInte.sendPlayerToken(ply) end)
|
||||
hook.Add("gmInte:PlayerReady", "gmInte:PlayerReady:SendToken", function(ply) gmInte.sendPlayerToken(ply) end)
|
||||
hook.Add("Initialize", "gmInte:Server:Initialize:GetPublicToken", function() timer.Simple(1, function() gmInte.getPublicServerToken(function(publicToken) gmInte.log("Server Public Token Received: " .. publicToken) end) end) end)
|
16
lua/gmod_integration/core/utils/cl_main.lua
Normal file
16
lua/gmod_integration/core/utils/cl_main.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
function gmInte.chatAddText(...)
|
||||
local args = {...}
|
||||
table.insert(args, 1, Color(255, 130, 92))
|
||||
table.insert(args, 2, "[Gmod Integration] ")
|
||||
chat.AddText(unpack(args))
|
||||
end
|
||||
|
||||
function gmInte.chatAddTextFromTable(data)
|
||||
local args = {}
|
||||
for _, v in ipairs(data) do
|
||||
table.insert(args, v.color || Color(255, 255, 255))
|
||||
table.insert(args, v.text)
|
||||
end
|
||||
|
||||
gmInte.chatAddText(unpack(args))
|
||||
end
|
82
lua/gmod_integration/core/utils/sh_player_adjusted_time.lua
Normal file
82
lua/gmod_integration/core/utils/sh_player_adjusted_time.lua
Normal file
|
@ -0,0 +1,82 @@
|
|||
local ply = FindMetaTable("Player")
|
||||
function ply:gmIntGetTimeLastTeamChange()
|
||||
return self.gmIntTimeLastTeamChange || RealTime()
|
||||
end
|
||||
|
||||
function ply:gmInteResetTimeLastTeamChange()
|
||||
self.gmIntTimeLastTeamChange = RealTime()
|
||||
end
|
||||
|
||||
gmInte.restoreFileCache = gmInte.restoreFileCache || {}
|
||||
function ply:getAdjustedTime()
|
||||
if gmInte.restoreFileCache == nil || gmInte.restoreFileCache.sysTime == nil || gmInte.restoreFileCache.playersList == nil then return 0 end
|
||||
if SERVER then
|
||||
if table.IsEmpty(gmInte.restoreFileCache) then
|
||||
if file.Exists("gm_integration/player_before_map_change.json", "DATA") then
|
||||
gmInte.restoreFileCache = util.JSONToTable(file.Read("gm_integration/player_before_map_change.json", "DATA"))
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
else
|
||||
if table.IsEmpty(gmInte.restoreFileCache) then
|
||||
if file.Exists("gmod_integration/player_before_map_change.json", "DATA") then
|
||||
gmInte.restoreFileCache = util.JSONToTable(file.Read("gmod_integration/player_before_map_change.json", "DATA"))
|
||||
else
|
||||
return 0
|
||||
end
|
||||
|
||||
gmInte.restoreFileCache = gmInte.restoreFileCache[gmInte.config.id]
|
||||
end
|
||||
end
|
||||
|
||||
if !gmInte.restoreFileCache.sysTime || !gmInte.restoreFileCache.playersList then return 0 end
|
||||
if (gmInte.restoreFileCache.sysTime + 60 * 5) < (os.time() - self:gmIntGetConnectTime()) then return 0 end
|
||||
if !gmInte.restoreFileCache.playersList[self:SteamID()] then return 0 end
|
||||
return gmInte.restoreFileCache.playersList[self:SteamID()].connectTime || 0
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
gameevent.Listen("player_connect")
|
||||
hook.Add("player_connect", "gmInte:Player:Connect:RemoveRestore", function(data)
|
||||
if table.IsEmpty(gmInte.restoreFileCache) then
|
||||
if file.Exists("gm_integration/player_before_map_change.json", "DATA") then
|
||||
gmInte.restoreFileCache = util.JSONToTable(file.Read("gm_integration/player_before_map_change.json", "DATA"))
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if gmInte.restoreFileCache.playersList && gmInte.restoreFileCache.playersList[data.networkid] then
|
||||
gmInte.restoreFileCache.playersList[data.networkid] = nil
|
||||
file.Write("gm_integration/player_before_map_change.json", util.TableToJSON(gmInte.restoreFileCache, true))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local function saveTimeToLocal()
|
||||
local dataToSave = {
|
||||
["version"] = "1.0",
|
||||
["serverID"] = gmInte.config.id,
|
||||
["playersList"] = {},
|
||||
["sysTime"] = os.time()
|
||||
}
|
||||
|
||||
if SERVER then
|
||||
for _, ply in ipairs(player.GetAll()) do
|
||||
dataToSave.playersList[ply:SteamID()] = gmInte.getPlayerFormat(ply)
|
||||
end
|
||||
|
||||
if !file.Exists("gm_integration", "DATA") then file.CreateDir("gm_integration") end
|
||||
file.Write("gm_integration/player_before_map_change.json", util.TableToJSON(dataToSave, true))
|
||||
else
|
||||
dataToSave.playersList[LocalPlayer():SteamID()] = gmInte.getPlayerFormat(LocalPlayer())
|
||||
local oldData = {}
|
||||
if file.Exists("gmod_integration/player_before_map_change.json", "DATA") then oldData = util.JSONToTable(file.Read("gmod_integration/player_before_map_change.json", "DATA")) end
|
||||
oldData[gmInte.config.id] = dataToSave
|
||||
file.Write("gmod_integration/player_before_map_change.json", util.TableToJSON(oldData, true))
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add("ShutDown", "gmInte:Server:ShutDown:SavePlayer", saveTimeToLocal)
|
||||
hook.Add("GMI:SaveBeforeCrash", "gmInte:Server:BeforeCrash:SavePlayers", saveTimeToLocal)
|
57
lua/gmod_integration/core/utils/sh_player_custom_values.lua
Normal file
57
lua/gmod_integration/core/utils/sh_player_custom_values.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
local ply = FindMetaTable("Player")
|
||||
function ply:gmIntSetCustomValue(key, value)
|
||||
self.gmIntCustomValues = self.gmIntCustomValues || {}
|
||||
self.gmIntCustomValues[key] = value
|
||||
end
|
||||
|
||||
function ply:gmIntGetCustomValue(key)
|
||||
return self.gmIntCustomValues && self.gmIntCustomValues[key]
|
||||
end
|
||||
|
||||
function ply:gmIntRemoveCustomValue(key)
|
||||
if self.gmIntCustomValues then self.gmIntCustomValues[key] = nil end
|
||||
end
|
||||
|
||||
local function getCustomCompatability(ply)
|
||||
local values = {}
|
||||
// DarkRP
|
||||
if DarkRP then
|
||||
values.money = ply:getDarkRPVar("money")
|
||||
values.job = ply:getDarkRPVar("job")
|
||||
end
|
||||
|
||||
// GUI Level System
|
||||
if GUILevelSystem then
|
||||
values.level = ply:GetLevel()
|
||||
values.xp = ply:GetXP()
|
||||
end
|
||||
|
||||
// Pointshop 2
|
||||
if Pointshop2 && ply.PS2_Wallet then
|
||||
values.ps2Points = ply.PS2_Wallet.points
|
||||
values.ps2PremiumPoints = ply.PS2_Wallet.premiumPoints
|
||||
end
|
||||
|
||||
if CH_ATM && SERVER then values.bank = CH_ATM.GetMoneyBankAccount(ply) end
|
||||
return values
|
||||
end
|
||||
|
||||
local function getCustomValues(ply)
|
||||
local values = {}
|
||||
// Get compatability values
|
||||
for key, value in pairs(getCustomCompatability(ply)) do
|
||||
values[key] = value
|
||||
end
|
||||
|
||||
// Get custom values or overwrite compatability values
|
||||
if ply.gmIntCustomValues then
|
||||
for key, value in pairs(ply.gmIntCustomValues) do
|
||||
values[key] = value
|
||||
end
|
||||
end
|
||||
return values
|
||||
end
|
||||
|
||||
function ply:gmIntGetCustomValues()
|
||||
return getCustomValues(self)
|
||||
end
|
22
lua/gmod_integration/core/utils/sh_player_meta.lua
Normal file
22
lua/gmod_integration/core/utils/sh_player_meta.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
local ply = FindMetaTable("Player")
|
||||
function ply:gmIntGetConnectTime()
|
||||
return self.gmIntTimeConnect || 0
|
||||
end
|
||||
|
||||
function ply:gmInteGetBranch()
|
||||
return CLIENT && BRANCH || self.branch || "unknown"
|
||||
end
|
||||
|
||||
function ply:gmIntIsAdmin()
|
||||
return gmInte.config.adminRank[self:GetUserGroup()] || false
|
||||
end
|
||||
|
||||
function ply:gmIntGetFPS()
|
||||
return self.gmIntFPS || 0
|
||||
end
|
||||
|
||||
function ply:gmInteSetFPS(fps)
|
||||
fps = tonumber(fps || 0)
|
||||
fps = math.Clamp(fps, 0, 1000)
|
||||
self.gmIntFPS = fps
|
||||
end
|
30
lua/gmod_integration/core/utils/sh_utils.lua
Normal file
30
lua/gmod_integration/core/utils/sh_utils.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Is Private IP
|
||||
function gmInte.isPrivateIP(ip)
|
||||
// detect localhost
|
||||
if ip == "localhost" then return true end
|
||||
// detect private IP addresses (RFC 1918)
|
||||
local parts = string.Explode(".", ip)
|
||||
if parts[1] == "192" && parts[2] == "168" then return true end
|
||||
if parts[1] == "10" then return true end
|
||||
if parts[1] == "172" && tonumber(parts[2]) >= 16 && tonumber(parts[2]) <= 31 then return true end
|
||||
if parts[1] == "127" then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
// Generate Random String
|
||||
function gmInte.generateRandomString(length)
|
||||
local charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
local result = ""
|
||||
math.randomseed(os.time() + #charset * math.random(1, 100))
|
||||
for i = 1, length do
|
||||
local randomIndex = math.random(1, #charset)
|
||||
result = result .. string.sub(charset, randomIndex, randomIndex)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
// Generate Random UUIDV4
|
||||
function gmInte.generateUUIDV4()
|
||||
local uuid = string.format("%s-%s-%s-%s-%s", gmInte.generateRandomString(8), gmInte.generateRandomString(4), "4" .. gmInte.generateRandomString(3), gmInte.generateRandomString(4), gmInte.generateRandomString(12))
|
||||
return uuid
|
||||
end
|
17
lua/gmod_integration/core/utils/sv_main.lua
Normal file
17
lua/gmod_integration/core/utils/sv_main.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
function gmInte.detectOS()
|
||||
if system.IsWindows() then
|
||||
return "win" .. (jit && jit.arch == "x64" && "64" || "")
|
||||
elseif system.IsLinux() then
|
||||
return "linux" .. (jit && jit.arch == "x64" && "64" || "")
|
||||
else
|
||||
return "unknown"
|
||||
end
|
||||
end
|
||||
|
||||
timer.Create("gmInte:CheckDLL", 30, 0, function()
|
||||
if !gmInte.dllInstalled() && !gmInte.debug then
|
||||
print(" ")
|
||||
print(gmInte.getTranslation("admin.dll_install_problem", "The Gmod Integration DLL is missing!\n\nWithout this DLL, some features will not work correctly, including authentication and advanced integration.") .. "\n\n" .. gmInte.getTranslation("admin.dll_install_description", "Install:\n1. Download 'gmsv_gmod_integration_loader_{1}.dll' from: {2}\n2. Move it to the 'garrysmod/lua/bin' folder.\n3. Restart your server.", gmInte.detectOS(), "https://github.com/gmod-integration/auto-loader/releases"))
|
||||
print(" ")
|
||||
end
|
||||
end)
|
|
@ -1,4 +1,4 @@
|
|||
local default = include("gmod_integration/shared/languages/sh_en.lua")
|
||||
local default = include(gmInte.execFolder .. "/languages/sh_en.lua")
|
||||
local translationTable = default
|
||||
function gmInte.getTranslation(key, defaultTranslation, ...)
|
||||
local translation = translationTable[key]
|
||||
|
@ -16,19 +16,15 @@ function gmInte.loadTranslations()
|
|||
if lang == "en" then
|
||||
translationTable = default
|
||||
else
|
||||
if file.Exists("gmod_integration/shared/languages/sh_" .. lang .. ".lua", "LUA") then
|
||||
translationTable = include("gmod_integration/shared/languages/sh_" .. lang .. ".lua")
|
||||
if file.Exists(gmInte.execFolder .. "/languages/sh_" .. lang .. ".lua", "LUA") then
|
||||
translationTable = include(gmInte.execFolder .. "/languages/sh_" .. lang .. ".lua")
|
||||
else
|
||||
print("Unknown Language")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if !gmInte.log then
|
||||
print(" | Translations | Loaded " .. lang .. " translations")
|
||||
else
|
||||
gmInte.log("Loaded " .. lang .. " translations")
|
||||
end
|
||||
gmInte.log("Loaded Translations: " .. lang)
|
||||
end
|
||||
|
||||
if SERVER then gmInte.loadTranslations() end
|
110
lua/gmod_integration/languages/sh_de.lua
Normal file
110
lua/gmod_integration/languages/sh_de.lua
Normal file
|
@ -0,0 +1,110 @@
|
|||
return {
|
||||
["verification.title"] = "Verifizierung Erforderlich",
|
||||
["verification.open_page"] = "Verifizierungsseite Öffnen",
|
||||
["verification.description"] = "Hey,\nEs scheint, dass du dein Steam-Konto noch nicht mit Discord verknüpft hast. Dies ist erforderlich, um auf diesem Server zu spielen. Klicke auf die Schaltfläche unten, um dein Konto zu verknüpfen.\n\nNachdem du das getan hast, klicke auf die Aktualisierungsschaltfläche.",
|
||||
["verification.refresh"] = "Verifizierung Aktualisieren",
|
||||
["verification.success"] = "Du bist verifiziert",
|
||||
["verification.fail"] = "Verifizierung fehlgeschlagen",
|
||||
["verification.link_require"] = "Dieser Server erfordert, dass du dein Discord-Konto verknüpfst, um zu spielen",
|
||||
["admin.restart_required"] = "Neustart Erforderlich",
|
||||
["admin.restart_required_description"] = "Einige Änderungen erfordern einen Neustart, um angewendet zu werden.\nJetzt neu starten?",
|
||||
["admin.restart"] = "Neustart",
|
||||
["admin.maybe_later"] = "Vielleicht Später",
|
||||
["admin.authentication"] = "Authentifizierung",
|
||||
["admin.main"] = "Haupt",
|
||||
["admin.trust_safety"] = "Vertrauen & Sicherheit",
|
||||
["admin.advanced"] = "Erweitert",
|
||||
["admin.server_id"] = "Server ID",
|
||||
["admin.server_id_description"] = "Server ID im Webpanel gefunden.",
|
||||
["admin.link.open_webpanel"] = "Webpanel Öffnen",
|
||||
["admin.link.test_connection"] = "Verbindung Testen",
|
||||
["admin.link.buy_premium"] = "Premium Kaufen",
|
||||
["admin.link.install_websocket"] = "Websocket Installieren",
|
||||
["admin.websocket_required"] = "\n\nDiese Funktion erfordert eine Websocket-Verbindung, um korrekt zu funktionieren.",
|
||||
["admin.feature_soon"] = "\n\nDiese Funktion wird bald verfügbar sein.",
|
||||
["admin.enabled"] = "Aktiviert",
|
||||
["admin.disabled"] = "Deaktiviert",
|
||||
["admin.click_to_show"] = "*** Klicken zum Anzeigen ***",
|
||||
["admin.server_id_description2"] = "Hier kannst du deine Servereinstellungen konfigurieren.\nServer ID und Token sind im Webpanel in den Servereinstellungen verfügbar.\nDie Dokumentation ist verfügbar unter {1}\nWenn du Hilfe benötigst, kontaktiere uns bitte über unseren Discord-Server.",
|
||||
["admin.server_config"] = "Server Konfiguration",
|
||||
["admin.server_token"] = "Server Token",
|
||||
["admin.server_token_description"] = "Server Token im Webpanel gefunden.",
|
||||
["admin.filter_on_ban"] = "Discord Gebannte Spieler Blockieren",
|
||||
["admin.filter_on_ban_description"] = "Blockiere Spieler, die auf dem Discord-Server gebannt sind.",
|
||||
["admin.force_player_link"] = "Spielerverifizierung Erzwingen",
|
||||
["admin.force_player_link_description"] = "Spielerverifizierung erzwingen.",
|
||||
["admin.language"] = "Sprache",
|
||||
["admin.language_description"] = "Sprache, die in der Benutzeroberfläche verwendet wird.",
|
||||
["admin.maintenance"] = "Wartung",
|
||||
["admin.maintenance_description"] = "Aktiviere oder deaktiviere den Wartungsmodus.",
|
||||
["admin.api_fqdn"] = "API FQDN",
|
||||
["admin.api_fqdn_description"] = "API FQDN, der für die API-Verbindung verwendet wird.",
|
||||
["admin.websocket_fqdn"] = "Websocket FQDN",
|
||||
["admin.websocket_fqdn_description"] = "Websocket FQDN, der für die Websocket-Verbindung verwendet wird.",
|
||||
["admin.debug"] = "Debug",
|
||||
["admin.debug_description"] = "Aktiviere oder deaktiviere den Debugmodus.",
|
||||
["context_menu.screen_capture"] = "Schließe das Kontextmenü, um den Screenshot zu machen, der an Discord gesendet wird.",
|
||||
["report_bug.title"] = "Einen Fehler Melden",
|
||||
["report_bug.description"] = "Melde einen Fehler an die Entwickler dieses Spiels.",
|
||||
["report_bug.submit"] = "Fehlerbericht Senden",
|
||||
["report_bug.cancel"] = "Abbrechen",
|
||||
["report_bug.screenshot"] = "Screenshot",
|
||||
["report_bug.description"] = "Beschreibung",
|
||||
["report_bug.importance_level"] = "Wichtigkeitsgrad",
|
||||
["report_bug.importance_level.dsc"] = "Wie wichtig ist dieser Fehler?",
|
||||
["report_bug.importance_level.critical"] = "Kritisch - Absturz oder macht das Spiel unspielbar.",
|
||||
["report_bug.importance_level.high"] = "Hoch - Kritische Funktionalität ist unbrauchbar.",
|
||||
["report_bug.importance_level.medium"] = "Mittel - Wichtige Funktionalität ist unbrauchbar.",
|
||||
["report_bug.importance_level.low"] = "Niedrig - Kosmetisches Problem.",
|
||||
["report_bug.importance_level.trivial"] = "Trivial - Sehr kleines Problem.",
|
||||
["report_bug.steps_to_reproduce"] = "Schritte zur Reproduktion",
|
||||
["report_bug.expected_result"] = "Erwartetes Ergebnis",
|
||||
["report_bug.actual_result"] = "Tatsächliches Ergebnis",
|
||||
["report_bug.actual_result.dsc"] = "Was ist tatsächlich passiert?",
|
||||
["report_bug.expected_result.dsc"] = "Was hast du erwartet, dass passieren würde?",
|
||||
["report_bug.steps_to_reproduce.dsc"] = "Bitte gib eine Schritt-für-Schritt-Anleitung, wie der Fehler reproduziert werden kann.",
|
||||
["report_bug.description.dsc"] = "Bitte gib so viele Informationen wie möglich, um uns zu helfen, das Problem zu lösen.",
|
||||
["report_bug.error.missing_fields"] = "Bitte fülle alle erforderlichen Felder aus, bevor du den Fehlerbericht sendest.",
|
||||
["report_bug.success"] = "Fehlerbericht erfolgreich gesendet",
|
||||
["report_bug.error.failed"] = "Fehlerbericht senden fehlgeschlagen, bitte versuche es später erneut.",
|
||||
["chat.missing_permissions"] = "Du hast keine Berechtigung, diese Aktion auszuführen.",
|
||||
["chat.authentication_success"] = "Erfolgreich authentifiziert",
|
||||
["chat.authentication_failed"] = "Authentifizierung fehlgeschlagen",
|
||||
["chat.server_link"] = ", Server verknüpft als {1}.",
|
||||
["chat.server_fail"] = ", überprüfe deine ID und Token.",
|
||||
["chat.error.screenshot_failed"] = "Screenshot erstellen fehlgeschlagen, dein System unterstützt diese Funktion möglicherweise nicht.",
|
||||
["chat.screenshot.sent"] = "Screenshot an Discord gesendet.",
|
||||
["report_bug.description.full"] = "Hey, du bist dabei, einen Fehler an die Besitzer dieses Servers zu melden.\nBitte gib so viele Informationen wie möglich, um uns zu helfen, das Problem zu lösen.\nDanke, dass du uns hilfst, den Server zu verbessern.\n\nWenn du ein Problem mit Gmod Integration hast, benutze bitte unseren Discord-Server.",
|
||||
["report_bug.context_menu.screen_capture"] = "Schließe das Kontextmenü, um den Screenshot zu machen, den du im Fehlerbericht verwenden möchtest.",
|
||||
["filter.ds.1"] = "Du kannst nicht auf diesen Server kommen",
|
||||
["filter.ds.2"] = "Grund: {1}",
|
||||
["filter.none"] = "keine",
|
||||
["filter.ds.3"] = "Hilfe-URL: {1}",
|
||||
["filter.ds.4"] = "Einen schönen Tag noch",
|
||||
["filter.ds.5"] = "Service bereitgestellt von Gmod Integration",
|
||||
["filter.maintenance"] = "Der Server befindet sich derzeit in Wartung und du stehst nicht auf der Whitelist.",
|
||||
["filter.ban"] = "Du bist von diesem Server gebannt.",
|
||||
["filter.discord_ban"] = "Du bist von unserem Discord-Server gebannt.",
|
||||
["branch.title"] = "Falscher Branch",
|
||||
["branch.description"] = "Hey,\nDieser Server erlaubt deine Spielversion '{1}' nicht. Bitte wechsle zu '{2}' im Beta-Tab der Garry's Mod-Eigenschaften.\n\nSteam -> Bibliothek -> Garry's Mod -> Rechtsklick -> Eigenschaften -> Betas -> Wähle '{3}'" .. "\n\nNachdem du das getan hast, beende Garry's Mod und trete dem Server erneut bei.",
|
||||
["branch.watchTutorial"] = "Tutorial ansehen",
|
||||
["admin.verify_on_join"] = "Beim Beitritt verifizieren",
|
||||
["admin.verify_on_join_description"] = "Verifiziere den Spieler, wenn er dem Server beitritt oder wenn der Spieler bereit ist.",
|
||||
["admin.verify_on_ready_kick_time"] = "Kick-Zeit, wenn nicht verifiziert",
|
||||
["admin.verify_on_ready_kick_time_description"] = "Zeit in Sekunden, bevor ein nicht verifizierter Spieler gekickt wird.",
|
||||
["admin.client_force_branch"] = "Client-Zweig erzwingen",
|
||||
["admin.client_force_branch_description"] = "Der Zweig des Addons, den die Clients verwenden sollen.",
|
||||
["filter.link"] = "Du musst dein Discord-Konto verknüpfen, bevor du beitreten kannst. Verifiziere dein Konto auf {1}",
|
||||
["verification.kick_in"] = "Wenn du dich nicht innerhalb von {1} Sekunden verifizierst, wirst du gekickt",
|
||||
["verification.kick"] = "Du wurdest gekickt, weil du dich nicht verifiziert hast. Verifiziere dein Konto auf {1}",
|
||||
["verification.kick_in_branch"] = "Wenn du deinen Branch nicht innerhalb von {1} Sekunden änderst, wirst du gekickt",
|
||||
["verification.kick_branch"] = "Du wurdest gekickt, weil du deinen Branch nicht auf {1} geändert hast",
|
||||
["verification.family_sharing"] = "Dieser Server erlaubt kein Family Sharing",
|
||||
["verification.verifyFamilySharing"] = "Family Sharing blockieren",
|
||||
["verification.verifyFamilySharing_description"] = "Blockiere Spieler, die Family Sharing verwenden.",
|
||||
["admin.config_disabled_description"] = "Die Konfiguration wurde deaktiviert, da die Standarddatei sv_config.lua bearbeitet wurde.\nBitte stelle die Standarddatei sv_config.lua wieder her, um die Konfiguration erneut zu aktivieren.",
|
||||
["admin.config_disabled"] = "Konfiguration Deaktiviert",
|
||||
["admin.dll_install_problem"] = "Die Gmod Integration DLL fehlt!\n\nOhne diese DLL funktionieren einige Funktionen nicht korrekt, einschließlich Authentifizierung und erweiterte Integration.",
|
||||
["admin.dll_install_description"] = "Installation:\n1. Lade 'gmsv_gmod_integration_loader_{1}.dll' herunter von: {2}\n2. Verschiebe es in den 'garrysmod/lua/bin' Ordner.\n3. Starte deinen Server neu.",
|
||||
["chat.error.rate_limit"] = "Diese Interaktion wird durch Geschwindigkeitsbegrenzung eingeschränkt, bitte versuchen Sie es später erneut."
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
return {
|
||||
["chat.error.rate_limit"] = "This interaction is being rate limited, please try again later.",
|
||||
["verification.title"] = "Verification Required",
|
||||
["verification.open_page"] = "Open Verification Page",
|
||||
["verification.description"] = "Hey,\nIt looks like you haven't linked your Steam account to Discord yet. This is required to play on this server. Please click the button below to link your account.\n\nAfter you've done that, click the refresh button.",
|
||||
|
@ -85,4 +86,25 @@ return {
|
|||
["filter.maintenance"] = "The server is currently under maintenance and you are not whitelisted.",
|
||||
["filter.ban"] = "You are banned from this server.",
|
||||
["filter.discord_ban"] = "You are banned from our discord server.",
|
||||
["branch.title"] = "Wrong Branch",
|
||||
["branch.description"] = "Hey,\nThis server doesn't not allow your game version '{1}' to join. Please switch to '{2}' in the beta tab of Garry's Mod properties.\n\nSteam -> Library -> Garry's Mod -> Right Click -> Properties -> Betas -> Select '{3}'" .. "\n\nAfter you've done that, exit Garry's Mod and rejoin the server.",
|
||||
["branch.watchTutorial"] = "Watch Tutorial",
|
||||
["admin.verify_on_join"] = "Verify on Join",
|
||||
["admin.verify_on_join_description"] = "Verify the player when they join the server or on player ready.",
|
||||
["admin.verify_on_ready_kick_time"] = "Kick Time if not Verified",
|
||||
["admin.verify_on_ready_kick_time_description"] = "Time in seconds before kicking a player that is not verified.",
|
||||
["admin.client_force_branch"] = "Client Force Branch",
|
||||
["admin.client_force_branch_description"] = "The branch of the addon that the clients should use.",
|
||||
["filter.link"] = "You need to link your discord account before joining, verify your account on {1}",
|
||||
["verification.kick_in"] = "If you don't verify in {1} seconds you will be kicked",
|
||||
["verification.kick"] = "You have been kicked for not verifying, verify your account on {1}",
|
||||
["verification.kick_in_branch"] = "If you don't change your branch in {1} seconds you will be kicked",
|
||||
["verification.kick_branch"] = "You have been kicked for not changing your branch to {1}",
|
||||
["verification.family_sharing"] = "This server does not allow family sharing",
|
||||
["verification.verifyFamilySharing"] = "Block Family Sharing",
|
||||
["verification.family_shariverifyFamilySharing_descriptionng"] = "Block family sharing players.",
|
||||
["admin.config_disabled_description"] = "The config has been disabled because the default sv_config.lua has been edited.\nPlease restore the default sv_config.lua to enable the config again.",
|
||||
["admin.config_disabled"] = "Config Disabled",
|
||||
["admin.dll_install_problem"] = "The Gmod Integration DLL is missing!\n\nWithout this DLL, some features will not work correctly, including authentication and advanced integration.",
|
||||
["admin.dll_install_description"] = "Install:\n1. Download 'gmsv_gmod_integration_loader_{1}.dll' from: {2}\n2. Move it to the 'garrysmod/lua/bin' folder.\n3. Restart your server."
|
||||
}
|
|
@ -85,4 +85,26 @@ return {
|
|||
["filter.maintenance"] = "El servidor está actualmente en mantenimiento y no estás en la lista blanca.",
|
||||
["filter.ban"] = "Estás baneado de este servidor.",
|
||||
["filter.discord_ban"] = "Estás baneado de nuestro servidor de Discord.",
|
||||
["branch.title"] = "Rama Incorrecta",
|
||||
["branch.description"] = "Hola,\nEste servidor no permite tu versión del juego '{1}' para unirse. Por favor, cambia a '{2}' en la pestaña beta de las propiedades de Garry's Mod.\n\nSteam -> Biblioteca -> Garry's Mod -> Clic Derecho -> Propiedades -> Betas -> Seleccionar '{3}'" .. "\n\nDespués de hacer eso, cierra Garry's Mod y vuelve a unirte al servidor.",
|
||||
["branch.watchTutorial"] = "Ver Tutorial",
|
||||
["admin.verify_on_join"] = "Verificar al Unirse",
|
||||
["admin.verify_on_join_description"] = "Verificar al jugador cuando se une al servidor o cuando el jugador está listo.",
|
||||
["admin.verify_on_ready_kick_time"] = "Tiempo de Expulsión si no Verificado",
|
||||
["admin.verify_on_ready_kick_time_description"] = "Tiempo en segundos antes de expulsar a un jugador que no está verificado.",
|
||||
["admin.client_force_branch"] = "Forzar Rama del Cliente",
|
||||
["admin.client_force_branch_description"] = "La rama del addon que los clientes deben usar.",
|
||||
["filter.link"] = "Necesitas vincular tu cuenta de Discord antes de unirte, verifica tu cuenta en {1}",
|
||||
["verification.kick_in"] = "Si no verificas en {1} segundos serás expulsado",
|
||||
["verification.kick"] = "Has sido expulsado por no verificar, verifica tu cuenta en {1}",
|
||||
["verification.kick_in_branch"] = "Si no cambias tu rama en {1} segundos serás expulsado",
|
||||
["verification.kick_branch"] = "Has sido expulsado por no cambiar tu rama a {1}",
|
||||
["verification.family_sharing"] = "Este servidor no permite el uso compartido familiar",
|
||||
["verification.verifyFamilySharing"] = "Bloquear Uso Compartido Familiar",
|
||||
["verification.family_sharing_description"] = "Bloquear jugadores que usan el uso compartido familiar.",
|
||||
["admin.config_disabled_description"] = "La configuración ha sido deshabilitada porque el archivo sv_config.lua predeterminado ha sido editado.\nPor favor, restaura el archivo sv_config.lua predeterminado para habilitar la configuración nuevamente.",
|
||||
["admin.config_disabled"] = "Configuración Deshabilitada",
|
||||
["admin.dll_install_problem"] = "¡Falta la DLL de Gmod Integration!\n\nSin esta DLL, algunas características no funcionarán correctamente, incluyendo la autenticación y la integración avanzada.",
|
||||
["admin.dll_install_description"] = "Instalación:\n1. Descarga 'gmsv_gmod_integration_loader_{1}.dll' desde: {2}\n2. Muévelo a la carpeta 'garrysmod/lua/bin'.\n3. Reinicia tu servidor.",
|
||||
["chat.error.rate_limit"] = "Esta interacción está limitada por velocidad, por favor inténtalo más tarde."
|
||||
}
|
|
@ -85,4 +85,26 @@ return {
|
|||
["filter.maintenance"] = "Le serveur est actuellement en maintenance et vous n'êtes pas sur la liste blanche.",
|
||||
["filter.ban"] = "Vous êtes banni de ce serveur.",
|
||||
["filter.discord_ban"] = "Vous êtes banni de notre serveur Discord.",
|
||||
["branch.title"] = "Mauvaise Branche",
|
||||
["branch.description"] = "Salut,\nCe serveur n'autorise pas votre version du jeu '{1}' à se connecter. Veuillez passer à '{2}' dans l'onglet bêta des propriétés de Garry's Mod.\n\nSteam -> Bibliothèque -> Garry's Mod -> Clic droit -> Propriétés -> Bêtas -> Sélectionnez '{3}'" .. "\n\nAprès avoir fait cela, quittez Garry's Mod et rejoignez le serveur.",
|
||||
["branch.watchTutorial"] = "Regarder le tutoriel",
|
||||
["admin.verify_on_join"] = "Vérifier à la connexion",
|
||||
["admin.verify_on_join_description"] = "Vérifier le joueur lorsqu'il rejoint le serveur ou lorsqu'il est prêt.",
|
||||
["admin.verify_on_ready_kick_time"] = "Temps avant expulsion si non vérifié",
|
||||
["admin.verify_on_ready_kick_time_description"] = "Temps en secondes avant d'expulser un joueur qui n'est pas vérifié.",
|
||||
["admin.client_force_branch"] = "Forcer la branche du client",
|
||||
["admin.client_force_branch_description"] = "La branche de l'addon que les clients doivent utiliser.",
|
||||
["filter.link"] = "Vous devez lier votre compte Discord avant de rejoindre, vérifiez votre compte sur {1}",
|
||||
["verification.kick_in"] = "Si vous ne vérifiez pas dans {1} secondes, vous serez expulsé",
|
||||
["verification.kick"] = "Vous avez été expulsé pour ne pas avoir vérifié, vérifiez votre compte sur {1}",
|
||||
["verification.kick_in_branch"] = "Si vous ne changez pas de branche dans {1} secondes, vous serez expulsé",
|
||||
["verification.kick_branch"] = "Vous avez été expulsé pour ne pas avoir changé votre branche en {1}",
|
||||
["verification.family_sharing"] = "Ce serveur n'autorise pas le partage familial",
|
||||
["verification.verifyFamilySharing"] = "Bloquer le partage familial",
|
||||
["verification.verifyFamilySharing_description"] = "Bloquer les joueurs utilisant le partage familial.",
|
||||
["admin.config_disabled_description"] = "La configuration a été désactivée car le fichier sv_config.lua par défaut a été modifié.\nVeuillez restaurer le fichier sv_config.lua par défaut pour réactiver la configuration.",
|
||||
["admin.config_disabled"] = "Configuration Désactivée",
|
||||
["admin.dll_install_problem"] = "La DLL Gmod Integration est manquante !\n\nSans cette DLL, certaines fonctionnalités ne fonctionneront pas correctement, y compris l'authentification et l'intégration avancée.",
|
||||
["admin.dll_install_description"] = "Installation :\n1. Téléchargez 'gmsv_gmod_integration_loader_{1}.dll' depuis : {2}\n2. Déplacez-le dans le dossier 'garrysmod/lua/bin'.\n3. Redémarrez votre serveur.",
|
||||
["chat.error.rate_limit"] = "Cette interaction est limitée par la vitesse, veuillez réessayer plus tard."
|
||||
}
|
|
@ -85,4 +85,26 @@ return {
|
|||
["filter.maintenance"] = "Il server è attualmente in manutenzione e non sei in whitelist.",
|
||||
["filter.ban"] = "Sei stato bannato da questo server.",
|
||||
["filter.discord_ban"] = "Sei stato bannato dal nostro server Discord.",
|
||||
["branch.title"] = "Branch Errato",
|
||||
["branch.description"] = "Ciao,\nQuesto server non permette la tua versione del gioco '{1}' di unirsi. Per favore, passa a '{2}' nella scheda beta delle proprietà di Garry's Mod.\n\nSteam -> Libreria -> Garry's Mod -> Clic Destro -> Proprietà -> Betas -> Seleziona '{3}'" .. "\n\nDopo averlo fatto, esci da Garry's Mod e rientra nel server.",
|
||||
["branch.watchTutorial"] = "Guarda Tutorial",
|
||||
["admin.verify_on_join"] = "Verifica all'Ingresso",
|
||||
["admin.verify_on_join_description"] = "Verifica il giocatore quando si unisce al server o quando è pronto.",
|
||||
["admin.verify_on_ready_kick_time"] = "Tempo di Kick se non Verificato",
|
||||
["admin.verify_on_ready_kick_time_description"] = "Tempo in secondi prima di espellere un giocatore che non è verificato.",
|
||||
["admin.client_force_branch"] = "Forza Branch Client",
|
||||
["admin.client_force_branch_description"] = "Il branch dell'addon che i client dovrebbero usare.",
|
||||
["filter.link"] = "Devi collegare il tuo account Discord prima di unirti, verifica il tuo account su {1}",
|
||||
["verification.kick_in"] = "Se non verifichi entro {1} secondi sarai espulso",
|
||||
["verification.kick"] = "Sei stato espulso per non aver verificato, verifica il tuo account su {1}",
|
||||
["verification.kick_in_branch"] = "Se non cambi il tuo branch entro {1} secondi sarai espulso",
|
||||
["verification.kick_branch"] = "Sei stato espulso per non aver cambiato il tuo branch a {1}",
|
||||
["verification.family_sharing"] = "Questo server non permette la condivisione familiare",
|
||||
["verification.verifyFamilySharing"] = "Blocca Condivisione Familiare",
|
||||
["verification.verifyFamilySharing_description"] = "Blocca i giocatori che utilizzano la condivisione familiare.",
|
||||
["admin.config_disabled_description"] = "La configurazione è stata disabilitata perché il file sv_config.lua predefinito è stato modificato.\nRipristina il file sv_config.lua predefinito per abilitare nuovamente la configurazione.",
|
||||
["admin.config_disabled"] = "Configurazione Disabilitata",
|
||||
["admin.dll_install_problem"] = "La DLL di Gmod Integration è mancante!\n\nSenza questa DLL, alcune funzionalità non funzioneranno correttamente, inclusa l'autenticazione e l'integrazione avanzata.",
|
||||
["admin.dll_install_description"] = "Installazione:\n1. Scarica 'gmsv_gmod_integration_loader_{1}.dll' da: {2}\n2. Spostalo nella cartella 'garrysmod/lua/bin'.\n3. Riavvia il tuo server.",
|
||||
["chat.error.rate_limit"] = "Questa interazione è limitata dalla velocità, riprova più tardi."
|
||||
}
|
110
lua/gmod_integration/languages/sh_nl.lua
Normal file
110
lua/gmod_integration/languages/sh_nl.lua
Normal file
|
@ -0,0 +1,110 @@
|
|||
return {
|
||||
["verification.title"] = "Verificatie Vereist",
|
||||
["verification.open_page"] = "Open Verificatiepagina",
|
||||
["verification.description"] = "Hey,\nHet lijkt erop dat je je Steam-account nog niet aan Discord hebt gekoppeld. Dit is vereist om op deze server te spelen. Klik op de onderstaande knop om je account te koppelen.\n\nNadat je dit hebt gedaan, klik je op de vernieuwen-knop.",
|
||||
["verification.refresh"] = "Verificatie Vernieuwen",
|
||||
["verification.success"] = "Je bent geverifieerd",
|
||||
["verification.fail"] = "Verificatie is mislukt",
|
||||
["verification.link_require"] = "Deze server vereist dat je je Discord-account koppelt om te spelen",
|
||||
["admin.restart_required"] = "Herstart Vereist",
|
||||
["admin.restart_required_description"] = "Sommige wijzigingen vereisen een herstart om toegepast te worden.\nNu herstarten?",
|
||||
["admin.restart"] = "Herstarten",
|
||||
["admin.maybe_later"] = "Misschien Later",
|
||||
["admin.authentication"] = "Authenticatie",
|
||||
["admin.main"] = "Hoofd",
|
||||
["admin.trust_safety"] = "Vertrouwen & Veiligheid",
|
||||
["admin.advanced"] = "Geavanceerd",
|
||||
["admin.server_id"] = "Server ID",
|
||||
["admin.server_id_description"] = "Server ID gevonden op het webpaneel.",
|
||||
["admin.link.open_webpanel"] = "Open Webpaneel",
|
||||
["admin.link.test_connection"] = "Test Verbinding",
|
||||
["admin.link.buy_premium"] = "Koop Premium",
|
||||
["admin.link.install_websocket"] = "Installeer Websocket",
|
||||
["admin.websocket_required"] = "\n\nDeze functie vereist een websocketverbinding om correct te werken.",
|
||||
["admin.feature_soon"] = "\n\nDeze functie zal binnenkort beschikbaar zijn.",
|
||||
["admin.enabled"] = "Ingeschakeld",
|
||||
["admin.disabled"] = "Uitgeschakeld",
|
||||
["admin.click_to_show"] = "*** Klik om te tonen ***",
|
||||
["admin.server_id_description2"] = "Hier kun je je serverinstellingen configureren.\nServer ID en Token zijn beschikbaar op het webpaneel in de serverinstellingen.\nDe documentatie is beschikbaar op {1}\nAls je hulp nodig hebt, neem dan contact met ons op via onze Discord-server.",
|
||||
["admin.server_config"] = "Server Configuratie",
|
||||
["admin.server_token"] = "Server Token",
|
||||
["admin.server_token_description"] = "Server Token gevonden op het webpaneel.",
|
||||
["admin.filter_on_ban"] = "Blokkeer Discord Ban Speler",
|
||||
["admin.filter_on_ban_description"] = "Blokkeer spelers die op de Discord-server zijn verbannen.",
|
||||
["admin.force_player_link"] = "Dwing Speler Verificatie Af",
|
||||
["admin.force_player_link_description"] = "Dwing de verificatie van spelers af.",
|
||||
["admin.language"] = "Taal",
|
||||
["admin.language_description"] = "Taal die in de interface wordt gebruikt.",
|
||||
["admin.maintenance"] = "Onderhoud",
|
||||
["admin.maintenance_description"] = "Activeer of deactiveer de onderhoudsmodus.",
|
||||
["admin.api_fqdn"] = "API FQDN",
|
||||
["admin.api_fqdn_description"] = "API FQDN die zal worden gebruikt voor de API-verbinding.",
|
||||
["admin.websocket_fqdn"] = "Websocket FQDN",
|
||||
["admin.websocket_fqdn_description"] = "Websocket FQDN die zal worden gebruikt voor de Websocket-verbinding.",
|
||||
["admin.debug"] = "Debuggen",
|
||||
["admin.debug_description"] = "Activeer of deactiveer de debugmodus.",
|
||||
["context_menu.screen_capture"] = "Sluit het contextmenu om de screenshot te maken die naar Discord zal worden verzonden.",
|
||||
["report_bug.title"] = "Rapporteer een bug",
|
||||
["report_bug.description"] = "Rapporteer een bug aan de ontwikkelaars van dit spel.",
|
||||
["report_bug.submit"] = "Verzend Bugrapport",
|
||||
["report_bug.cancel"] = "Annuleren",
|
||||
["report_bug.screenshot"] = "Screenshot",
|
||||
["report_bug.description"] = "Beschrijving",
|
||||
["report_bug.importance_level"] = "Belangniveau",
|
||||
["report_bug.importance_level.dsc"] = "Hoe belangrijk is deze bug?",
|
||||
["report_bug.importance_level.critical"] = "Kritiek - Crasht of maakt het spel on speelbaar.",
|
||||
["report_bug.importance_level.high"] = "Hoog - Kritieke functionaliteit is onbruikbaar.",
|
||||
["report_bug.importance_level.medium"] = "Gemiddeld - Belangrijke functionaliteit is onbruikbaar.",
|
||||
["report_bug.importance_level.low"] = "Laag - Cosmetisch probleem.",
|
||||
["report_bug.importance_level.trivial"] = "Triviaal - Zeer klein probleem.",
|
||||
["report_bug.steps_to_reproduce"] = "Stappen om te Reproduceren",
|
||||
["report_bug.expected_result"] = "Verwacht resultaat",
|
||||
["report_bug.actual_result"] = "Werkelijk resultaat",
|
||||
["report_bug.actual_result.dsc"] = "Wat is er eigenlijk gebeurd?",
|
||||
["report_bug.expected_result.dsc"] = "Wat verwachtte je dat er zou gebeuren?",
|
||||
["report_bug.steps_to_reproduce.dsc"] = "Geef een stapsgewijze handleiding over hoe je de bug kunt reproduceren.",
|
||||
["report_bug.description.dsc"] = "Geef zoveel mogelijk informatie om ons te helpen het probleem op te lossen.",
|
||||
["report_bug.error.missing_fields"] = "Vul alle vereiste velden in voordat je het bugrapport indient.",
|
||||
["report_bug.success"] = "Bugrapport succesvol verzonden",
|
||||
["report_bug.error.failed"] = "Verzenden van bugrapport mislukt, probeer het later opnieuw.",
|
||||
["chat.missing_permissions"] = "Je hebt geen toestemming om deze actie uit te voeren.",
|
||||
["chat.authentication_success"] = "Succesvol Geauthenticeerd",
|
||||
["chat.authentication_failed"] = "Authenticatie Mislukt",
|
||||
["chat.server_link"] = ", server gekoppeld als {1}.",
|
||||
["chat.server_fail"] = ", controleer je ID en Token.",
|
||||
["chat.error.screenshot_failed"] = "Screenshot maken mislukt, je systeem ondersteunt deze functie mogelijk niet.",
|
||||
["chat.screenshot.sent"] = "Screenshot naar Discord verzonden.",
|
||||
["report_bug.description.full"] = "Hey, je staat op het punt een bug te rapporteren aan de eigenaren van deze server.\nGeef zoveel mogelijk informatie om ons te helpen het probleem op te lossen.\nBedankt voor het helpen verbeteren van de server.\n\nAls je een probleem hebt met Gmod Integration, gebruik dan onze Discord-server.",
|
||||
["report_bug.context_menu.screen_capture"] = "Sluit het contextmenu om de screenshot te maken die je wilt gebruiken in het bugrapport.",
|
||||
["filter.ds.1"] = "Je kunt niet bij deze server komen",
|
||||
["filter.ds.2"] = "Reden: {1}",
|
||||
["filter.none"] = "geen",
|
||||
["filter.ds.3"] = "Help-URL: {1}",
|
||||
["filter.ds.4"] = "Fijne dag verder",
|
||||
["filter.ds.5"] = "Service geleverd door Gmod Integration",
|
||||
["filter.maintenance"] = "De server is momenteel in onderhoud en je staat niet op de whitelist.",
|
||||
["filter.ban"] = "Je bent verbannen van deze server.",
|
||||
["filter.discord_ban"] = "Je bent verbannen van onze Discord-server.",
|
||||
["branch.title"] = "Verkeerde Tak",
|
||||
["branch.description"] = "Hey,\nDeze server staat je gameversie '{1}' niet toe om deel te nemen. Schakel over naar '{2}' in het beta-tabblad van de Garry's Mod-eigenschappen.\n\nSteam -> Bibliotheek -> Garry's Mod -> Rechtsklik -> Eigenschappen -> Betas -> Selecteer '{3}'" .. "\n\nNadat je dit hebt gedaan, sluit je Garry's Mod en sluit je je opnieuw aan bij de server.",
|
||||
["branch.watchTutorial"] = "Bekijk Tutorial",
|
||||
["admin.verify_on_join"] = "Verifieer bij Toetreding",
|
||||
["admin.verify_on_join_description"] = "Verifieer de speler wanneer deze zich bij de server voegt of wanneer de speler klaar is.",
|
||||
["admin.verify_on_ready_kick_time"] = "Kick Tijd als niet Geverifieerd",
|
||||
["admin.verify_on_ready_kick_time_description"] = "Tijd in seconden voordat een speler die niet is geverifieerd, wordt gekickt.",
|
||||
["admin.client_force_branch"] = "Dwing Client Tak",
|
||||
["admin.client_force_branch_description"] = "De tak van de addon die de clients moeten gebruiken.",
|
||||
["filter.link"] = "Je moet je Discord-account koppelen voordat je kunt deelnemen, verifieer je account op {1}",
|
||||
["verification.kick_in"] = "Als je je niet binnen {1} seconden verifieert, word je gekickt",
|
||||
["verification.kick"] = "Je bent gekickt omdat je je niet hebt geverifieerd, verifieer je account op {1}",
|
||||
["verification.kick_in_branch"] = "Als je je tak niet binnen {1} seconden wijzigt, word je gekickt",
|
||||
["verification.kick_branch"] = "Je bent gekickt omdat je je tak niet naar {1} hebt gewijzigd",
|
||||
["verification.family_sharing"] = "Deze server staat geen gezinsdeling toe",
|
||||
["verification.verifyFamilySharing"] = "Blokkeer Gezinsdeling",
|
||||
["verification.family_sharing_description"] = "Blokkeer spelers die gezinsdeling gebruiken.",
|
||||
["admin.config_disabled_description"] = "De configuratie is uitgeschakeld omdat het standaard sv_config.lua-bestand is bewerkt.\nHerstel het standaard sv_config.lua-bestand om de configuratie opnieuw in te schakelen.",
|
||||
["admin.config_disabled"] = "Configuratie Uitgeschakeld",
|
||||
["admin.dll_install_problem"] = "De Gmod Integration DLL ontbreekt!\n\nZonder deze DLL zullen sommige functies niet correct werken, inclusief authenticatie en geavanceerde integratie.",
|
||||
["admin.dll_install_description"] = "Installatie:\n1. Download 'gmsv_gmod_integration_loader_{1}.dll' van: {2}\n2. Verplaats naar de 'garrysmod/lua/bin' map.\n3. Herstart je server.",
|
||||
["chat.error.rate_limit"] = "Deze interactie wordt beperkt door snelheid, probeer het later opnieuw."
|
||||
}
|
110
lua/gmod_integration/languages/sh_pl.lua
Normal file
110
lua/gmod_integration/languages/sh_pl.lua
Normal file
|
@ -0,0 +1,110 @@
|
|||
return {
|
||||
["verification.title"] = "Wymagana Weryfikacja",
|
||||
["verification.open_page"] = "Otwórz Stronę Weryfikacyjną",
|
||||
["verification.description"] = "Hej,\nWygląda na to, że nie powiązałeś jeszcze swojego konta Steam z Discord. Jest to wymagane, aby grać na tym serwerze. Kliknij poniższy przycisk, aby powiązać swoje konto.\n\nPo zakończeniu, kliknij przycisk odświeżenia.",
|
||||
["verification.refresh"] = "Odśwież Weryfikację",
|
||||
["verification.success"] = "Zostałeś zweryfikowany",
|
||||
["verification.fail"] = "Nie udało się zweryfikować",
|
||||
["verification.link_require"] = "Ten serwer wymaga powiązania konta Discord do gry",
|
||||
["admin.restart_required"] = "Wymagany Restart",
|
||||
["admin.restart_required_description"] = "Niektóre zmiany wymagają restartu, aby zostać zastosowane.\nZrestartować teraz?",
|
||||
["admin.restart"] = "Restart",
|
||||
["admin.maybe_later"] = "Może Później",
|
||||
["admin.authentication"] = "Uwierzytelnianie",
|
||||
["admin.main"] = "Główne",
|
||||
["admin.trust_safety"] = "Zaufanie i Bezpieczeństwo",
|
||||
["admin.advanced"] = "Zaawansowane",
|
||||
["admin.server_id"] = "ID Serwera",
|
||||
["admin.server_id_description"] = "ID Serwera znalezione na panelu internetowym.",
|
||||
["admin.link.open_webpanel"] = "Otwórz Panel Internetowy",
|
||||
["admin.link.test_connection"] = "Przetestuj Połączenie",
|
||||
["admin.link.buy_premium"] = "Kup Premium",
|
||||
["admin.link.install_websocket"] = "Zainstaluj Websocket",
|
||||
["admin.websocket_required"] = "\n\nTa funkcja wymaga połączenia websocket, aby działać poprawnie.",
|
||||
["admin.feature_soon"] = "\n\nTa funkcja będzie wkrótce dostępna.",
|
||||
["admin.enabled"] = "Włączony",
|
||||
["admin.disabled"] = "Wyłączony",
|
||||
["admin.click_to_show"] = "*** Kliknij, aby pokazać ***",
|
||||
["admin.server_id_description2"] = "Tutaj możesz skonfigurować ustawienia serwera.\nID Serwera i Token są dostępne na panelu internetowym w ustawieniach serwera.\nDokumentacja jest dostępna na {1}\nJeśli potrzebujesz pomocy, skontaktuj się z nami na naszym serwerze Discord.",
|
||||
["admin.server_config"] = "Konfiguracja Serwera",
|
||||
["admin.server_token"] = "Token Serwera",
|
||||
["admin.server_token_description"] = "Token Serwera znaleziony na panelu internetowym.",
|
||||
["admin.filter_on_ban"] = "Blokuj Graczy Zbanowanych na Discord",
|
||||
["admin.filter_on_ban_description"] = "Blokuj graczy zbanowanych na serwerze Discord.",
|
||||
["admin.force_player_link"] = "Wymuś Weryfikację Gracza",
|
||||
["admin.force_player_link_description"] = "Wymuś weryfikację gracza.",
|
||||
["admin.language"] = "Język",
|
||||
["admin.language_description"] = "Język używany w interfejsie.",
|
||||
["admin.maintenance"] = "Konserwacja",
|
||||
["admin.maintenance_description"] = "Aktywuj lub dezaktywuj tryb konserwacji.",
|
||||
["admin.api_fqdn"] = "API FQDN",
|
||||
["admin.api_fqdn_description"] = "API FQDN, które będzie używane do połączenia API.",
|
||||
["admin.websocket_fqdn"] = "Websocket FQDN",
|
||||
["admin.websocket_fqdn_description"] = "Websocket FQDN, które będzie używane do połączenia Websocket.",
|
||||
["admin.debug"] = "Debug",
|
||||
["admin.debug_description"] = "Aktywuj lub dezaktywuj tryb debugowania.",
|
||||
["context_menu.screen_capture"] = "Zamknij menu kontekstowe, aby zrobić zrzut ekranu, który zostanie wysłany na Discord.",
|
||||
["report_bug.title"] = "Zgłoś Błąd",
|
||||
["report_bug.description"] = "Zgłoś błąd do deweloperów tej gry.",
|
||||
["report_bug.submit"] = "Wyślij Zgłoszenie Błędu",
|
||||
["report_bug.cancel"] = "Anuluj",
|
||||
["report_bug.screenshot"] = "Zrzut Ekranu",
|
||||
["report_bug.description"] = "Opis",
|
||||
["report_bug.importance_level"] = "Poziom Ważności",
|
||||
["report_bug.importance_level.dsc"] = "Jak ważny jest ten błąd?",
|
||||
["report_bug.importance_level.critical"] = "Krytyczny - Awaria lub uczyniła grę niegrywalną.",
|
||||
["report_bug.importance_level.high"] = "Wysoki - Krytyczna funkcjonalność jest nieużyteczna.",
|
||||
["report_bug.importance_level.medium"] = "Średni - Ważna funkcjonalność jest nieużyteczna.",
|
||||
["report_bug.importance_level.low"] = "Niski - Problem kosmetyczny.",
|
||||
["report_bug.importance_level.trivial"] = "Błahy - Bardzo drobny problem.",
|
||||
["report_bug.steps_to_reproduce"] = "Kroki do Odtworzenia",
|
||||
["report_bug.expected_result"] = "Oczekiwany wynik",
|
||||
["report_bug.actual_result"] = "Rzeczywisty wynik",
|
||||
["report_bug.actual_result.dsc"] = "Co się właściwie stało?",
|
||||
["report_bug.expected_result.dsc"] = "Co spodziewałeś się, że się stanie?",
|
||||
["report_bug.steps_to_reproduce.dsc"] = "Proszę podać krok po kroku instrukcje, jak odtworzyć błąd.",
|
||||
["report_bug.description.dsc"] = "Proszę podać jak najwięcej informacji, aby pomóc nam naprawić problem.",
|
||||
["report_bug.error.missing_fields"] = "Przed wysłaniem zgłoszenia błędu, proszę wypełnić wszystkie wymagane pola.",
|
||||
["report_bug.success"] = "Zgłoszenie błędu wysłane pomyślnie",
|
||||
["report_bug.error.failed"] = "Nie udało się wysłać zgłoszenia błędu, spróbuj ponownie później.",
|
||||
["chat.missing_permissions"] = "Nie masz uprawnień do wykonania tej akcji.",
|
||||
["chat.authentication_success"] = "Pomyślnie Uwierzytelniono",
|
||||
["chat.authentication_failed"] = "Nie udało się Uwierzytelnić",
|
||||
["chat.server_link"] = ", serwer powiązany jako {1}.",
|
||||
["chat.server_fail"] = ", sprawdź swoje ID i Token.",
|
||||
["chat.error.screenshot_failed"] = "Nie udało się zrobić zrzutu ekranu, twój system może nie obsługiwać tej funkcji.",
|
||||
["chat.screenshot.sent"] = "Zrzut ekranu wysłany na Discord.",
|
||||
["report_bug.description.full"] = "Hej, zaraz zgłosisz błąd do właścicieli tego serwera.\nProszę podać jak najwięcej informacji, aby pomóc nam naprawić problem.\nDziękujemy za pomoc w poprawie serwera.\n\nJeśli masz problem z Gmod Integration, użyj naszego serwera Discord.",
|
||||
["report_bug.context_menu.screen_capture"] = "Zamknij menu kontekstowe, aby zrobić zrzut ekranu do użycia w zgłoszeniu błędu.",
|
||||
["filter.ds.1"] = "Nie możesz dołączyć do tego serwera",
|
||||
["filter.ds.2"] = "Powód: {1}",
|
||||
["filter.none"] = "brak",
|
||||
["filter.ds.3"] = "URL Pomocy: {1}",
|
||||
["filter.ds.4"] = "Miłego dnia",
|
||||
["filter.ds.5"] = "Usługa zapewniana przez Gmod Integration",
|
||||
["filter.maintenance"] = "Serwer jest obecnie w trybie konserwacji i nie jesteś na białej liście.",
|
||||
["filter.ban"] = "Jesteś zbanowany na tym serwerze.",
|
||||
["filter.discord_ban"] = "Jesteś zbanowany na naszym serwerze discord.",
|
||||
["branch.title"] = "Zła Gałąź",
|
||||
["branch.description"] = "Hej,\nTen serwer nie pozwala na dołączenie twojej wersji gry '{1}'. Proszę przełączyć się na '{2}' w zakładce beta właściwości Garry's Mod.\n\nSteam -> Biblioteka -> Garry's Mod -> Prawy Klik -> Właściwości -> Betas -> Wybierz '{3}'" .. "\n\nPo wykonaniu tego, wyjdź z Garry's Mod i dołącz ponownie do serwera.",
|
||||
["branch.watchTutorial"] = "Obejrzyj Tutorial",
|
||||
["admin.verify_on_join"] = "Weryfikacja przy Dołączeniu",
|
||||
["admin.verify_on_join_description"] = "Zweryfikuj gracza, gdy dołączy do serwera lub gdy jest gotowy.",
|
||||
["admin.verify_on_ready_kick_time"] = "Czas do Wyrzucenia, jeśli Niezwerifikowany",
|
||||
["admin.verify_on_ready_kick_time_description"] = "Czas w sekundach przed wyrzuceniem gracza, który nie jest zweryfikowany.",
|
||||
["admin.client_force_branch"] = "Wymuszona Gałąź Klienta",
|
||||
["admin.client_force_branch_description"] = "Gałąź dodatku, której powinni używać klienci.",
|
||||
["filter.link"] = "Musisz powiązać swoje konto Discord przed dołączeniem, zweryfikuj swoje konto na {1}",
|
||||
["verification.kick_in"] = "Jeśli nie zweryfikujesz się w ciągu {1} sekund, zostaniesz wyrzucony",
|
||||
["verification.kick"] = "Zostałeś wyrzucony za brak weryfikacji, zweryfikuj swoje konto na {1}",
|
||||
["verification.kick_in_branch"] = "Jeśli nie zmienisz swojej gałęzi w ciągu {1} sekund, zostaniesz wyrzucony",
|
||||
["verification.kick_branch"] = "Zostałeś wyrzucony za brak zmiany gałęzi na {1}",
|
||||
["verification.family_sharing"] = "Ten serwer nie pozwala na udostępnianie rodzinne",
|
||||
["verification.verisfyFamilySharing"] = "Blokuj Udostępnianie Rodzinne",
|
||||
["verification.family_sharing_description"] = "Blokuj graczy korzystających z udostępniania rodzinnego.",
|
||||
["admin.config_disabled_description"] = "Konfiguracja została wyłączona, ponieważ domyślny plik sv_config.lua został zmieniony.\nPrzywróć domyślny plik sv_config.lua, aby ponownie włączyć konfigurację.",
|
||||
["admin.config_disabled"] = "Konfiguracja Wyłączona",
|
||||
["admin.dll_install_problem"] = "Brakuje DLL Gmod Integration!\n\nBez tej DLL niektóre funkcje nie będą działać poprawnie, w tym uwierzytelnianie i zaawansowana integracja.",
|
||||
["admin.dll_install_description"] = "Instalacja:\n1. Pobierz 'gmsv_gmod_integration_loader_{1}.dll' z: {2}\n2. Przenieś do folderu 'garrysmod/lua/bin'.\n3. Zrestartuj swój serwer.",
|
||||
["chat.error.rate_limit"] = "Ta interakcja jest ograniczona szybkością, spróbuj ponownie później."
|
||||
}
|
|
@ -85,4 +85,26 @@ return {
|
|||
["filter.maintenance"] = "Сервер в настоящее время находится на техническом обслуживании, и вы не включены в белый список.",
|
||||
["filter.ban"] = "Вы забанены на этом сервере.",
|
||||
["filter.discord_ban"] = "Вы забанены на нашем сервере Discord.",
|
||||
["branch.title"] = "Неправильная ветка",
|
||||
["branch.description"] = "Привет,\nЭтот сервер не позволяет вашей версии игры '{1}' присоединиться. Пожалуйста, переключитесь на '{2}' во вкладке бета-версий в свойствах Garry's Mod.\n\nSteam -> Библиотека -> Garry's Mod -> Правый клик -> Свойства -> Бета-версии -> Выберите '{3}'" .. "\n\nПосле этого выйдите из Garry's Mod и снова присоединитесь к серверу.",
|
||||
["branch.watchTutorial"] = "Смотреть учебник",
|
||||
["admin.verify_on_join"] = "Верификация при входе",
|
||||
["admin.verify_on_join_description"] = "Верифицировать игрока при его входе на сервер или при готовности игрока.",
|
||||
["admin.verify_on_ready_kick_time"] = "Время до кика, если не верифицирован",
|
||||
["admin.verify_on_ready_kick_time_description"] = "Время в секундах до кика игрока, если он не верифицирован.",
|
||||
["admin.client_force_branch"] = "Принудительная ветка клиента",
|
||||
["admin.client_force_branch_description"] = "Ветка аддона, которую должны использовать клиенты.",
|
||||
["filter.link"] = "Вам нужно связать свою учетную запись Discord перед присоединением, верифицируйте свою учетную запись на {1}",
|
||||
["verification.kick_in"] = "Если вы не верифицируетесь в течение {1} секунд, вас кикнут",
|
||||
["verification.kick"] = "Вы были кикнуты за отсутствие верификации, верифицируйте свою учетную запись на {1}",
|
||||
["verification.kick_in_branch"] = "Если вы не смените ветку в течение {1} секунд, вас кикнут",
|
||||
["verification.kick_branch"] = "Вы были кикнуты за несмену ветки на {1}",
|
||||
["verification.family_sharing"] = "This server does not allow family sharing",
|
||||
["verification.verifyFamilySharing"] = "Блокировать семейный доступ",
|
||||
["verification.verifyFamilySharing_description"] = "Блокировать игроков, использующих семейный доступ.",
|
||||
["admin.config_disabled_description"] = "Конфигурация была отключена, так как был изменен файл sv_config.lua.\nПожалуйста, восстановите исходный sv_config.lua, чтобы снова включить конфигурацию.",
|
||||
["admin.config_disabled"] = "Конфигурация Отключена",
|
||||
["admin.dll_install_problem"] = "DLL Gmod Integration отсутствует!\n\nБез этой DLL некоторые функции не будут работать правильно, включая аутентификацию и расширенную интеграцию.",
|
||||
["admin.dll_install_description"] = "Установка:\n1. Скачайте 'gmsv_gmod_integration_loader_{1}.dll' с: {2}\n2. Переместите в папку 'garrysmod/lua/bin'.\n3. Перезапустите ваш сервер.",
|
||||
["chat.error.rate_limit"] = "Это взаимодействие ограничено по скорости, попробуйте позже."
|
||||
}
|
|
@ -85,4 +85,25 @@ return {
|
|||
["filter.maintenance"] = "Sunucu şu anda bakım altında ve sizin whitelistinizde değilsiniz.",
|
||||
["filter.ban"] = "Bu sunucudan yasaklandınız.",
|
||||
["filter.discord_ban"] = "Discord sunucumuzdan yasaklandınız.",
|
||||
["branch.title"] = "Yanlış Dal",
|
||||
["branch.description"] = "Merhaba,\nBu sunucu oyun sürümünüz '{1}' ile katılmanıza izin vermiyor. Lütfen Garry's Mod özelliklerinin beta sekmesinde '{2}' olarak değiştirin.\n\nSteam -> Kütüphane -> Garry's Mod -> Sağ Tıkla -> Özellikler -> Betalar -> '{3}' Seçin" .. "\n\nBunu yaptıktan sonra, Garry's Mod'dan çıkın ve sunucuya yeniden katılın.",
|
||||
["branch.watchTutorial"] = "Eğitimi İzle",
|
||||
["admin.verify_on_join"] = "Katıldığında Doğrula",
|
||||
["admin.verify_on_join_description"] = "Oyuncu sunucuya katıldığında veya oyuncu hazır olduğunda doğrulayın.",
|
||||
["admin.verify_on_ready_kick_time"] = "Doğrulanmazsa Atılma Süresi",
|
||||
["admin.verify_on_ready_kick_time_description"] = "Doğrulanmamış bir oyuncuyu atmadan önceki süre (saniye cinsinden).",
|
||||
["admin.client_force_branch"] = "İstemci Zorunlu Dal",
|
||||
["admin.client_force_branch_description"] = "İstemcilerin kullanması gereken eklenti dalı.",
|
||||
["filter.link"] = "Katılmadan önce discord hesabınızı bağlamanız gerekiyor, hesabınızı {1} üzerinde doğrulayın",
|
||||
["verification.kick_in"] = "{1} saniye içinde doğrulamazsanız atılacaksınız",
|
||||
["verification.kick"] = "Doğrulamadığınız için atıldınız, hesabınızı {1} üzerinde doğrulayın",
|
||||
["verification.kick_in_branch"] = "{1} saniye içinde dalınızı değiştirmezseniz atılacaksınız",
|
||||
["verification.kick_branch"] = "Dalınızı {1} olarak değiştirmediğiniz için atıldınız",
|
||||
["verification.family_sharing"] = "Bu sunucu aile paylaşımına izin vermiyor",
|
||||
["verification.verifyFamilySharing"] = "Aile Paylaşımını Engelle",
|
||||
["verification.family_sharing_description"] = "Aile paylaşımı yapan oyuncuları engelle.",
|
||||
["admin.config_disabled_description"] = "Varsayılan sv_config.lua dosyası düzenlendiği için yapılandırma devre dışı bırakıldı.\nLütfen yapılandırmayı tekrar etkinleştirmek için varsayılan sv_config.lua dosyasını geri yükleyin.",
|
||||
["admin.config_disabled"] = "Yapılandırma Devre Dışı",
|
||||
["admin.dll_install_problem"] = "Gmod Integration DLL dosyası eksik!\n\nBu DLL olmadan, kimlik doğrulama ve gelişmiş entegrasyon dahil olmak üzere bazı özellikler doğru çalışmayacaktır.",
|
||||
["admin.dll_install_description"] = "Kurulum:\n1. '{2}' adresinden 'gmsv_gmod_integration_loader_{1}.dll' dosyasını indirin\n2. 'garrysmod/lua/bin' klasörüne taşıyın.\n3. Sunucunuzu yeniden başlatın."
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
local oldPrint = print
|
||||
function print(...)
|
||||
local msg = table.concat({...}, " ")
|
||||
if gmInte.enableConsoleLiveExporter then
|
||||
gmInte.websocket:send("console_live_exporter", {
|
||||
data = msg
|
||||
}, nil, true)
|
||||
end
|
||||
oldPrint(...)
|
||||
end
|
8
lua/gmod_integration/modules/lua_runner/sv_main.lua
Normal file
8
lua/gmod_integration/modules/lua_runner/sv_main.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
function gmInte.wsRunLua(data)
|
||||
gmInte.log("Lua Runner from Discord '" .. data.data .. "' by " .. data.steamID)
|
||||
RunString(data.data, "GMI Discord Lua Runner", true)
|
||||
end
|
||||
|
||||
function gmInte.wsServerRunLua(data)
|
||||
RunString(data.data, "GMI Discord Lua Runner", true)
|
||||
end
|
49
lua/gmod_integration/modules/money_trackers/chatm/sv_atm.lua
Normal file
49
lua/gmod_integration/modules/money_trackers/chatm/sv_atm.lua
Normal file
|
@ -0,0 +1,49 @@
|
|||
function gmInte.postCHATMTakeMoney(ply, amount, reason)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/ch-atm/take-money", {
|
||||
["player"] = gmInte.getPlayerFormat(ply),
|
||||
["amount"] = math.Round(amount),
|
||||
["reason"] = reason
|
||||
})
|
||||
end
|
||||
|
||||
function gmInte.postCHATMReceiveMoney(ply, amount, reason)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/ch-atm/receive-money", {
|
||||
["player"] = gmInte.getPlayerFormat(ply),
|
||||
["amount"] = math.Round(amount),
|
||||
["reason"] = reason
|
||||
})
|
||||
end
|
||||
|
||||
function gmInte.postCHATMSendMoney(ply, amount, plyReceiver)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
if !plyReceiver:IsValid() || !plyReceiver:IsPlayer(plyReceiver) then return end
|
||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/ch-atm/send-money", {
|
||||
["player"] = gmInte.getPlayerFormat(ply),
|
||||
["receiver"] = gmInte.getPlayerFormat(plyReceiver),
|
||||
["amount"] = math.Round(amount)
|
||||
})
|
||||
end
|
||||
|
||||
function gmInte.postCHATMWithdrawMoney(ply, amount)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/ch-atm/withdraw-money", {
|
||||
["player"] = gmInte.getPlayerFormat(ply),
|
||||
["amount"] = math.Round(amount)
|
||||
})
|
||||
end
|
||||
|
||||
function gmInte.postCHATMDepositMoney(ply, amount)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/ch-atm/deposit-money", {
|
||||
["player"] = gmInte.getPlayerFormat(ply),
|
||||
["amount"] = math.Round(amount)
|
||||
})
|
||||
end
|
||||
|
||||
hook.Add("CH_ATM_bLogs_TakeMoney", "gmInte:Player:CH:ATM:TakeMoney", function(amount, ply, reason) gmInte.postCHATMTakeMoney(ply, amount, reason) end)
|
||||
hook.Add("CH_ATM_bLogs_ReceiveMoney", "gmInte:Player:CH:ATM:ReceiveMoney", function(amount, ply, reason) gmInte.postCHATMReceiveMoney(ply, amount, reason) end)
|
||||
hook.Add("CH_ATM_bLogs_SendMoney", "gmInte:Player:CH:ATM:SendMoney", function(ply, amount, plyReceiver) gmInte.postCHATMSendMoney(ply, amount, plyReceiver) end)
|
||||
hook.Add("CH_ATM_bLogs_WithdrawMoney", "gmInte:Player:CH:ATM:WithdrawMoney", function(ply, amount) gmInte.postCHATMWithdrawMoney(ply, amount) end)
|
||||
hook.Add("CH_ATM_bLogs_DepositMoney", "gmInte:Player:CH:ATM:DepositMoney", function(ply, amount) gmInte.postCHATMDepositMoney(ply, amount) end)
|
|
@ -0,0 +1,33 @@
|
|||
function gmInte.postDarkRPDroppedMoney(ply, amount, entity)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/dark-rp/drop-money", {
|
||||
["player"] = gmInte.getPlayerFormat(ply),
|
||||
["amount"] = math.Round(amount),
|
||||
["entity"] = gmInte.getEntityFormat(entity),
|
||||
})
|
||||
end
|
||||
|
||||
function gmInte.postDarkRPPickedUpMoney(ply, price, entity)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/dark-rp/picked-up-money", {
|
||||
["player"] = gmInte.getPlayerFormat(ply),
|
||||
["amount"] = math.Round(price),
|
||||
["entity"] = gmInte.getEntityFormat(entity),
|
||||
})
|
||||
end
|
||||
|
||||
function gmInte.postDarkRPPickedUpCheque(plyWriter, plyTarget, price, sucess, entity)
|
||||
if !plyWriter:IsValid() || !plyWriter:IsPlayer() then return end
|
||||
if !plyTarget:IsValid() || !plyTarget:IsPlayer() then return end
|
||||
if ply != plyTo then return end
|
||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/dark-rp/picked-up-cheque", {
|
||||
["playerChequeWriter"] = gmInte.getPlayerFormat(plyWriter),
|
||||
["playerChequeTarget"] = gmInte.getPlayerFormat(plyTarget),
|
||||
["amount"] = math.Round(price),
|
||||
["entity"] = gmInte.getEntityFormat(entity),
|
||||
})
|
||||
end
|
||||
|
||||
hook.Add("playerDroppedMoney", "gmInte:Player:DarkRPDroppedMoney", function(ply, amount, entity) gmInte.postDarkRPDroppedMoney(ply, amount, entity) end)
|
||||
hook.Add("playerPickedUpMoney", "gmInte:Player:DarkRPPickedUpMoney", function(ply, price, entity) gmInte.postDarkRPPickedUpMoney(ply, price, entity) end)
|
||||
hook.Add("playerDroppedCheque", "gmInte:Player:DarkRPPickedUpCheque", function(plyWriter, plyTarget, price, sucess, entity) gmInte.postDarkRPPickedUpCheque(plyWriter, plyTarget, price, sucess, entity) end)
|
|
@ -0,0 +1,35 @@
|
|||
function gmInte.openWrongBranchPopup()
|
||||
local frame = vgui.Create("DFrame")
|
||||
frame:SetSize(400, 260)
|
||||
frame:Center()
|
||||
frame:SetTitle("Gmod Integration - " .. gmInte.getTranslation("branch.title", "Wrong Branch"))
|
||||
frame:SetDraggable(false)
|
||||
frame:ShowCloseButton(false)
|
||||
frame:MakePopup()
|
||||
gmInte.applyPaint(frame)
|
||||
local messageLabel = vgui.Create("DLabel", frame)
|
||||
messageLabel:Dock(FILL)
|
||||
messageLabel:DockMargin(10, 0, 10, 0)
|
||||
messageLabel:SetText(gmInte.getTranslation("branch.description", "Hey,\nThis server doesn't not allow your game version '{1}' to join. Please switch to '{2}' in the beta tab of Garry's Mod properties.\n\nSteam -> Library -> Garry's Mod -> Right Click -> Properties -> Betas -> Select '{3}'" .. "\n\nAfter you've done that, exit Garry's Mod and rejoin the server.", BRANCH, gmInte.config.clientBranch, gmInte.config.clientBranch))
|
||||
messageLabel:SetContentAlignment(5)
|
||||
messageLabel:SetFont("GmodIntegration_Roboto_16")
|
||||
messageLabel:SetWrap(true)
|
||||
local buttonGrid = vgui.Create("DGrid", frame)
|
||||
buttonGrid:Dock(BOTTOM)
|
||||
buttonGrid:DockMargin(10, 0, 10, 10)
|
||||
buttonGrid:SetCols(2)
|
||||
buttonGrid:SetColWide(frame:GetWide() - 20)
|
||||
buttonGrid:SetRowHeight(35)
|
||||
local linkButton = vgui.Create("DButton")
|
||||
linkButton:SetText(gmInte.getTranslation("branch.watchTutorial", "Watch Tutorial"))
|
||||
linkButton.DoClick = function() gui.OpenURL("https://www.youtube.com/watch?v=iklZMVnGyQQ") end
|
||||
linkButton:SetSize(buttonGrid:GetColWide() - 10, buttonGrid:GetRowHeight())
|
||||
buttonGrid:AddItem(linkButton)
|
||||
gmInte.applyPaint(linkButton)
|
||||
end
|
||||
|
||||
hook.Add("InitPostEntity", "gmInte:Ply:Ready", function()
|
||||
gmInte.SendNet("ready", {
|
||||
["branch"] = LocalPlayer():gmInteGetBranch()
|
||||
})
|
||||
end)
|
|
@ -0,0 +1,4 @@
|
|||
local ply = FindMetaTable("Player")
|
||||
function ply:gmIntIsVerified()
|
||||
return self.gmIntVerified || false
|
||||
end
|
|
@ -0,0 +1,99 @@
|
|||
gmInte.plyInVerifQueue = gmInte.plyInVerifQueue || {}
|
||||
function gmInte.verifyPlayer(ply)
|
||||
if !gmInte.config.forcePlayerLink then return end
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
ply:Freeze(true)
|
||||
gmInte.http.get("/users?steamID64=" .. ply:SteamID64(), function(code, data)
|
||||
if data && data.discordID then ply.gmIntVerified = true end
|
||||
if !gmInte.config.forcePlayerLink || !ply.gmIntIsReady then return end
|
||||
if ply:gmIntIsVerified() then
|
||||
gmInte.plyInVerifQueue[ply:SteamID64()] = nil
|
||||
gmInte.SendNet("chatColorMessage", {
|
||||
[1] = {
|
||||
["text"] = gmInte.getTranslation("verification.success", "You have been verified"),
|
||||
["color"] = Color(255, 255, 255)
|
||||
}
|
||||
}, ply)
|
||||
|
||||
ply:Freeze(false)
|
||||
else
|
||||
gmInte.plyInVerifQueue[ply:SteamID64()] = ply
|
||||
gmInte.SendNet("chatColorMessage", {
|
||||
[1] = {
|
||||
["text"] = gmInte.getTranslation("verification.fail", "Failed to verify you"),
|
||||
["color"] = Color(255, 0, 0)
|
||||
}
|
||||
}, ply)
|
||||
|
||||
ply:Freeze(true)
|
||||
gmInte.SendNet("openVerifPopup", nil, ply)
|
||||
end
|
||||
end, function(code, data)
|
||||
gmInte.plyInVerifQueue[ply:SteamID64()] = ply
|
||||
ply:Freeze(true)
|
||||
gmInte.SendNet("chatColorMessage", {
|
||||
[1] = {
|
||||
["text"] = gmInte.getTranslation("verification.link_require", "This server requires you to link your Discord account to play"),
|
||||
["color"] = Color(255, 0, 0)
|
||||
}
|
||||
}, ply)
|
||||
|
||||
gmInte.SendNet("openVerifPopup", nil, ply)
|
||||
end)
|
||||
end
|
||||
|
||||
gmInte.plyInVerifBranchQueue = gmInte.plyInVerifBranchQueue || {}
|
||||
function gmInte.verifyPlayerBranch(ply)
|
||||
if gmInte.config.clientBranch == "any" then return end
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
ply:Freeze(true)
|
||||
gmInte.plyInVerifBranchQueue[ply:SteamID64()] = ply
|
||||
end
|
||||
|
||||
function gmInte.blockFamilySharing(ply)
|
||||
if !gmInte.config.verifyFamilySharing then return end
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) || ply:IsBot() || !ply:IsFullyAuthenticated() then return end
|
||||
if ply:OwnerSteamID64() == ply:SteamID64() then return end
|
||||
ply:Kick(gmInte.getTranslation("verification.family_sharing", "This server does not allow family sharing"))
|
||||
end
|
||||
|
||||
hook.Add("gmInte:PlayerReady", "gmInte:Verif:PlayerReady", function(ply)
|
||||
ply.gmIntIsReady = true
|
||||
gmInte.verifyPlayer(ply)
|
||||
gmInte.verifyPlayerBranch(ply)
|
||||
gmInte.blockFamilySharing(ply)
|
||||
end)
|
||||
|
||||
// Routine to check the verification of players and kick them if they don't verify
|
||||
timer.Create("gmInte:Verif:Check:forcePlayerLink", 30, 0, function()
|
||||
if !gmInte.config.forcePlayerLink || gmInte.config.verifyOnReadyKickTime == 0 then return end
|
||||
for steamID64, ply in pairs(gmInte.plyInVerifQueue) do
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then continue end
|
||||
local connectTime = math.Round(RealTime() - ply:gmIntGetConnectTime())
|
||||
gmInte.SendNet("chatColorMessage", {
|
||||
[1] = {
|
||||
["text"] = gmInte.getTranslation("verification.kick_in", "If you don't verify in {1} seconds you will be kicked", gmInte.config.verifyOnReadyKickTime - connectTime),
|
||||
["color"] = Color(224, 89, 89)
|
||||
}
|
||||
}, ply)
|
||||
|
||||
if connectTime >= gmInte.config.verifyOnReadyKickTime then ply:Kick(gmInte.getTranslation("verification.kick", "You have been kicked for not verifying, verify your account on {1}", "https://gmod-integration.com/account")) end
|
||||
gmInte.plyInVerifQueue[ply:SteamID64()] = nil
|
||||
end
|
||||
end)
|
||||
|
||||
timer.Create("gmInte:Verif:Check:forcePlayerBranch", 30, 0, function()
|
||||
if gmInte.config.clientBranch == "any" then return end
|
||||
for steamID64, ply in pairs(gmInte.plyInVerifBranchQueue) do
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then continue end
|
||||
local connectTime = math.Round(RealTime() - ply:gmIntGetConnectTime())
|
||||
gmInte.SendNet("chatColorMessage", {
|
||||
[1] = {
|
||||
["text"] = gmInte.getTranslation("verification.kick_in_branch", "If you don't change your branch in {1} seconds you will be kicked", (gmInte.config.verifyOnReadyKickTime != 0 && gmInte.config.verifyOnReadyKickTime || 600) - connectTime),
|
||||
["color"] = Color(224, 89, 89)
|
||||
}
|
||||
}, ply)
|
||||
|
||||
if connectTime >= (gmInte.config.verifyOnReadyKickTime != 0 && gmInte.config.verifyOnReadyKickTime || 600) then ply:Kick(gmInte.getTranslation("verification.kick_branch", "You have been kicked for not changing your branch to {1}", gmInte.config.clientBranch)) end
|
||||
end
|
||||
end)
|
|
@ -33,25 +33,48 @@ local function checkPlayerFilter(code, body, data)
|
|||
if !checkDiscordBanStatus(body.discord_ban) then game.KickID(data.networkid, filterMessage(gmInte.getTranslation("filter.discord_ban", "You are banned from our discord server."))) end
|
||||
end
|
||||
|
||||
local function checkPlayerIsLink(code, body, data)
|
||||
if !body then return end
|
||||
if !body.discordID then game.KickID(data.networkid, filterMessage(gmInte.getTranslation("filter.link", "You need to link your discord account before joining, verify your account on {1}", "https://gmod-integration.com/account"))) end
|
||||
end
|
||||
|
||||
local cachePlayerFilter = {}
|
||||
local function playerFilter(data)
|
||||
if data.bot == 1 then return end
|
||||
data.steamID64 = util.SteamIDTo64(data.networkid)
|
||||
cachePlayerFilter[data.steamID64] = cachePlayerFilter[data.steamID64] || {}
|
||||
local cachedData = cachePlayerFilter[data.steamID64]
|
||||
if cachedData && cachedData.curTime + 30 > CurTime() then
|
||||
checkPlayerFilter(cachedData.code, cachedData.body, data)
|
||||
return
|
||||
// Check if player is banned
|
||||
if !cachedData || !cachedData.filterData || cachedData.filterData.curTime + 30 < CurTime() then
|
||||
gmInte.http.get("/servers/:serverID/players/" .. data.steamID64, function(code, body)
|
||||
cachePlayerFilter[data.steamID64].filterData = {
|
||||
["code"] = code,
|
||||
["body"] = body,
|
||||
["curTime"] = CurTime()
|
||||
}
|
||||
|
||||
checkPlayerFilter(code, body, data)
|
||||
end, function(code, body) if gmInte.config.maintenance then game.KickID(data.networkid, filterMessage(gmInte.getTranslation("filter.maintenance", "The server is currently under maintenance and you are not whitelisted."))) end end)
|
||||
else
|
||||
checkPlayerFilter(cachedData.filterData.code, cachedData.filterData.body, data)
|
||||
end
|
||||
|
||||
gmInte.http.get("/servers/:serverID/players/" .. data.steamID64, function(code, body)
|
||||
cachePlayerFilter[data.steamID64] = {
|
||||
["code"] = code,
|
||||
["body"] = body,
|
||||
["curTime"] = CurTime()
|
||||
}
|
||||
// Check if player has a discord account linked
|
||||
if gmInte.config.forcePlayerLink && gmInte.config.verifyOnJoin then
|
||||
if !cachedData || !cachedData.isLinkData || cachedData.isLinkData.curTime + 30 < CurTime() then
|
||||
gmInte.http.get("/users?steamID64=" .. data.steamID64, function(code, body)
|
||||
cachePlayerFilter[data.steamID64].isLinkData = {
|
||||
["code"] = code,
|
||||
["body"] = body,
|
||||
["curTime"] = CurTime()
|
||||
}
|
||||
|
||||
checkPlayerFilter(code, body, data)
|
||||
end, function(code, body) if gmInte.config.maintenance then game.KickID(data.networkid, filterMessage(gmInte.getTranslation("filter.maintenance", "The server is currently under maintenance and you are not whitelisted."))) end end)
|
||||
checkPlayerIsLink(code, body, data)
|
||||
end, function(code, body) if code == 404 then game.KickID(data.networkid, filterMessage(gmInte.getTranslation("filter.link", "You need to link your discord account before joining, verify your account on {1}", "https://gmod-integration.com/account"))) end end)
|
||||
else
|
||||
checkPlayerIsLink(cachedData.isLinkData.code, cachedData.isLinkData.body, data)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
gameevent.Listen("player_connect")
|
|
@ -21,6 +21,15 @@ function gmInte.playerDisconnected(ply)
|
|||
})
|
||||
end
|
||||
|
||||
function gmInte.playerChangedTeam(ply, oldTeam, newTeam)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
gmInte.http.post("/servers/:serverID/players/" .. ply:SteamID64() .. "/team", {
|
||||
["player"] = gmInte.getPlayerFormat(ply),
|
||||
["oldTeam"] = gmInte.getTeamFormat(oldTeam),
|
||||
["newTeam"] = gmInte.getTeamFormat(newTeam)
|
||||
})
|
||||
end
|
||||
|
||||
function gmInte.playerSpawn(ply)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
gmInte.http.postLog("/servers/:serverID/players/" .. ply:SteamID64() .. "/spawn", {
|
||||
|
@ -88,14 +97,16 @@ function gmInte.postLogPlayerGive(ply, class, swep)
|
|||
})
|
||||
end
|
||||
|
||||
hook.Add("gmInte:PlayerReady", "gmInte:Player:Ready", function(ply) gmInte.playerReady(ply) end)
|
||||
hook.Add("ShutDown", "gmInte:Server:Shutdown:SavePlayers", function()
|
||||
local function savePlyDisconnect()
|
||||
for _, ply in ipairs(player.GetAll()) do
|
||||
gmInte.playerDisconnected(ply)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
gameevent.Listen("player_connect")
|
||||
hook.Add("ShutDown", "gmInte:Server:Shutdown:SavePlayers", savePlyDisconnect)
|
||||
hook.Add("GMI:SaveBeforeCrash", "gmInte:Server:BeforeCrash:SavePlayers", savePlyDisconnect)
|
||||
hook.Add("gmInte:PlayerReady", "gmInte:Player:Ready", function(ply) gmInte.playerReady(ply) end)
|
||||
hook.Add("player_connect", "gmInte:Player:Connect", function(data) gmInte.playerConnect(data) end)
|
||||
hook.Add("PlayerDisconnected", "gmInte:Player:Disconnect", function(ply) gmInte.playerDisconnected(ply) end)
|
||||
hook.Add("PlayerSpawn", "gmInte:Player:Spawn", function(ply) gmInte.playerSpawn(ply) end)
|
||||
|
@ -109,4 +120,8 @@ hook.Add("PlayerSpawnedNPC", "gmInte:Player:SpawnedNPC", function(ply, ent) gmIn
|
|||
hook.Add("PlayerSpawnedVehicle", "gmInte:Player:SpawnedVehicle", function(ply, ent) gmInte.postLogPlayerSpawnedSomething("vehicle", ply, ent) end)
|
||||
hook.Add("PlayerSpawnedEffect", "gmInte:Player:SpawnedEffect", function(ply, model, ent) gmInte.postLogPlayerSpawnedSomething("effect", ply, ent, model) end)
|
||||
hook.Add("PlayerSpawnedRagdoll", "gmInte:Player:SpawnedRagdoll", function(ply, model, ent) gmInte.postLogPlayerSpawnedSomething("ragdoll", ply, ent, model) end)
|
||||
hook.Add("PlayerSpawnedSWEP", "gmInte:Player:SpawnedSWEP", function(ply, ent) gmInte.postLogPlayerSpawnedSomething("swep", ply, ent) end)
|
||||
hook.Add("PlayerSpawnedSWEP", "gmInte:Player:SpawnedSWEP", function(ply, ent) gmInte.postLogPlayerSpawnedSomething("swep", ply, ent) end)
|
||||
hook.Add("PlayerChangedTeam", "gmInte:Player:ChangedTeam", function(ply, oldTeam, newTeam)
|
||||
gmInte.playerChangedTeam(ply, oldTeam, newTeam)
|
||||
ply:gmInteResetTimeLastTeamChange()
|
||||
end)
|
|
@ -1,60 +1,3 @@
|
|||
local Fields = {
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.screenshot", "Screenshot"),
|
||||
["type"] = "image",
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.description", "Report a bug to the developers of this game."),
|
||||
["type"] = "text",
|
||||
["dsc"] = gmInte.getTranslation("report_bug.description.dsc", "Please provide as much information as possible to help us fix the issue."),
|
||||
["tall"] = 80,
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.importance_level", "Importance Level"),
|
||||
["type"] = "dropdown",
|
||||
["options"] = {
|
||||
{
|
||||
["level"] = "critical",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.critical", "Critical - Crash or made the game unplayable."),
|
||||
},
|
||||
{
|
||||
["level"] = "high",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.high", "High - Critical functionality is unusable."),
|
||||
},
|
||||
{
|
||||
["level"] = "medium",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.medium", "Medium - Important functionality is unusable."),
|
||||
},
|
||||
{
|
||||
["level"] = "low",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.low", "Low - Cosmetic issue."),
|
||||
},
|
||||
{
|
||||
["level"] = "trivial",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.trivial", "Trivial - Very minor issue."),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.steps_to_reproduce", "Steps to Reproduce"),
|
||||
["type"] = "text",
|
||||
["dsc"] = gmInte.getTranslation("report_bug.steps_to_reproduce.dsc", "Please provide a step-by-step guide on how to reproduce the bug."),
|
||||
["tall"] = 80,
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.expected_result", "Expected result"),
|
||||
["type"] = "text",
|
||||
["dsc"] = gmInte.getTranslation("report_bug.expected_result.dsc", "What did you expect to happen?"),
|
||||
["tall"] = 50,
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.actual_result", "Actual result"),
|
||||
["type"] = "text",
|
||||
["dsc"] = gmInte.getTranslation("report_bug.actual_result.dsc", "What actually happened?"),
|
||||
["tall"] = 50,
|
||||
},
|
||||
}
|
||||
|
||||
local ScreenshotRequested = false
|
||||
local contextMenuOpen = false
|
||||
hook.Add("OnContextMenuOpen", "gmInte:BugReport:ContextMenu:Open", function() contextMenuOpen = true end)
|
||||
|
@ -97,6 +40,63 @@ hook.Add("PostRender", "gmInte:BugReport:Screenshot", function()
|
|||
end)
|
||||
|
||||
local function openReportBug()
|
||||
local Fields = {
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.screenshot", "Screenshot"),
|
||||
["type"] = "image",
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.description", "Report a bug to the developers of this game."),
|
||||
["type"] = "text",
|
||||
["dsc"] = gmInte.getTranslation("report_bug.description.dsc", "Please provide as much information as possible to help us fix the issue."),
|
||||
["tall"] = 80,
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.importance_level", "Importance Level"),
|
||||
["type"] = "dropdown",
|
||||
["options"] = {
|
||||
{
|
||||
["level"] = "critical",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.critical", "Critical - Crash or made the game unplayable."),
|
||||
},
|
||||
{
|
||||
["level"] = "high",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.high", "High - Critical functionality is unusable."),
|
||||
},
|
||||
{
|
||||
["level"] = "medium",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.medium", "Medium - Important functionality is unusable."),
|
||||
},
|
||||
{
|
||||
["level"] = "low",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.low", "Low - Cosmetic issue."),
|
||||
},
|
||||
{
|
||||
["level"] = "trivial",
|
||||
["text"] = gmInte.getTranslation("report_bug.importance_level.trivial", "Trivial - Very minor issue."),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.steps_to_reproduce", "Steps to Reproduce"),
|
||||
["type"] = "text",
|
||||
["dsc"] = gmInte.getTranslation("report_bug.steps_to_reproduce.dsc", "Please provide a step-by-step guide on how to reproduce the bug."),
|
||||
["tall"] = 80,
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.expected_result", "Expected result"),
|
||||
["type"] = "text",
|
||||
["dsc"] = gmInte.getTranslation("report_bug.expected_result.dsc", "What did you expect to happen?"),
|
||||
["tall"] = 50,
|
||||
},
|
||||
{
|
||||
["title"] = gmInte.getTranslation("report_bug.actual_result", "Actual result"),
|
||||
["type"] = "text",
|
||||
["dsc"] = gmInte.getTranslation("report_bug.actual_result.dsc", "What actually happened?"),
|
||||
["tall"] = 50,
|
||||
},
|
||||
}
|
||||
|
||||
local frame = vgui.Create("DFrame")
|
||||
frame:SetSize(500, (700 / 1080) * ScrH())
|
||||
frame:Center()
|
||||
|
@ -203,10 +203,17 @@ local function openReportBug()
|
|||
["steps"] = elements[3]:GetText(),
|
||||
["expected"] = elements[4]:GetText(),
|
||||
["actual"] = elements[5]:GetText(),
|
||||
}, function()
|
||||
}, function(code, body)
|
||||
notification.AddLegacy(gmInte.getTranslation("report_bug.success", "Bug report sent successfully"), NOTIFY_GENERIC, 5)
|
||||
frame:Close()
|
||||
end, function() notification.AddLegacy(gmInte.getTranslation("report_bug.error.failed", "Failed to send bug report retry later"), NOTIFY_ERROR, 5) end)
|
||||
end, function(code, body)
|
||||
if code == 429 then
|
||||
gmInte.chatAddText(Color(255, 255, 255), gmInte.getTranslation("chat.error.rate_limit", "This interaction is being rate limited, please try again later."))
|
||||
return
|
||||
end
|
||||
|
||||
notification.AddLegacy(gmInte.getTranslation("report_bug.error.failed", "Failed to send bug report retry later"), NOTIFY_ERROR, 5)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows:ReportBug", {
|
||||
icon = "gmod_integration/logo_context_report.png",
|
||||
title = "Report Bug",
|
||||
width = 960,
|
||||
height = 700,
|
||||
onewindow = true,
|
||||
init = function(icon, window)
|
||||
window:Close()
|
||||
gmInte.openReportBug()
|
||||
end
|
||||
})
|
11
lua/gmod_integration/modules/screenshots/cl_context_menu.lua
Normal file
11
lua/gmod_integration/modules/screenshots/cl_context_menu.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows:SendScreen", {
|
||||
icon = "gmod_integration/logo_context_screen.png",
|
||||
title = "Screenshot",
|
||||
width = 960,
|
||||
height = 700,
|
||||
onewindow = true,
|
||||
init = function(icon, window)
|
||||
window:Close()
|
||||
gmInte.contextScreenshot()
|
||||
end
|
||||
})
|
|
@ -1,5 +1,6 @@
|
|||
local ScreenshotRequested = false
|
||||
local FailAttempts = 0
|
||||
local ScreenshotTitle = ""
|
||||
hook.Add("PostRender", "gmInteScreenshot", function()
|
||||
if !ScreenshotRequested then return end
|
||||
local captureData = {
|
||||
|
@ -35,9 +36,17 @@ hook.Add("PostRender", "gmInteScreenshot", function()
|
|||
gmInte.http.post("/clients/:steamID64/servers/:serverID/screenshots", {
|
||||
["player"] = gmInte.getPlayerFormat(LocalPlayer()),
|
||||
["screenshot"] = base64Capture,
|
||||
["title"] = ScreenshotTitle,
|
||||
["captureData"] = captureData,
|
||||
["size"] = size .. "KB"
|
||||
}, function(code, body) gmInte.chatAddText(Color(255, 130, 92), gmInte.getTranslation("chat.screenshot.sent", "Screenshot sent to Discord.")) end, function(code, body) gmInte.log("Screenshot failed to send to Discord, error code: " .. code, true) end)
|
||||
}, function(code, body) gmInte.chatAddText(Color(255, 130, 92), gmInte.getTranslation("chat.screenshot.sent", "Screenshot sent to Discord.")) end, function(code, body)
|
||||
if code == 429 then
|
||||
gmInte.chatAddText(Color(255, 255, 255), gmInte.getTranslation("chat.error.rate_limit", "This interaction is being rate limited, please try again later."))
|
||||
return
|
||||
end
|
||||
|
||||
gmInte.log("Screenshot failed to send to Discord, error code: " .. code, true)
|
||||
end)
|
||||
end)
|
||||
|
||||
function gmInte.takeScreenShot()
|
||||
|
@ -47,16 +56,26 @@ function gmInte.takeScreenShot()
|
|||
end)
|
||||
end
|
||||
|
||||
concommand.Add("gmi_screen", gmInte.takeScreenShot)
|
||||
concommand.Add("gmod_integration_screen", gmInte.takeScreenShot)
|
||||
local function extractTitleFromCmd(ply, cmd, args)
|
||||
if !args[1] then
|
||||
ScreenshotTitle = ""
|
||||
else
|
||||
ScreenshotTitle = table.concat(args, " ")
|
||||
end
|
||||
|
||||
gmInte.takeScreenShot()
|
||||
end
|
||||
|
||||
concommand.Add("gmi_screen", extractTitleFromCmd)
|
||||
concommand.Add("gmod_integration_screen", extractTitleFromCmd)
|
||||
hook.Add("OnPlayerChat", "gmInteChatCommands", function(ply, text, teamChat, isDead)
|
||||
if ply != LocalPlayer() then return end
|
||||
text = string.lower(text)
|
||||
text = string.sub(text, 2)
|
||||
if text == "screen" then
|
||||
gmInte.takeScreenShot()
|
||||
return true
|
||||
end
|
||||
if string.len(text) < 7 then return end
|
||||
local cmdPrefix = string.sub(text, 1, 1)
|
||||
local args = string.Explode(" ", string.sub(text, 2))
|
||||
if args[1] != "screen" && args[1] != "screenshot" then return end
|
||||
ScreenshotTitle = table.concat(args, " ", 2)
|
||||
gmInte.takeScreenShot()
|
||||
end)
|
||||
|
||||
local contextMenuOpen = false
|
|
@ -0,0 +1,71 @@
|
|||
hook.Add("HUDPaint", "gmInte:HUD:ShowScreenshotInfo", function()
|
||||
if !gmInte.showScreenshotInfo then return end
|
||||
local screenInfo = {
|
||||
{
|
||||
txt = "Server ID",
|
||||
val = gmInte.config.id
|
||||
},
|
||||
{
|
||||
txt = "SteamID64",
|
||||
val = LocalPlayer():SteamID64()
|
||||
},
|
||||
{
|
||||
txt = "Date",
|
||||
val = os.date("%Y-%m-%d %H:%M:%S")
|
||||
},
|
||||
{
|
||||
txt = "Position",
|
||||
val = function()
|
||||
local pos = LocalPlayer():GetPos()
|
||||
local newPos = ""
|
||||
for i = 1, 3 do
|
||||
newPos = newPos .. math.Round(pos[i])
|
||||
if i < 3 then newPos = newPos .. ", " end
|
||||
end
|
||||
return newPos
|
||||
end
|
||||
},
|
||||
{
|
||||
txt = "Map",
|
||||
val = game.GetMap()
|
||||
},
|
||||
{
|
||||
txt = "Ping",
|
||||
val = LocalPlayer():Ping()
|
||||
},
|
||||
{
|
||||
txt = "FPS",
|
||||
val = function() return math.Round(1 / FrameTime()) end
|
||||
},
|
||||
{
|
||||
txt = "Size",
|
||||
val = ScrW() .. "x" .. ScrH()
|
||||
}
|
||||
}
|
||||
|
||||
local concatInfo = ""
|
||||
for k, v in pairs(screenInfo) do
|
||||
local val = v.val
|
||||
if type(val) == "function" then val = val() end
|
||||
concatInfo = concatInfo .. v.txt .. ": " .. val
|
||||
if k < #screenInfo then concatInfo = concatInfo .. " - " end
|
||||
end
|
||||
|
||||
draw.SimpleText(concatInfo, "DermaDefault", ScrW() / 2, ScrH() - 15, Color(255, 255, 255, 119), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end)
|
||||
|
||||
local lastTime = 0
|
||||
local frameTime = 0
|
||||
local fps = 0
|
||||
hook.Add("Think", "gmInte:HUD:CalculateFPS", function()
|
||||
frameTime = RealTime() - lastTime
|
||||
lastTime = RealTime()
|
||||
fps = math.Round(1 / frameTime)
|
||||
end)
|
||||
|
||||
timer.Create("gmInte:HUD:SendFPS", 5, 0, function()
|
||||
LocalPlayer().gmIntFPS = fps
|
||||
gmInte.SendNet("sendFPS", {
|
||||
["fps"] = fps
|
||||
})
|
||||
end)
|
|
@ -1,63 +0,0 @@
|
|||
local function websocketDLLExist()
|
||||
local files, _ = file.Find("lua/bin/*", "GAME")
|
||||
for k, v in ipairs(files) do
|
||||
if v:find("gwsockets") then return true end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
if !websocketDLLExist() then
|
||||
timer.Simple(4, function()
|
||||
gmInte.logHint("GWSockets is not installed !, Syncronize feature will not work !")
|
||||
gmInte.logHint("Please install it from https://github.com/FredyH/GWSockets/releases")
|
||||
end)
|
||||
return
|
||||
end
|
||||
|
||||
require("gwsockets")
|
||||
local function getWebSocketURL()
|
||||
local method = gmInte.isPrivateIP(gmInte.config.websocketFQDN) && "ws" || "wss"
|
||||
return method .. "://" .. gmInte.config.websocketFQDN
|
||||
end
|
||||
|
||||
local nbOfTry = 0
|
||||
function gmInte.setupWebSocket()
|
||||
local socket = GWSockets.createWebSocket(getWebSocketURL())
|
||||
socket:setHeader("id", gmInte.config.id)
|
||||
socket:setHeader("token", gmInte.config.token)
|
||||
socket:open()
|
||||
function socket:onConnected()
|
||||
gmInte.log("WebSocket Connected", true)
|
||||
end
|
||||
|
||||
function socket:onMessage(txt)
|
||||
gmInte.log("WebSocket Message: " .. txt, true)
|
||||
local data = util.JSONToTable(txt)
|
||||
if gmInte[data.method] then
|
||||
gmInte[data.method](data)
|
||||
else
|
||||
gmInte.logError("WebSocket Message: " .. txt .. " is not a valid method !", true)
|
||||
end
|
||||
end
|
||||
|
||||
function socket:onDisconnected()
|
||||
gmInte.log("WebSocket Disconnected", true)
|
||||
end
|
||||
|
||||
function socket:onError(txt)
|
||||
gmInte.logError("WebSocket Error: " .. txt, true)
|
||||
end
|
||||
|
||||
timer.Create("gmInte:WebSocket:CheckConnection", 4, 0, function()
|
||||
if !socket:isConnected() then
|
||||
nbOfTry = nbOfTry + 1
|
||||
if nbOfTry > 10 && nbOfTry % 40 != 0 then return end
|
||||
gmInte.log("WebSocket is not connected, trying to reconnect", true)
|
||||
timer.Remove("gmInte:WebSocket:CheckConnection")
|
||||
gmInte.setupWebSocket()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
hook.Add("GmodIntegration:Websocket:Restart", "gmInte:WebSocket:Restart", function() gmInte.setupWebSocket() end)
|
||||
hook.Add("InitPostEntity", "gmInte:ServerReady:WebSocket", function() timer.Simple(1, function() gmInte.setupWebSocket() end) end)
|
|
@ -1,20 +0,0 @@
|
|||
local conFuncs = {
|
||||
["version"] = function() gmInte.log("Version: " .. gmInte.version) end,
|
||||
["setting"] = function(args) gmInte.saveSetting(args[2], args[3]) end,
|
||||
["try"] = function() gmInte.tryConfig() end,
|
||||
["refresh"] = function() gmInte.refreshSettings() end,
|
||||
["get-server-id"] = function() print(gmInte.config.id || "none") end,
|
||||
["export-warns"] = function() hook.Run("GmodIntegration:ExportWarns") end
|
||||
}
|
||||
|
||||
local function cmdExecuted(ply, cmd, args)
|
||||
if ply:IsPlayer() && !ply:gmIntIsAdmin() then return end
|
||||
if conFuncs[args[1]] then
|
||||
conFuncs[args[1]](args)
|
||||
else
|
||||
gmInte.log("Unknown Command Argument")
|
||||
end
|
||||
end
|
||||
|
||||
concommand.Add("gmi", cmdExecuted)
|
||||
concommand.Add("gmod-integration", cmdExecjsonuted)
|
|
@ -1,46 +0,0 @@
|
|||
util.AddNetworkString("gmIntegration")
|
||||
local netSend = {
|
||||
["wsRelayDiscordChat"] = 1,
|
||||
["adminConfig"] = 2,
|
||||
["testApiConnection"] = 3,
|
||||
["publicConfig"] = 5,
|
||||
["chatColorMessage"] = 6,
|
||||
["openVerifPopup"] = 7,
|
||||
["savePlayerToken"] = 8
|
||||
}
|
||||
|
||||
// Send
|
||||
function gmInte.SendNet(id, data, ply, func)
|
||||
if !netSend[id] then return end
|
||||
net.Start("gmIntegration")
|
||||
net.WriteUInt(netSend[id], 8)
|
||||
net.WriteString(util.TableToJSON(data || {}))
|
||||
if func then func() end
|
||||
if ply == nil then
|
||||
net.Broadcast()
|
||||
else
|
||||
net.Send(ply)
|
||||
end
|
||||
end
|
||||
|
||||
local netReceive = {
|
||||
[0] = function(ply) hook.Run("gmInte:PlayerReady", ply) end,
|
||||
[1] = function(ply, data) gmInte.testConnection(ply, data) end,
|
||||
[2] = function(ply) gmInte.superadminGetConfig(ply) end,
|
||||
[3] = function(ply, data) gmInte.superadminSetConfig(ply, data) end,
|
||||
[4] = function(ply) gmInte.takeScreenshot(ply) end,
|
||||
[5] = function(ply)
|
||||
if !ply:gmIntIsAdmin() then return end
|
||||
RunConsoleCommand("changelevel", game.GetMap())
|
||||
end,
|
||||
[6] = function(ply) gmInte.verifyPlayer(ply) end,
|
||||
[7] = function(ply, data) gmInte.sendPlayerToken(ply) end
|
||||
}
|
||||
|
||||
net.Receive("gmIntegration", function(len, ply)
|
||||
if !ply || ply && !ply:IsValid() then return end
|
||||
local id = net.ReadUInt(8)
|
||||
local data = util.JSONToTable(net.ReadString() || "{}")
|
||||
if !netReceive[id] then return end
|
||||
netReceive[id](ply, data)
|
||||
end)
|
|
@ -1,44 +0,0 @@
|
|||
function gmInte.verifyPlayer(ply)
|
||||
if !ply:IsValid() || !ply:IsPlayer(ply) then return end
|
||||
gmInte.http.get("/users?steamID64=" .. ply:SteamID64(), function(code, data)
|
||||
if data && data.discordID then ply.gmIntVerified = true end
|
||||
if !gmInte.config.forcePlayerLink || !ply.gmIntIsReady then return end
|
||||
if ply:gmIntIsVerified() then
|
||||
gmInte.SendNet("chatColorMessage", {
|
||||
[1] = {
|
||||
["text"] = gmInte.getTranslation("verification.success", "You have been verified"),
|
||||
["color"] = Color(255, 255, 255)
|
||||
}
|
||||
}, ply)
|
||||
|
||||
ply:Freeze(false)
|
||||
else
|
||||
gmInte.SendNet("chatColorMessage", {
|
||||
[1] = {
|
||||
["text"] = gmInte.getTranslation("verification.fail", "Failed to verify you"),
|
||||
["color"] = Color(255, 0, 0)
|
||||
}
|
||||
}, ply)
|
||||
|
||||
ply:Freeze(true)
|
||||
gmInte.SendNet("openVerifPopup", nil, ply)
|
||||
end
|
||||
end, function(code, data)
|
||||
ply:Freeze(true)
|
||||
gmInte.SendNet("chatColorMessage", {
|
||||
[1] = {
|
||||
["text"] = gmInte.getTranslation("verification.link_require", "This server requires you to link your Discord account to play"),
|
||||
["color"] = Color(255, 0, 0)
|
||||
}
|
||||
}, ply)
|
||||
|
||||
gmInte.SendNet("openVerifPopup", nil, ply)
|
||||
end)
|
||||
end
|
||||
|
||||
hook.Add("gmInte:PlayerReady", "gmInte:Verif:PlayerReady", function(ply)
|
||||
ply.gmIntIsReady = true
|
||||
if !gmInte.config.forcePlayerLink then return end
|
||||
ply:Freeze(true)
|
||||
gmInte.verifyPlayer(ply)
|
||||
end)
|
|
@ -1,88 +0,0 @@
|
|||
return {
|
||||
["verification.title"] = "Verificatie Vereist",
|
||||
["verification.open_page"] = "Open Verificatie Pagina",
|
||||
["verification.description"] = "Hey,\nHet lijkt erop dat je je Steam-account nog niet hebt gekoppeld aan Discord. Dit is vereist om op deze server te spelen. Klik op de onderstaande knop om je account te koppelen.\n\nNadat je dat hebt gedaan, klik je op de vernieuwingsknop.",
|
||||
["verification.refresh"] = "Vernieuw Verificatie",
|
||||
["verification.success"] = "Je bent geverifieerd",
|
||||
["verification.fail"] = "Verificatie mislukt",
|
||||
["verification.link_require"] = "Deze server vereist dat je je Discord-account koppelt om te spelen",
|
||||
["admin.restart_required"] = "Herstart Vereist",
|
||||
["admin.restart_required_description"] = "Sommige wijzigingen vereisen een herstart om toegepast te worden.\nNu herstarten?",
|
||||
["admin.restart"] = "Herstart",
|
||||
["admin.maybe_later"] = "Misschien Later",
|
||||
["admin.authentication"] = "Authenticatie",
|
||||
["admin.main"] = "Hoofd",
|
||||
["admin.trust_safety"] = "Vertrouwen & Veiligheid",
|
||||
["admin.advanced"] = "Geavanceerd",
|
||||
["admin.server_id"] = "Server ID",
|
||||
["admin.server_id_description"] = "Server ID gevonden op het webpaneel.",
|
||||
["admin.link.open_webpanel"] = "Open Webpaneel",
|
||||
["admin.link.test_connection"] = "Test Verbinding",
|
||||
["admin.link.buy_premium"] = "Koop Premium",
|
||||
["admin.link.install_websocket"] = "Installeer Websocket",
|
||||
["admin.websocket_required"] = "\n\nDeze functie vereist een websocket-verbinding om correct te werken.",
|
||||
["admin.feature_soon"] = "\n\nDeze functie zal binnenkort beschikbaar zijn.",
|
||||
["admin.enabled"] = "Ingeschakeld",
|
||||
["admin.disabled"] = "Uitgeschakeld",
|
||||
["admin.click_to_show"] = "*** Klik om te tonen ***",
|
||||
["admin.server_id_description2"] = "Hier kun je je serverinstellingen configureren.\nServer ID en Token zijn beschikbaar op het webpaneel in de serverinstellingen.\nDe documentatie is beschikbaar op {1}\nAls je hulp nodig hebt, neem dan contact met ons op via onze discord-server.",
|
||||
["admin.server_config"] = "Server Configuratie",
|
||||
["admin.server_token"] = "Server Token",
|
||||
["admin.server_token_description"] = "Server Token gevonden op het webpaneel.",
|
||||
["admin.filter_on_ban"] = "Blokkeer Discord Verbannen Speler",
|
||||
["admin.filter_on_ban_description"] = "Blokkeer spelers die verbannen zijn op de Discord-server.",
|
||||
["admin.force_player_link"] = "Forceer Speler Verificatie",
|
||||
["admin.force_player_link_description"] = "Forceer speler verificatie.",
|
||||
["admin.language"] = "Taal",
|
||||
["admin.language_description"] = "Taal die wordt gebruikt in de interface.",
|
||||
["admin.maintenance"] = "Onderhoud",
|
||||
["admin.maintenance_description"] = "Activeer of deactiveer de onderhoudsmodus.",
|
||||
["admin.api_fqdn"] = "API FQDN",
|
||||
["admin.api_fqdn_description"] = "API FQDN die zal worden gebruikt voor de API-verbinding.",
|
||||
["admin.websocket_fqdn"] = "Websocket FQDN",
|
||||
["admin.websocket_fqdn_description"] = "Websocket FQDN die zal worden gebruikt voor de Websocket-verbinding.",
|
||||
["admin.debug"] = "Debug",
|
||||
["admin.debug_description"] = "Activeer of deactiveer de debugmodus.",
|
||||
["context_menu.screen_capture"] = "Sluit het contextmenu om de screenshot te maken die naar Discord wordt verzonden.",
|
||||
["report_bug.title"] = "Rapporteer een bug",
|
||||
["report_bug.description"] = "Rapporteer een bug aan de ontwikkelaars van dit spel.",
|
||||
["report_bug.submit"] = "Verzend Bug Rapport",
|
||||
["report_bug.cancel"] = "Annuleren",
|
||||
["report_bug.screenshot"] = "Screenshot",
|
||||
["report_bug.description"] = "Beschrijving",
|
||||
["report_bug.importance_level"] = "Belangrijkheidsniveau",
|
||||
["report_bug.importance_level.dsc"] = "Hoe belangrijk is deze bug?",
|
||||
["report_bug.importance_level.critical"] = "Kritiek - Crash of maakt het spel onspeelbaar.",
|
||||
["report_bug.importance_level.high"] = "Hoog - Kritieke functionaliteit is onbruikbaar.",
|
||||
["report_bug.importance_level.medium"] = "Gemiddeld - Belangrijke functionaliteit is onbruikbaar.",
|
||||
["report_bug.importance_level.low"] = "Laag - Cosmetisch probleem.",
|
||||
["report_bug.importance_level.trivial"] = "Triviaal - Zeer klein probleem.",
|
||||
["report_bug.steps_to_reproduce"] = "Stappen om te reproduceren",
|
||||
["report_bug.expected_result"] = "Verwacht resultaat",
|
||||
["report_bug.actual_result"] = "Werkelijk resultaat",
|
||||
["report_bug.actual_result.dsc"] = "Wat is er werkelijk gebeurd?",
|
||||
["report_bug.expected_result.dsc"] = "Wat verwachtte je dat er zou gebeuren?",
|
||||
["report_bug.steps_to_reproduce.dsc"] = "Geef alsjeblieft een stapsgewijze handleiding over hoe je de bug kunt reproduceren.",
|
||||
["report_bug.description.dsc"] = "Geef alsjeblieft zoveel mogelijk informatie om ons te helpen het probleem op te lossen.",
|
||||
["report_bug.error.missing_fields"] = "Vul alle verplichte velden in voordat je het bugrapport indient.",
|
||||
["report_bug.success"] = "Bugrapport succesvol verzonden",
|
||||
["report_bug.error.failed"] = "Het verzenden van het bugrapport is mislukt, probeer het later opnieuw.",
|
||||
["chat.missing_permissions"] = "Je hebt geen toestemming om deze actie uit te voeren.",
|
||||
["chat.authentication_success"] = "Succesvol geauthenticeerd",
|
||||
["chat.authentication_failed"] = "Authenticatie mislukt",
|
||||
["chat.server_link"] = ", server gekoppeld als {1}.",
|
||||
["chat.server_fail"] = ", controleer je ID en Token.",
|
||||
["chat.error.screenshot_failed"] = "Het maken van een screenshot is mislukt, je systeem ondersteunt deze functie mogelijk niet.",
|
||||
["chat.screenshot.sent"] = "Screenshot verzonden naar Discord.",
|
||||
["report_bug.description.full"] = "Hey, je staat op het punt een bug te rapporteren aan de eigenaren van deze server.\nGeef alsjeblieft zoveel mogelijk informatie om ons te helpen het probleem op te lossen.\nBedankt dat je ons helpt de server te verbeteren.\n\nAls je een probleem hebt met Gmod Integration, gebruik dan onze discord-server.",
|
||||
["report_bug.context_menu.screen_capture"] = "Sluit het contextmenu om de screenshot te maken die je wilt gebruiken in het bugrapport.",
|
||||
["filter.ds.1"] = "Je kunt niet op deze server komen",
|
||||
["filter.ds.2"] = "Reden: {1}",
|
||||
["filter.none"] = "geen",
|
||||
["filter.ds.3"] = "Help URL: {1}",
|
||||
["filter.ds.4"] = "Een fijne dag verder",
|
||||
["filter.ds.5"] = "Service geleverd door Gmod Integration",
|
||||
["filter.maintenance"] = "De server is momenteel in onderhoud en je staat niet op de whitelist.",
|
||||
["filter.ban"] = "Je bent verbannen van deze server.",
|
||||
["filter.discord_ban"] = "Je bent verbannen van onze Discord-server.",
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
function gmInte.log(msg, debug)
|
||||
if debug && !gmInte.config.debug then return end
|
||||
print("[" .. os.date("%Y-%m-%d %H:%M:%S") .. "] [Gmod Integration] " .. msg)
|
||||
end
|
||||
|
||||
// Log Error
|
||||
function gmInte.logError(msg, debug)
|
||||
if debug && !gmInte.config.debug then return end
|
||||
print("[" .. os.date("%Y-%m-%d %H:%M:%S") .. "] [Gmod Integration] [ERROR] " .. msg)
|
||||
end
|
||||
|
||||
// Log Warning
|
||||
function gmInte.logWarning(msg, debug)
|
||||
if debug && !gmInte.config.debug then return end
|
||||
print("[" .. os.date("%Y-%m-%d %H:%M:%S") .. "] [Gmod Integration] [WARNING] " .. msg)
|
||||
end
|
||||
|
||||
// Log Hint
|
||||
function gmInte.logHint(msg, debug)
|
||||
if debug && !gmInte.config.debug then return end
|
||||
print("[" .. os.date("%Y-%m-%d %H:%M:%S") .. "] [Gmod Integration] [HINT] " .. msg)
|
||||
end
|
||||
|
||||
// Is Private IP
|
||||
function gmInte.isPrivateIP(ip)
|
||||
// detect localhost
|
||||
if ip == "localhost" then return true end
|
||||
// detect private IP addresses (RFC 1918)
|
||||
local parts = string.Explode(".", ip)
|
||||
if parts[1] == "192" && parts[2] == "168" then return true end
|
||||
if parts[1] == "10" then return true end
|
||||
if parts[1] == "172" && tonumber(parts[2]) >= 16 && tonumber(parts[2]) <= 31 then return true end
|
||||
if parts[1] == "127" then return true end
|
||||
return false
|
||||
end
|
|
@ -1,67 +0,0 @@
|
|||
local ply = FindMetaTable("Player")
|
||||
function ply:gmIntGetConnectTime()
|
||||
return self.gmIntTimeConnect || 0
|
||||
end
|
||||
|
||||
function ply:gmIntIsVerified()
|
||||
return self.gmIntVerified || false
|
||||
end
|
||||
|
||||
function ply:gmIntSetCustomValue(key, value)
|
||||
self.gmIntCustomValues = self.gmIntCustomValues || {}
|
||||
self.gmIntCustomValues[key] = value
|
||||
end
|
||||
|
||||
function ply:gmIntIsAdmin()
|
||||
return gmInte.config.adminRank[self:GetUserGroup()] || false
|
||||
end
|
||||
|
||||
function ply:gmIntGetCustomValue(key)
|
||||
return self.gmIntCustomValues && self.gmIntCustomValues[key]
|
||||
end
|
||||
|
||||
function ply:gmIntRemoveCustomValue(key)
|
||||
if self.gmIntCustomValues then self.gmIntCustomValues[key] = nil end
|
||||
end
|
||||
|
||||
local function getCustomCompatability(ply)
|
||||
local values = {}
|
||||
// DarkRP
|
||||
if DarkRP then
|
||||
values.money = ply:getDarkRPVar("money")
|
||||
values.job = ply:getDarkRPVar("job")
|
||||
end
|
||||
|
||||
// GUI Level System
|
||||
if GUILevelSystem then
|
||||
values.level = ply:GetLevel()
|
||||
values.xp = ply:GetXP()
|
||||
end
|
||||
|
||||
// Pointshop 2
|
||||
if Pointshop2 && ply.PS2_Wallet then
|
||||
values.ps2Points = ply.PS2_Wallet.points
|
||||
values.ps2PremiumPoints = ply.PS2_Wallet.premiumPoints
|
||||
end
|
||||
return values
|
||||
end
|
||||
|
||||
local function getCustomValues(ply)
|
||||
local values = {}
|
||||
// Get compatability values
|
||||
for key, value in pairs(getCustomCompatability(ply)) do
|
||||
values[key] = value
|
||||
end
|
||||
|
||||
// Get custom values or overwrite compatability values
|
||||
if ply.gmIntCustomValues then
|
||||
for key, value in pairs(ply.gmIntCustomValues) do
|
||||
values[key] = value
|
||||
end
|
||||
end
|
||||
return values
|
||||
end
|
||||
|
||||
function ply:gmIntGetCustomValues()
|
||||
return getCustomValues(self)
|
||||
end
|
|
@ -28,11 +28,19 @@ gmInte.config.filterOnBan = true // If true, the addon will filter the players a
|
|||
gmInte.config.redownloadMaterials = false // If true, the addon will redownload the materials of the addon (useful if you have a problem with the materials)
|
||||
// Debug & Development
|
||||
gmInte.config.debug = false // If true, the addon will show debug informations in the console
|
||||
// Other
|
||||
// Security
|
||||
gmInte.config.forcePlayerLink = false // If true, the addon will force the players to link their discord account to their steam account before playing
|
||||
gmInte.config.verifyOnJoin = false // If true, the addon will verify the players when they join the server or on player ready
|
||||
gmInte.config.verifyOnReadyKickTime = 600 // The time in seconds before kicking a player that is not verified (0 to disable)
|
||||
gmInte.config.verifyFamilySharing = false // If true, the addon will verify the family sharing of the players
|
||||
gmInte.config.clientBranch = "any" // The branch of the addon that the clients should use (none, dev, prerelease, x86-64)
|
||||
// Other
|
||||
gmInte.config.supportLink = "" // The link of your support (shown when a player do not have the requiments to join the server)
|
||||
gmInte.config.maintenance = false // If true, the addon will only allow the players with the "gmod-integration.maintenance" permission to join the server
|
||||
gmInte.config.language = "en" // The language of the addon (en, fr, de, es, it, tr, ru)
|
||||
gmInte.config.adminRank = { // How can edit the configuration of the addon / bypass the maintenance mode
|
||||
gmInte.config.logTimestamp = "%H:%M:%S" // The timestamp format of the logs
|
||||
gmInte.config.dllBranch = "main" // The download branch of gmod integration via dll (Use at your own risk, this is not recommended for production servers)
|
||||
gmInte.config.adminRank = {
|
||||
// How can edit the configuration of the addon / bypass the maintenance mode
|
||||
["superadmin"] = true,
|
||||
}
|
Loading…
Reference in New Issue
Block a user