Skip to content

Commit

Permalink
Merge pull request #20 from Aperture-Development/development
Browse files Browse the repository at this point in the history
MSync Release
  • Loading branch information
ApertureDevelopment authored May 1, 2020
2 parents ee26b71 + dd01fa0 commit da28282
Show file tree
Hide file tree
Showing 22 changed files with 2,853 additions and 116 deletions.
103 changes: 97 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# MSync-2

Why version 2?
![BuildStatus](https://tcci.aperture-development.de/app/rest/builds/buildType:(id:MSync2_BuildTestPublish)/statusIcon.svg)
[![Issues](https://img.shields.io/github/issues-raw/Aperture-Development/MSync-2.svg)](https://github.com/Aperture-Development/MSync-2/issues)
[![Chat](https://img.shields.io/discord/272563407209889792.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/JpDPa6w)
![Size](https://img.shields.io/github/repo-size/Aperture-Development/MSync-2.svg)
[![Licence](https://img.shields.io/badge/license-by--nc--sa--4.0-green.svg)](https://github.com/Aperture-Development/MSync-2/blob/master/LICENSE)
[![Release](https://img.shields.io/github/release/Aperture-Development/MSync-2.svg)](https://github.com/Aperture-Development/MSync-2/releases)

What is MSync-2 ?

MSync is a all around GMod server synchronisation addon. The addon is and will always be free to use.

MSync 2 is a new version of https://github.com/Aperture-Development/MSync

It requires [MySQLoo](https://github.com/FredyH/MySQLOO) to work.

**Why version 2?**

Let's be honest here, version one is a broken piece of shit. It errors out everywhere, the GUI does not work and when you remove it, all bans and stuff are lost, because we overwrite the origiinal commands.

Expand All @@ -20,23 +35,99 @@ MSync 2 is Split up in 3 versions:
- CHEESE
- STEAK

EGG is the WIP addon which does not work yet at all. DO NOT USE ANYTHING OF THIS! The file structure will change propably. If you have problems with a EGG version, we do not Provide support. Use the STEAK version or at least CHEESE.
**EGG** is the WIP addon which does not work yet at all. DO NOT USE ANYTHING OF THIS! The file structure will change propably. If you have problems with a EGG version, we do not Provide support. Use the STEAK version or at least CHEESE.

CHEESE is the beta phase of the addon. The addon works, but has propably bugs everywhere that needs to be found yet. If you have errors whith this version, please inform us with a GitHub issue or over our ticketsystem: [https://www.Aperture-Development.de/ticketsystem](https://www.Aperture-Development.de/ticketsystem)
**CHEESE** is the beta phase of the addon. The addon works, but has propably bugs everywhere that needs to be found yet. If you have errors whith this version, please inform us with a GitHub issue or over our ticketsystem: [https://www.Aperture-Development.de/ticketsystem](https://www.Aperture-Development.de/ticketsystem)

STEAK is the stable version of MSync 2. This version is safe to be used on your server.
**STEAK** is the stable version of MSync 2. This version is safe to be used on your server.

Why do all versions are named after food?
**Why do all versions are named after food?**

Because it's a joke, as you maybe know, Debian distributions are named after the characters of Toy Story, and I thought its funny to have something like that for our Addons.

# A note to modules

If you plan on extending the features of MSync 2, please copy and use the samplemodule files. You can distribute the Module under every licence you like. We always use the root_dir/LICENCE which is basicly the Licence you get the addon with. If you download it from GitHub or Steam it will most likely be under the by-nc-sa 4.0 licence, while when you download it over our website, you will get the Aperture Development Commercial licence.

# Installation

You need to install some things manually on the Server in order for MSync to work.

First you need libmysql on windows or libmysqlclient on linux. You can find them here:
Windows: https://github.com/FredyH/MySQLOO/raw/master/MySQL/lib/windows/libmysql.dll
Linux: https://github.com/FredyH/MySQLOO/raw/master/MySQL/lib/linux/libmysqlclient.so.18
Put the file in the same folder where your scrds.exe or your scrds_linux file is.

Then you need MySQLoo 9 or higher. You can download MySQLoo from here:
https://github.com/FredyH/MySQLOO/releases
Select win32 if your server runs on windows, otherwise use the linux dll.
Put the dll file in your lua/bin folder. If you don't have one, create it.
it should look like this:

```
bin
garrysmod
->lua
-->bin
--->gmsv_mysql_<version>.dll
```

After that just install the addon by putting it in your servers workshop collection or download the zip file from github and put the folder in your servers addon folder:
https://github.com/Aperture-Development/MSync-2/archive/master.zip

When the server is started, everything should be ready for MSync 2. You can access the admin gui using "!msync"

# Features

**Server Groups:**

>Server groups allow you to group your servers in sub teams. Modules will just sync things that are explicity told to sync it across all servers, otherwise it will just sync it with servers that have the same server group.

**MRSync:**

>**M**ySQL **R**ank **Sync**hronisation
>
>MRSync allows you to synchronise your staff team across your servers without the need to add/remove a staff member on every server. Just add a user to a rank and he will also have the rank on all other servers. For now it is important that the ranks you synchronise also exist on all servers.
>
>You want some ranks to not be synced?
There is a rank blacklist for ranks that dont get saved to the database. Just add the rank and you are good to go.
>
>You want some ranks to be synced across all servers and some just for ( as example ) your DarkRP servers?
The server_group option allows you to do just that. Just sub-categorise your servers and your ranks now just get synced within this group. You can exclude ranks from that rule and force them to synchronise across all servers using the allserver table, all ranks in that table get saved as ranks for the whole network.


**MBSync:**

>**M**ySQL **B**an **Sync**hronisation
>
>MBSync allos you to synchronise your bans across all servers ( network bans ). This Module is also server_group bound, means when you ban a user on a server in the group darkrp they dont get banned on servers with a different group.
>
>Commands:
>
>!mban - Opens ban GUI
>
>!mban [Name] [Length] [global] [Reason] - bans a player
>
>!mbanid [SteamID/SteamID64] [Length] [global] [Reason] - bans a players steamid
>
>!munban [SteamID/SteamID64] - unbans a player
>
>!mbsync - Opens Ban list

**Planned Features**

>- UTime synchronisation - Codename: MUSync
>- MySQL Warning system - Codename: MWS
>- Permission synchronisation - Codename: MPSync
>- MSync synchronisation - Codename: MSSync


# Other info

MSync 2 - GitHub is distributed under the by-nc-sa 4.0 Int licence. Please read the LICENCE file in the root directory of MSync 2.

Support is provided over our ticketsystem:
[https://www.Aperture-Development.de/ticketsystem](https://www.Aperture-Development.de/ticketsystem)
[https://www.Aperture-Development.de/ticketsystem](https://www.Aperture-Development.de/ticketsystem)
7 changes: 6 additions & 1 deletion addon.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"*.psd",
"*.vcproj",
"*.svn*",
"*samplemodule.lua"
"*samplemodule.lua",
"LICENSE",
"README.md",
"*.sql",
".git/*",
".git"
]
}
3 changes: 2 additions & 1 deletion database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ CREATE TABLE IF NOT EXISTS `tbl_mbsync` (
`adminid` INT UNSIGNED NOT NULL,
`reason` VARCHAR(45) NOT NULL,
`date_unix` float NOT NULL,
`lenght_unix` float NOT NULL,
`length_unix` float NOT NULL,
`server_group` INT UNSIGNED NOT NULL,
`ban_lifted` INT UNSIGNED,
FOREIGN KEY (server_group) REFERENCES tbl_server_grp(p_group_id),
FOREIGN KEY (userid) REFERENCES tbl_users(p_user_id),
FOREIGN KEY (adminid) REFERENCES tbl_users(p_user_id)
Expand Down
14 changes: 14 additions & 0 deletions fake_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:1', '760000001', 'User 1', '2020-04-09 17:00');
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:2', '760000002', 'User 2', '2020-04-09 17:00');
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:3', '760000003', 'User 3', '2020-04-09 17:00');
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:4', '760000004', 'User 4', '2020-04-09 17:00');
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:5', '760000005', 'User 5', '2020-04-09 17:00');
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:6', '760000006', 'User 6', '2020-04-09 17:00');
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:7', '760000007', 'User 7', '2020-04-09 17:00');*/

INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (7, 2, 'Test 1', 1586445390, 99999999, 1);
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (2, 3, 'Test 2', 1586445390, 99999999, 1);
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (3, 4, 'Test 3', 1586445390, 99999999, 1);
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (4, 5, 'Test 4', 1586445390, 99999999, 1);
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (5, 6, 'Test 5', 1586445390, 99999999, 1);
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (6, 7, 'Test 6', 1586445390, 99999999, 1);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if SERVER then
if SERVER then
include("msync/sh_init.lua")
AddCSLuaFile("msync/sh_init.lua")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MSync.AdminPanel = MSync.AdminPanel or {}
Arguments: parent sheet
Returns: panel
]]
function MSync.AdminPanel.InitMySQL( sheet )
function MSync.AdminPanel.InitMySQL( sheet )
local pnl = vgui.Create( "DPanel", sheet )

local mysqlip_text = vgui.Create( "DLabel", pnl )
Expand Down Expand Up @@ -97,10 +97,10 @@ function MSync.AdminPanel.InitMySQL( sheet )
dbstatus:SetText( "DB Connection status: -Not Implemented-" )

local save_button = vgui.Create( "DButton", pnl )
save_button:SetText( "Save Settings" )
save_button:SetText( "Save Settings" )
save_button:SetPos( 25, 290 )
save_button:SetSize( 130, 30 )
save_button.DoClick = function()
save_button.DoClick = function()
MSync.settings.mysql.host = mysqlip:GetValue()
MSync.settings.mysql.port = mysqlport:GetValue()
MSync.settings.mysql.database = mysqldb:GetValue()
Expand All @@ -111,10 +111,10 @@ function MSync.AdminPanel.InitMySQL( sheet )
end

local saveconnect_button = vgui.Create( "DButton", pnl )
saveconnect_button:SetText( "Save and Connect" )
saveconnect_button:SetText( "Save and Connect" )
saveconnect_button:SetPos( 155, 290 )
saveconnect_button:SetSize( 130, 30 )
saveconnect_button.DoClick = function()
saveconnect_button.DoClick = function()
MSync.settings.mysql.host = mysqlip:GetValue()
MSync.settings.mysql.port = mysqlport:GetValue()
MSync.settings.mysql.database = mysqldb:GetValue()
Expand All @@ -126,18 +126,18 @@ function MSync.AdminPanel.InitMySQL( sheet )
end

local connect_button = vgui.Create( "DButton", pnl )
connect_button:SetText( "Connect" )
connect_button:SetText( "Connect" )
connect_button:SetPos( 285, 290 )
connect_button:SetSize( 130, 30 )
connect_button.DoClick = function()
connect_button.DoClick = function()
MSync.net.connectDB()
end

local reset_button = vgui.Create( "DButton", pnl )
reset_button:SetText( "Reset Settings" )
reset_button:SetText( "Reset Settings" )
reset_button:SetPos( 415, 290 )
reset_button:SetSize( 130, 30 )
reset_button.DoClick = function()
reset_button.DoClick = function()
mysqlip:SetText("127.0.0.1")
mysqlport:SetText("3306")
mysqldb:SetText("msync")
Expand Down Expand Up @@ -180,7 +180,7 @@ end
Arguments: parent sheet
Returns: panel
]]
function MSync.AdminPanel.InitModules( sheet )
function MSync.AdminPanel.InitModules( sheet )
local pnl = vgui.Create( "DPanel", sheet )

local ModuleList = vgui.Create( "DListView", pnl )
Expand Down Expand Up @@ -219,7 +219,7 @@ end
Arguments: parent sheet
Returns: panel
]]
function MSync.AdminPanel.InitModuleSettings( sheet )
function MSync.AdminPanel.InitModuleSettings( sheet )
local pnl = vgui.Create( "DColumnSheet", sheet )

local files, _ = file.Find("msync/client_gui/modules/*.lua", "LUA")
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ net.Receive( "msync.sendTable", function( len, pl )
local table = net.ReadTable()

if type == "settings" then MSync.settings = table; print("Got Settings!")
elseif type == "modules" then MSync.serverModules = table
elseif type == "modulestate" then
elseif type == "modules" then MSync.serverModules = table
elseif type == "modulestate" then
MSync.moduleState = table
MSync.loadModules()
MSync.loadModules()
end
end )

Expand Down
Loading

0 comments on commit da28282

Please sign in to comment.