如何在AzerothCore WotLK 3.3.5a搭建仅GM/管理员可访问的开发服
Got it, let's break down how to set up your development worldserver to connect to your production authserver, and lock it down so only accounts with security level >1 (admins or senior GMs) can access it. I'll cover both auth-level restriction (the cleanest approach) and a worldserver-level fallback for extra safety.
Step 1: Configure Dev WorldServer to Connect to Production AuthServer
First, make sure your dev worldserver can talk to your production auth system properly:
- Open your dev worldserver's
worldserver.conffile - Update the
LoginDatabaseInfoline to point to your production auth database:
Replace the placeholders with your actual production database details (IP, username, password, etc.).LoginDatabaseInfo = "PRODUCTION_AUTH_DB_IP;3306;DB_USERNAME;DB_PASSWORD;acore_auth" - Verify
AuthServerPortmatches theRealmServerPortin your productionauthserver.conf(the default is 3724) - Add your dev worldserver to the production auth's
realmlisttable:- Run this SQL query on your production
acore_authdatabase:
TheINSERT INTO realmlist (name, address, port, icon, realmflags, timezone, allowedSecurityLevel) VALUES ('Dev World Server', 'YOUR_DEV_WORLDSERVER_IP', 8085, 1, 0, 1, 2);allowedSecurityLevelfield here will be critical for our access restriction later.
- Run this SQL query on your production
- Restart both your production authserver and dev worldserver to apply these changes.
Step 2: Restrict Access to Accounts with Security Level >1
AzerothCore uses clear security level tiers for accounts:
0: Regular player1: Basic GM2: Administrator3: Highest-level admin
Option 1: AuthServer-Level Restriction (Recommended)
This method hides the dev realm entirely from unauthorized users, which is the cleanest approach:
- On your production auth database, update the
allowedSecurityLevelvalue for your dev realm in therealmlisttable:
This sets the minimum required security level to 2, meaning only accounts with level >1 (2 or 3) can see and connect to the dev realm.UPDATE realmlist SET allowedSecurityLevel = 2 WHERE name = 'Dev World Server'; - Restart your production authserver to make the change take effect.
Option 2: WorldServer-Level Fallback (Extra Safety)
If you want an extra layer of protection (e.g., if auth restrictions ever fail), add a check in the worldserver code to kick unauthorized users immediately on login:
- Open
src/server/game/Player/Player.cppin your AzerothCore dev repository - Find the
Player::Loginfunction, and add this code right after the session security level is retrieved:// Block accounts with security level <=1 (regular players + basic GMs) AccountTypes accountSecLevel = GetSession()->GetSecurity(); if (accountSecLevel <= SEC_GM) { GetSession()->KickPlayer(); return false; } - Recompile your dev worldserver and restart it. Now any user with security level 0 or 1 will be kicked instantly if they somehow manage to connect.
Important Notes
- Make sure your production MySQL server allows incoming connections from your dev worldserver's IP (grant access with
GRANT ALL ON acore_auth.* TO 'DB_USER'@'DEV_WORLDSERVER_IP' IDENTIFIED BY 'DB_PASS';) - If your dev and production servers are on separate networks, ensure ports 3724 (auth-world communication) and 8085 (player-world communication) are open in firewalls
- For code modifications, consider creating a custom module instead of editing core files directly—this makes future core updates much easier
内容的提问来源于stack exchange,提问作者Squeezee




