Brazil's biggest MU Online portal — since 2003
Tutorial Advanced Tutoriais

How to Configure a Dedicated PvP Subserver on MU Server

Learn to create and configure an isolated PvP subserver on MuServer S6, with restricted maps, kill rules, and custom SQL rewards.

VI ViciadosMU Team · Updated on 3 jul 2026 · ⏱ 12 min read

A dedicated PvP subserver lets you isolate player-versus-player combat to specific maps, enforce custom kill rules, and offer exclusive rewards without affecting the main server's economy or gameplay flow. This guide covers the full setup for MuServer Season 6 Episode 3; the same concepts apply to other seasons with path adjustments.

Prerequisites

Before starting, make sure you have:

  • A working MuServer S6 EP3 installation with GameServer, ConnectServer, and DataServer running
  • SQL Server Management Studio (SSMS) access with DBO permissions on the MuOnline database
  • Two TCP ports available in your firewall: one for the subserver (e.g., 55902) and one for connect routing (e.g., 44405)
  • A full copy of the GameServer/ folder to use as the subserver base

Step 1 — Create the Second GameServer Instance

The PvP subserver is a separate GameServer instance pointing to the same SQL database but using its own configuration.

1.1 Copy the main GameServer folder and rename it:

C:\MuServer\GameServer\        ← main instance (ServerCode 1)
C:\MuServer\GameServer_PvP\    ← new PvP instance (ServerCode 2)

1.2 Open GameServer_PvP\GameServer.ini and adjust the required parameters:

[GameServerInfo]
ServerCode        = 2
ServerName        = PvP Arena
ConnectServerIP   = 127.0.0.1
ConnectServerPort = 44405
GameServerPort    = 55902
MaxUserCount      = 500
Atenção: The ServerCode must be unique across your entire infrastructure. Never reuse the same code as the main server (usually 1). A ServerCode conflict causes character desynchronization and position corruption on the map.

1.3 Still in GameServer_PvP\GameServer.ini, configure the database connection string:

[DBInfo]
DBServer   = 127.0.0.1
DBName     = MuOnline
DBUser     = sa
DBPassword = yourPasswordHere
DBPort     = 1433

Step 2 — Define the Exclusive PvP Subserver Maps

The PvP subserver should only serve the maps designated for PvP combat. Maps not assigned to it must redirect the client back to the main server.

2.1 Run the following in SSMS to register the PvP subserver maps:

USE MuOnline;

-- Remove any existing entries for ServerCode 2
DELETE FROM T_MapServerInfo WHERE ServerCode = 2;

-- Assign maps to the PvP subserver (ServerCode 2)
-- Map 2 = Devias (free PvP), Map 33 = Arena, Map 52 = custom PvP map
INSERT INTO T_MapServerInfo (MapNumber, ServerCode, MoveServerCode)
VALUES
  (2,  2, 1),
  (33, 2, 1),
  (52, 2, 1);
Nota: The MoveServerCode field tells the server where to send the player when they leave the PvP map. Using 1 ensures automatic return to the main server.

2.2 In GameServer_PvP\Data\MapServerInfo.txt, mirror the same configuration for releases that load from a file instead of the SQL table:

// MapNumber  ServerCode  MoveServerCode
2             2           1
33            2           1
52            2           1

Step 3 — Configure PvP Rules on the Subserver

3.1 Open GameServer_PvP\Data\Common\GameServerSetting.xml (or GameServerSetting.ini for older releases) and configure:

<PvPSetting>
  <PkLevel enable="1" />
  <PkClear enable="0" />
  <HeroKillPenalty enable="0" />
  <FreeForAll enable="1" />
  <GuildFriendlyFire enable="1" />
  <MinLevelToEnter value="200" />
  <MaxKillStreak value="0" />
</PvPSetting>

Key parameters:

  • FreeForAll = 1 — any player can attack any other without guild or party restrictions
  • HeroKillPenalty = 0 — disables PK (Outlawer) penalty on the subserver
  • PkClear = 0 — PK counter does not reset on death, enabling a persistent kill ranking
  • MinLevelToEnter = 200 — minimum level gate to enter PvP maps

