Skip to content

Commit da28282

Browse files
Merge pull request #20 from Aperture-Development/development
MSync Release
2 parents ee26b71 + dd01fa0 commit da28282

22 files changed

+2853
-116
lines changed

README.md

Lines changed: 97 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# MSync-2
22

3-
Why version 2?
3+
![BuildStatus](https://tcci.aperture-development.de/app/rest/builds/buildType:(id:MSync2_BuildTestPublish)/statusIcon.svg)
4+
[![Issues](https://img.shields.io/github/issues-raw/Aperture-Development/MSync-2.svg)](https://github.com/Aperture-Development/MSync-2/issues)
5+
[![Chat](https://img.shields.io/discord/272563407209889792.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/JpDPa6w)
6+
![Size](https://img.shields.io/github/repo-size/Aperture-Development/MSync-2.svg)
7+
[![Licence](https://img.shields.io/badge/license-by--nc--sa--4.0-green.svg)](https://github.com/Aperture-Development/MSync-2/blob/master/LICENSE)
8+
[![Release](https://img.shields.io/github/release/Aperture-Development/MSync-2.svg)](https://github.com/Aperture-Development/MSync-2/releases)
9+
10+
What is MSync-2 ?
11+
12+
MSync is a all around GMod server synchronisation addon. The addon is and will always be free to use.
13+
14+
MSync 2 is a new version of https://github.com/Aperture-Development/MSync
15+
16+
It requires [MySQLoo](https://github.com/FredyH/MySQLOO) to work.
17+
18+
**Why version 2?**
419

520
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.
621

@@ -20,23 +35,99 @@ MSync 2 is Split up in 3 versions:
2035
- CHEESE
2136
- STEAK
2237

23-
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.
38+
**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.
2439

25-
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)
40+
**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)
2641

27-
STEAK is the stable version of MSync 2. This version is safe to be used on your server.
42+
**STEAK** is the stable version of MSync 2. This version is safe to be used on your server.
2843

29-
Why do all versions are named after food?
44+
**Why do all versions are named after food?**
3045

3146
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.
3247

3348
# A note to modules
3449

3550
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.
3651

52+
# Installation
53+
54+
You need to install some things manually on the Server in order for MSync to work.
55+
56+
First you need libmysql on windows or libmysqlclient on linux. You can find them here:
57+
Windows: https://github.com/FredyH/MySQLOO/raw/master/MySQL/lib/windows/libmysql.dll
58+
Linux: https://github.com/FredyH/MySQLOO/raw/master/MySQL/lib/linux/libmysqlclient.so.18
59+
Put the file in the same folder where your scrds.exe or your scrds_linux file is.
60+
61+
Then you need MySQLoo 9 or higher. You can download MySQLoo from here:
62+
https://github.com/FredyH/MySQLOO/releases
63+
Select win32 if your server runs on windows, otherwise use the linux dll.
64+
Put the dll file in your lua/bin folder. If you don't have one, create it.
65+
it should look like this:
66+
67+
```
68+
bin
69+
garrysmod
70+
->lua
71+
-->bin
72+
--->gmsv_mysql_<version>.dll
73+
```
74+
75+
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:
76+
https://github.com/Aperture-Development/MSync-2/archive/master.zip
77+
78+
When the server is started, everything should be ready for MSync 2. You can access the admin gui using "!msync"
79+
80+
# Features
81+
82+
**Server Groups:**
83+
84+
>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.
85+
86+
87+
**MRSync:**
88+
89+
>**M**ySQL **R**ank **Sync**hronisation
90+
>
91+
>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.
92+
>
93+
>You want some ranks to not be synced?
94+
There is a rank blacklist for ranks that dont get saved to the database. Just add the rank and you are good to go.
95+
>
96+
>You want some ranks to be synced across all servers and some just for ( as example ) your DarkRP servers?
97+
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.
98+
99+
100+
**MBSync:**
101+
102+
>**M**ySQL **B**an **Sync**hronisation
103+
>
104+
>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.
105+
>
106+
>Commands:
107+
>
108+
>!mban - Opens ban GUI
109+
>
110+
>!mban [Name] [Length] [global] [Reason] - bans a player
111+
>
112+
>!mbanid [SteamID/SteamID64] [Length] [global] [Reason] - bans a players steamid
113+
>
114+
>!munban [SteamID/SteamID64] - unbans a player
115+
>
116+
>!mbsync - Opens Ban list
117+
118+
119+
**Planned Features**
120+
121+
>- UTime synchronisation - Codename: MUSync
122+
>- MySQL Warning system - Codename: MWS
123+
>- Permission synchronisation - Codename: MPSync
124+
>- MSync synchronisation - Codename: MSSync
125+
126+
127+
37128
# Other info
38129

39130
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.
40131

41132
Support is provided over our ticketsystem:
42-
[https://www.Aperture-Development.de/ticketsystem](https://www.Aperture-Development.de/ticketsystem)
133+
[https://www.Aperture-Development.de/ticketsystem](https://www.Aperture-Development.de/ticketsystem)

addon.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
"*.psd",
88
"*.vcproj",
99
"*.svn*",
10-
"*samplemodule.lua"
10+
"*samplemodule.lua",
11+
"LICENSE",
12+
"README.md",
13+
"*.sql",
14+
".git/*",
15+
".git"
1116
]
1217
}

database.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ CREATE TABLE IF NOT EXISTS `tbl_mbsync` (
3939
`adminid` INT UNSIGNED NOT NULL,
4040
`reason` VARCHAR(45) NOT NULL,
4141
`date_unix` float NOT NULL,
42-
`lenght_unix` float NOT NULL,
42+
`length_unix` float NOT NULL,
4343
`server_group` INT UNSIGNED NOT NULL,
44+
`ban_lifted` INT UNSIGNED,
4445
FOREIGN KEY (server_group) REFERENCES tbl_server_grp(p_group_id),
4546
FOREIGN KEY (userid) REFERENCES tbl_users(p_user_id),
4647
FOREIGN KEY (adminid) REFERENCES tbl_users(p_user_id)

fake_data.sql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:1', '760000001', 'User 1', '2020-04-09 17:00');
2+
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:2', '760000002', 'User 2', '2020-04-09 17:00');
3+
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:3', '760000003', 'User 3', '2020-04-09 17:00');
4+
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:4', '760000004', 'User 4', '2020-04-09 17:00');
5+
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:5', '760000005', 'User 5', '2020-04-09 17:00');
6+
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:6', '760000006', 'User 6', '2020-04-09 17:00');
7+
INSERT INTO tbl_users (steamid, steamid64, nickname, joined) VALUES ('STEAM_0:0:7', '760000007', 'User 7', '2020-04-09 17:00');*/
8+
9+
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (7, 2, 'Test 1', 1586445390, 99999999, 1);
10+
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (2, 3, 'Test 2', 1586445390, 99999999, 1);
11+
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (3, 4, 'Test 3', 1586445390, 99999999, 1);
12+
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (4, 5, 'Test 4', 1586445390, 99999999, 1);
13+
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (5, 6, 'Test 5', 1586445390, 99999999, 1);
14+
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group) VALUES (6, 7, 'Test 6', 1586445390, 99999999, 1);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if SERVER then
1+
if SERVER then
22
include("msync/sh_init.lua")
33
AddCSLuaFile("msync/sh_init.lua")
44

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ MSync.AdminPanel = MSync.AdminPanel or {}
66
Arguments: parent sheet
77
Returns: panel
88
]]
9-
function MSync.AdminPanel.InitMySQL( sheet )
9+
function MSync.AdminPanel.InitMySQL( sheet )
1010
local pnl = vgui.Create( "DPanel", sheet )
1111

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

9999
local save_button = vgui.Create( "DButton", pnl )
100-
save_button:SetText( "Save Settings" )
100+
save_button:SetText( "Save Settings" )
101101
save_button:SetPos( 25, 290 )
102102
save_button:SetSize( 130, 30 )
103-
save_button.DoClick = function()
103+
save_button.DoClick = function()
104104
MSync.settings.mysql.host = mysqlip:GetValue()
105105
MSync.settings.mysql.port = mysqlport:GetValue()
106106
MSync.settings.mysql.database = mysqldb:GetValue()
@@ -111,10 +111,10 @@ function MSync.AdminPanel.InitMySQL( sheet )
111111
end
112112

113113
local saveconnect_button = vgui.Create( "DButton", pnl )
114-
saveconnect_button:SetText( "Save and Connect" )
114+
saveconnect_button:SetText( "Save and Connect" )
115115
saveconnect_button:SetPos( 155, 290 )
116116
saveconnect_button:SetSize( 130, 30 )
117-
saveconnect_button.DoClick = function()
117+
saveconnect_button.DoClick = function()
118118
MSync.settings.mysql.host = mysqlip:GetValue()
119119
MSync.settings.mysql.port = mysqlport:GetValue()
120120
MSync.settings.mysql.database = mysqldb:GetValue()
@@ -126,18 +126,18 @@ function MSync.AdminPanel.InitMySQL( sheet )
126126
end
127127

128128
local connect_button = vgui.Create( "DButton", pnl )
129-
connect_button:SetText( "Connect" )
129+
connect_button:SetText( "Connect" )
130130
connect_button:SetPos( 285, 290 )
131131
connect_button:SetSize( 130, 30 )
132-
connect_button.DoClick = function()
132+
connect_button.DoClick = function()
133133
MSync.net.connectDB()
134134
end
135135

136136
local reset_button = vgui.Create( "DButton", pnl )
137-
reset_button:SetText( "Reset Settings" )
137+
reset_button:SetText( "Reset Settings" )
138138
reset_button:SetPos( 415, 290 )
139139
reset_button:SetSize( 130, 30 )
140-
reset_button.DoClick = function()
140+
reset_button.DoClick = function()
141141
mysqlip:SetText("127.0.0.1")
142142
mysqlport:SetText("3306")
143143
mysqldb:SetText("msync")
@@ -180,7 +180,7 @@ end
180180
Arguments: parent sheet
181181
Returns: panel
182182
]]
183-
function MSync.AdminPanel.InitModules( sheet )
183+
function MSync.AdminPanel.InitModules( sheet )
184184
local pnl = vgui.Create( "DPanel", sheet )
185185

186186
local ModuleList = vgui.Create( "DListView", pnl )
@@ -219,7 +219,7 @@ end
219219
Arguments: parent sheet
220220
Returns: panel
221221
]]
222-
function MSync.AdminPanel.InitModuleSettings( sheet )
222+
function MSync.AdminPanel.InitModuleSettings( sheet )
223223
local pnl = vgui.Create( "DColumnSheet", sheet )
224224

225225
local files, _ = file.Find("msync/client_gui/modules/*.lua", "LUA")
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ net.Receive( "msync.sendTable", function( len, pl )
5858
local table = net.ReadTable()
5959

6060
if type == "settings" then MSync.settings = table; print("Got Settings!")
61-
elseif type == "modules" then MSync.serverModules = table
62-
elseif type == "modulestate" then
61+
elseif type == "modules" then MSync.serverModules = table
62+
elseif type == "modulestate" then
6363
MSync.moduleState = table
64-
MSync.loadModules()
64+
MSync.loadModules()
6565
end
6666
end )
6767

0 commit comments

Comments
 (0)