Make Global Database like Local Database
Maxetto opened this issue ยท 8 comments
Tell us about your environment
Spigot 1.8.8
ViaVersion 2.0.4
BanManager 5.13.1
5 Servers
BoNeMEAL Web Application
MySQL 5.6
Offline Mode
BanManager config.yml:
Hub:
databases:
local:
enabled: true
host: 127.0.0.1
port: 3306
name: bans
user: username
password: ''
maxConnections: 10
leakDetection: 3000
tables:
players: bm_players
playerBans: bm_player_bans
playerBanRecords: bm_player_ban_records
playerMutes: bm_player_mutes
playerMuteRecords: bm_player_mute_records
playerKicks: bm_player_kicks
playerNotes: bm_player_notes
playerHistory: bm_player_history
playerReports: bm_player_reports
playerReportLocations: bm_player_report_locations
playerReportStates: bm_player_report_states
playerReportCommands: bm_player_report_commands
playerReportComments: bm_player_report_comments
playerWarnings: bm_player_warnings
ipBans: bm_ip_bans
ipBanRecords: bm_ip_ban_records
ipMutes: bm_ip_mutes
ipMuteRecords: bm_ip_mute_records
ipRangeBans: bm_ip_range_bans
ipRangeBanRecords: bm_ip_range_ban_records
rollbacks: bm_rollbacks
nameBans: bm_name_bans
nameBanRecords: bm_name_ban_records
global:
enabled: false
host: 127.0.0.1
port: 3306
name: bans
user: username
password: ''
maxConnections: 10
leakDetection: 3000
tables:
playerBans: bm_player_bans
playerUnbans: bm_player_unbans
playerMutes: bm_player_mutes
playerUnmutes: bm_player_unmutes
playerNotes: bm_player_notes
ipBans: bm_ip_bans
ipUnbans: bm_ip_unbans
Any other server:
databases:
local:
enabled: true
host: 127.0.0.1
port: 3306
name: bans
user: username
password: ''
maxConnections: 10
leakDetection: 3000
tables:
players: (servername)__bm_players
playerBans: (servername)__bm_player_bans
playerBanRecords: (servername)__bm_player_ban_records
playerMutes: (servername)__bm_player_mutes
playerMuteRecords: (servername)__bm_player_mute_records
playerKicks: (servername)__bm_player_kicks
playerNotes: (servername)__bm_player_notes
playerHistory: (servername)__bm_player_history
playerReports: (servername)__bm_player_reports
playerReportLocations: (servername)__bm_player_report_locations
playerReportStates: (servername)__bm_player_report_states
playerReportCommands: (servername)__bm_player_report_commands
playerReportComments: (servername)__bm_player_report_comments
playerWarnings: (servername)__bm_player_warnings
ipBans: (servername)__bm_ip_bans
ipBanRecords: (servername)__bm_ip_ban_records
ipMutes: (servername)__bm_ip_mutes
ipMuteRecords: (servername)__bm_ip_mute_records
ipRangeBans: (servername)__bm_ip_range_bans
ipRangeBanRecords: (servername)__bm_ip_range_ban_records
rollbacks: (servername)__bm_rollbacks
nameBans: (servername)__bm_name_bans
nameBanRecords: (servername)__bm_name_ban_records
global:
enabled: true
host: 127.0.0.1
port: 3306
name: bans
user: username
password: ''
maxConnections: 10
leakDetection: 3000
tables:
playerBans: bm_player_bans
playerUnbans: bm_player_unbans
playerMutes: bm_player_mutes
playerUnmutes: bm_player_unmutes
playerNotes: bm_player_notes
ipBans: bm_ip_bans
ipUnbans: bm_ip_unbans
Describe your issue:
I can't use Global Database if those tables are used as a Local Database. I thought it would be the same structure but with different table names, but it's not.
I'd like that global and local database structure are the same in order to allow mixed table management like that.
How to replicate:
Use the same table names as local in a server and global in another.
Further information:
Even if it seems useless, I've been forced to do so because:
- BoNeMEAL doesn't support global tables
- There's no way to import bans from a server inside the global tables.
- My Hub server is pretty much a global ban case, so there's no point in running global bans in there. All bans should be global, that's why its tables are used by other servers' global tables
Thank you for your understanding.
P.S. Your Maven repo is offline and I can't build dev versions/try to fix it by myself.
Lack of documentation (or mislocation of) doesn't make it any easier to understand ... The role of local and global in BM's config has never been explained, not properly at least, anyway.
I think you want the same punishments be equally available to each node ? If not, then I don't understand your objective, either. Never heard of 'Via' nor 'BoNeMEAL'.
@rautamiekka ViaVersion is a Plugin that allows people to join an 1.8 server with up to 1.11.2. It's listed there as an Environment Variable, meaning that not only 1.8 clients are joining the server. That's not the problem however.
BoNeMEAL is an unofficial WebInterface that I found in the Web Interfaces page in Bukkit: https://dev.bukkit.org/projects/ban-management/pages/web-interfaces
I understood how to set-up punishments to be all global or one global and one local, I said that I woud like those table structures to be the same in order to allow mixed database configuration, such as an Hub that only stores Local Bans and another game server that stores both it's Local Bans and the Global Bans with the same tables as the Hub Local Bans.
An Example is the 2 configs I've posted in the 1st post.
I'm afraid I don't quite understand what you're trying to achieve. All punishments sync to your Hub server, but to no other servers?
I set up the Hub tables as Local database and I want other servers to sync in those tables as Global Database.
Right now this is impossible because Global Database don't have a bm_players table (because it's inside the punishment tables) and punishment tables have different columns (such as: "Uuid" instead of "player_id").
I'd like that both Local and Global database would share the same table structure so that they could sync among them.
This should also simplify the code by not providing two different structures for global and local database.
Yes, it still has speed issues, maybe memory too but it runs fine for now and it's so nice to see.
Now I get why Web applications don't have a Global page... it's because all bans are going into every single database.
In BoNeMEAL ban gets duplicated by this, is it the same in the official Web application? Like you see the same person in recent bans for every server it's being synced into?
This is an interesting use case that hasn't come up before. The structure differs as global
is used merely as a queue, to insert the punishments into local
. This has been working well for a number of years, so I'd like to avoid making quite large changes to it at this point, if possible.
I'll see what alternative solutions are viable for this scenario.
Jenkins should be back up this week, apologies for the downtime, I've had to migrate to a new host. I've already setup the new server, I just need some spare time to update the DNS records/nginx.
As for BoNeMEAL, it is an unofficial client, which hasn't been updated in quite some time. Last I looked, it had speed/memory issues. I wouldn't recommend it in its current state.
If you're adding each 'local' server individually, but syncing bans between them, then yes. Perhaps this is something that could be handled better as part of the new Web UI (BanManagement/BanManager-WebUI#27)
Yeah, I think this has to be handled by the WebUI if you're not going to change the database structure.
Since I'd like my WebUI to show bans for both global bans and single server bans but you said Global Bans would sync between every database, then someone would see itself banned in every server instead of one single "Globally Banned".