3.2 To prevent item drops on the ground when dying in PvP (standard for pure PvP servers), edit:

[PvPDrop]
DropOnDeath  = 0
DropJewels   = 0
DropExcItems = 0

Step 4 — Configure ConnectServer to Route the Subserver

The ConnectServer must know about both instances to direct clients to the correct one.

4.1 Open ConnectServer\ConnectServer.ini and add the PvP subserver entry:

[ServerList]
ServerCount = 2

[Server0]
ServerCode = 1
ServerIP   = 127.0.0.1
ServerPort = 55901
ServerName = Main

[Server1]
ServerCode = 2
ServerIP   = 127.0.0.1
ServerPort = 55902
ServerName = PvP Arena

4.2 Restart the ConnectServer after saving. In DataServer, verify that ServerList includes ServerCode 2 so characters are correctly synchronized across both instances.

Step 5 — Kill Count and PvP Ranking System via SQL

A PvP subserver without a competitive ranking loses most of its appeal. Set up a dedicated scoring table.

5.1 Create the PvP statistics table:

USE MuOnline;

CREATE TABLE PvP_KillStats (
    memb_guid     INT           NOT NULL,
    char_name     VARCHAR(10)   NOT NULL,
    pvp_kills     INT           NOT NULL DEFAULT 0,
    pvp_deaths    INT           NOT NULL DEFAULT 0,
    pvp_score     INT           NOT NULL DEFAULT 0,
    pvp_streak    INT           NOT NULL DEFAULT 0,
    last_kill_dt  DATETIME      NULL,
    CONSTRAINT PK_PvP_KillStats PRIMARY KEY (memb_guid)
);

5.2 Create the stored procedure that logs each PvP kill:

CREATE PROCEDURE uspRegisterPvPKill
    @KillerName  VARCHAR(10),
    @VictimName  VARCHAR(10)
AS
BEGIN
    SET NOCOUNT ON;

    DECLARE @KillerGUID INT, @VictimGUID INT;

    SELECT @KillerGUID = AccountID FROM Character WHERE Name = @KillerName;
    SELECT @VictimGUID = AccountID FROM Character WHERE Name = @VictimName;

    -- Ensure a record exists for the killer
    IF NOT EXISTS (SELECT 1 FROM PvP_KillStats WHERE memb_guid = @KillerGUID)
        INSERT INTO PvP_KillStats (memb_guid, char_name) VALUES (@KillerGUID, @KillerName);

    -- Ensure a record exists for the victim
    IF NOT EXISTS (SELECT 1 FROM PvP_KillStats WHERE memb_guid = @VictimGUID)
        INSERT INTO PvP_KillStats (memb_guid, char_name) VALUES (@VictimGUID, @VictimName);

    -- Update killer's stats
    UPDATE PvP_KillStats
    SET pvp_kills   = pvp_kills + 1,
        pvp_score   = pvp_score + 10,
        pvp_streak  = pvp_streak + 1,
        last_kill_dt = GETDATE()
    WHERE memb_guid = @KillerGUID;

    -- Update victim's deaths and reset streak
    UPDATE PvP_KillStats
    SET pvp_deaths = pvp_deaths + 1,
        pvp_streak = 0
    WHERE memb_guid = @VictimGUID;
END;

5.3 Query to display the PvP ranking on your website or admin panel:

SELECT TOP 20
    char_name      AS 'Character',
    pvp_kills      AS 'Kills',
    pvp_deaths     AS 'Deaths',
    pvp_score      AS 'Score',
    pvp_streak     AS 'Current Streak',
    CASE WHEN pvp_deaths = 0 THEN pvp_kills
         ELSE pvp_kills / pvp_deaths
    END            AS 'KD Ratio'
FROM PvP_KillStats
ORDER BY pvp_score DESC;

Step 6 — Configure Kill Rewards

6.1 To automatically reward the player with Zen on each kill, add to the body of uspRegisterPvPKill:

