Skip to content

Commit

Permalink
Merge pull request #35 from Aperture-Development/development
Browse files Browse the repository at this point in the history
Bugfix Implementation
  • Loading branch information
ApertureDevelopment authored May 12, 2020
2 parents dd267e1 + d2f8397 commit ff34fb7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lua/msync/server/modules/sv_mrsync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MSync.modules.MRSync = MSync.modules.MRSync or {}
* @package MySQL Rank Sync
* @author Aperture Development
* @license root_dir/LICENCE
* @version 2.0.0
* @version 2.0.1
]]

--[[
Expand All @@ -16,7 +16,7 @@ MSync.modules.MRSync.info = {
Name = "MySQL Rank Sync",
ModuleIdentifier = "MRSync",
Description = "Synchronise your ranks across your servers",
Version = "2.0.0"
Version = "2.0.1"
}

--[[
Expand Down Expand Up @@ -75,7 +75,9 @@ function MSync.modules.MRSync.init( transaction )
SELECT p_user_id FROM tbl_users WHERE steamid=? AND steamid64=?
) AND (server_group=(
SELECT p_group_id FROM tbl_server_grp WHERE group_name=?
) OR server_group='allservers');
) OR server_group=(
SELECT p_group_id FROM tbl_server_grp WHERE group_name='allservers'
));
]] )
loadUserQ:setString(1, ply:SteamID())
loadUserQ:setString(2, ply:SteamID64())
Expand All @@ -84,7 +86,7 @@ function MSync.modules.MRSync.init( transaction )
function loadUserQ.onData( q, data )
if data.rank == ply:GetUserGroup() then return end;

ply:SetUserGroup(data[1].rank)
ply:SetUserGroup(data.rank)
end

loadUserQ:start()
Expand Down
5 changes: 5 additions & 0 deletions lua/msync/server/sv_mysql.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ function MSync.mysql.initialize()
);
]] ))

initDatabase:addQuery(MSync.DBServer:query( [[
INSERT INTO `tbl_server_grp` (group_name) VALUES ('allservers')
ON DUPLICATE KEY UPDATE group_name=VALUES(group_name);
]] ))

initDatabase:addQuery(MSync.DBServer:query( [[
CREATE TABLE IF NOT EXISTS `tbl_msync_servers` (
`p_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
Expand Down

0 comments on commit ff34fb7

Please sign in to comment.