Jump to content

[TUTORIAL] Make Your Own Server Hive - Use 1 Database for multiple servers


Gr8

Recommended Posts

Make Your Own Server Hive

Make all your servers run on one database. Sync Character(gear, location) and banks(if using SC) across all servers. Even with different maps

 

Requirements:

  • Working Epoch Server Database
  • Access to your Database and HiveExt.cfg
  • Database Manager (HiediSQL)
  • Common Sense
  • Time

 

In this tutorial we will be combining only 2 servers together, you may add any more server if you like. We will be working with

Server 1 - Chernarus

and

Server 2 - Taviana

 

Configuring your Database

 

Please backup your database prior to applying any of the changes below

 

Using hiediSQL or a similar program to execute these Statements to your database you will be working with

-- adding new tables to your Database ~ [GG] Gr8

CREATE TABLE IF NOT EXISTS `object_data_1` (
    `ObjectID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `ObjectUID` BIGINT(24) NOT NULL DEFAULT '0',
    `Instance` INT(11) UNSIGNED NOT NULL,
    `Classname` VARCHAR(50) NULL DEFAULT NULL,
    `Datestamp` DATETIME NOT NULL,
    `LastUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `CharacterID` INT(11) UNSIGNED NOT NULL DEFAULT '0',
    `Worldspace` VARCHAR(128) NOT NULL DEFAULT '[]',
    `Inventory` LONGTEXT NULL,
    `Hitpoints` VARCHAR(512) NOT NULL DEFAULT '[]',
    `Fuel` DOUBLE(13,5) NOT NULL DEFAULT '1.00000',
    `Damage` DOUBLE(13,5) NOT NULL DEFAULT '0.00000',
    PRIMARY KEY (`ObjectID`),
    INDEX `ObjectUID` (`ObjectUID`) USING BTREE,
    INDEX `Instance` (`Instance`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=74383;

CREATE TABLE IF NOT EXISTS `object_data_2` (
    `ObjectID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `ObjectUID` BIGINT(24) NOT NULL DEFAULT '0',
    `Instance` INT(11) UNSIGNED NOT NULL,
    `Classname` VARCHAR(50) NULL DEFAULT NULL,
    `Datestamp` DATETIME NOT NULL,
    `LastUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `CharacterID` INT(11) UNSIGNED NOT NULL DEFAULT '0',
    `Worldspace` VARCHAR(128) NOT NULL DEFAULT '[]',
    `Inventory` LONGTEXT NULL,
    `Hitpoints` VARCHAR(512) NOT NULL DEFAULT '[]',
    `Fuel` DOUBLE(13,5) NOT NULL DEFAULT '1.00000',
    `Damage` DOUBLE(13,5) NOT NULL DEFAULT '0.00000',
    PRIMARY KEY (`ObjectID`),
    INDEX `ObjectUID` (`ObjectUID`) USING BTREE,
    INDEX `Instance` (`Instance`) USING BTREE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=74383;

This will add 2 Extra tables to your database named object_data_1 & object_data_2. These will be used to the 2 servers the objects (bases and vehicles) will read and write from. We want to keep the objects independent for each server to prevent conflicts.

 

Now Execute this script

ALTER TABLE character_data ADD Worldspace1 VARCHAR(128) NOT NULL DEFAULT '[]' AFTER Inventory;
ALTER TABLE character_data ADD Worldspace2 VARCHAR(128) NOT NULL DEFAULT '[]' AFTER Worldspace1;

This will make 2 different worldspace fields for our 2 servers, since they are different maps, we want to keep the positions seperate from other server. But the overall character and gear will Sync on both servers.

 

 

Configuring your HiveExt.cfg

 

Now to the easy part. Grab your HiveExt.cfg from both of the servers and open them.

 

Find:

;Enables you to run multiple different maps (different instances) off the same character table
;WSField = Worldspace

;If using OFFICIAL hive, the settings in this section have no effect, as it will clean up by itself
[Objects]
;Which table should the objects be stored and fetched from ?
;Table = Object_DATA

For Server 1

Replace to:

;Enables you to run multiple different maps (different instances) off the same character table
WSField = Worldspace1

;If using OFFICIAL hive, the settings in this section have no effect, as it will clean up by itself
[Objects]
;Which table should the objects be stored and fetched from ?
Table = Object_DATA_1

For Server 2

Replace to:

;Enables you to run multiple different maps (different instances) off the same character table
WSField = Worldspace2

;If using OFFICIAL hive, the settings in this section have no effect, as it will clean up by itself
[Objects]
;Which table should the objects be stored and fetched from ?
Table = Object_DATA_2

Make sure both servers are running on same database.

 

Thats it, for a basic 2 server Hive.

 

 

Link to comment
Share on other sites

You can add as many servers to a database as you want, make however many tables you want.

 

If you want to hive 4 servers together, have these 4 Tables in your database with appropriate columns

  1. Object_DATA_1
  2. Object_DATA_2
  3. Object_DATA_3
  4. Object_DATA_4

and have all four Worldspace rows in your character_data. If you run 2 server with the same map then you dont have to make different wordspace rows for them if you want to.

Link to comment
Share on other sites

  • 7 months later...

[GG] Ghostz Gamerz, hello. Excuse, I badly understand English. You where in a database to enter these values could not tell? I have entered them into consoles, and occurs nothing. Can help a little with it and explain more in detail? Yours faithfully, Boris.

Link to comment
Share on other sites

  • 1 year later...
  • 8 months later...
  • 4 years later...
在 2014 年 12 月 6 日上午 8 点 23 分,Gr8 说:
在 2014 年 12 月 6 日上午 8 点 23 分,Gr8 说:

HiveExt.cfg

这个 hiveext CFG 是从哪里来的?能告诉我如何安装和你找到它吗?谢谢

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...