-- Add inside the procedure after updating kills:
UPDATE Character
SET Money = Money + 5000000
WHERE Name = @KillerName AND Money <= 2000000000;

6.2 To award a specific item as a reward (e.g., Jewel of Bless = Item 14, Index 13):

-- Insert item into the winner's bag using the native MuServer stored procedure
EXEC WZ_ADD_ITEM @Name = @KillerName, @MapNumber = 0, @ItemType = 14,
                 @ItemIndex = 13, @ItemLevel = 0, @Durability = 1,
                 @Option1 = 0, @Option2 = 0, @Option3 = 0;
Dica: Add a cooldown to rewards to prevent abuse farming. Add a column last_reward_dt DATETIME to PvP_KillStats and validate that at least 5 minutes have passed since the last kill against the same victim before granting the prize.

Step 7 — Start and Test the Subserver

7.1 Create a .bat file to start the PvP subserver independently:

@echo off
cd /d C:\MuServer\GameServer_PvP\
start "" "GameServer.exe"
echo PvP Subserver started on port 55902

7.2 Correct startup sequence:

1. SQL Server → 2. DataServer → 3. ConnectServer → 4. GameServer (main) → 5. GameServer_PvP

7.3 Check GameServer_PvP\Log\GameServer.log and confirm:

[INFO] Server Code: 2 initialized successfully
[INFO] Map 2 (Devias) loaded for ServerCode 2
[INFO] Map 33 (Arena) loaded for ServerCode 2
[INFO] GameServer listening on port 55902
Atenção: If the log shows ServerCode conflict detected, another process is already using ServerCode 2. Check for duplicate running instances with tasklist | findstr GameServer in Command Prompt.

Troubleshooting Common Issues

Players cannot connect to the PvP subserver: Verify that the firewall allows port 55902 for both inbound and outbound TCP. On Windows Server, run:

netsh advfirewall firewall add rule name="MuServer PvP" protocol=TCP dir=in localport=55902 action=allow

Character disconnects when warping to a PvP map: Confirm that T_MapServerInfo contains the correct MapNumber with ServerCode 2. Use SELECT * FROM T_MapServerInfo WHERE MapNumber IN (2,33,52) to validate the entries.

Kill is not registered in PvP_KillStats: Enable stored procedure call logging in GameServer and confirm that uspRegisterPvPKill is being called. If your release uses custom event hooks, the call may need to be added manually in Source\GameServer\GameServer.cpp inside the PvP death handler function, requiring a recompile.

Nota: Servers with high PvP volume (above 200 kills per hour) should consider a SQL Agent Job to archive old PvP_KillStats records and keep the table lean, preventing ranking query performance degradation over time.

Perguntas frequentes

Do I need a separate VPS to run the PvP subserver?

No. The PvP subserver can run on the same machine as a second GameServer instance pointing to the same SQL database. Just use different ports (e.g., main GameServer on 55901, PvP subserver on 55902) and configure the ConnectServer to route clients accordingly.

How do I prevent players on the PvP subserver from warping to main server maps?

Configure the T_MapServerInfo table in the database, setting the correct ServerCode for each map. PvP subserver maps must have a unique ServerCode (e.g., 2) that does not match the main server (ServerCode 1). This prevents cross-instance warping.

Can the PvP subserver kill count be tracked separately from the main server?

Yes. Add extra columns to the MEMB_STAT table, or create a dedicated table such as PvP_KillStats with columns memb_guid, pvp_kills, pvp_deaths, pvp_score. The count is managed via a stored procedure triggered by the GameServer when recording each kill.

How do I configure exclusive item drops for PvP kills?

In GameServer/Data/Items/PvPRewards.txt (or the equivalent file in your release), map the desired item codes with their drop rates. Alternatively, use the stored procedure uspAddItemToBag to insert the item directly into the winner's inventory via a SQL trigger fired when a kill is registered.

VI

ViciadosMU Team

Equipe editorial do ViciadosMU — portal de MU Online no ar desde 2003.

Keep reading

Related articles