Archiviert
1
0

Commits vergleichen

...
Dieses Repository wurde am 2024-08-03 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.

742 Commits

Autor SHA1 Nachricht Datum
yoyosource
995f38fa3c Fix coloring
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 21:45:37 +02:00
yoyosource
3ebd240741 Hotfix resources
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 21:44:29 +02:00
yoyosource
bdfb1b7772 Update RankCommand to make it easier to see
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 21:40:37 +02:00
yoyosource
67a57c9c8c Hotfix messages for /fight
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 19:41:28 +02:00
yoyosource
c15dd16cd5 Hotfix EloPlayerHandler to use internal ArenaMode name
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 15:23:08 +02:00
yoyosource
f5306a8ba0 Hotfix ChatListener and RankCommand die letzte
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 15:21:26 +02:00
yoyosource
c90de5c455 Hotfix ChatListener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 15:16:46 +02:00
yoyosource
209214a773 Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 14:33:21 +02:00
yoyosource
5465111de8 Hotfix EventStarter message 2024-08-03 14:33:17 +02:00
Lixfel
79eb2ae5a4 Fix EventStarter
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-08-03 14:25:18 +02:00
d8c10bba9b Merge pull request 'Update EloPlayerHandler and EloSchemHandler to handle non schem FightEndsPackets' (#519) from EloForMissileWars into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#519
Reviewed-by: Lixfel <lixfel@steamwar.de>
2024-08-03 13:25:17 +02:00
yoyosource
883c9131b5 Fix PR things
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 13:22:27 +02:00
yoyosource
8538a09a86 Update EloPlayerHandler and EloSchemHandler to handle non schem FightEndsPackets
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-08-03 13:15:28 +02:00
yoyosource
a5e4646e0a Hotfix 2 messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-07-22 12:40:18 +02:00
yoyosource
83e1a33af5 Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-07-17 08:04:20 +02:00
yoyosource
980c09d433 Hotfix Badlion to disconnect every person 2024-07-17 08:04:14 +02:00
Lixfel
dd07603fe3 Fix /bug, Discord Commands
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-07-06 15:13:08 +02:00
Lixfel
e2024a481b Fix 1.20.2+ Tablist order after server switch, Test fix commands
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-07-05 10:32:16 +02:00
Lixfel
7224428345 Fix 1.20.2+ Tablist vanishing after server switch
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-07-05 10:19:18 +02:00
Lixfel
d09f8edfa2 Fix BauLock, 1.15 - 1.20.1 Tablist, Builderserver, BugCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-07-05 10:09:29 +02:00
Lixfel
bacf366643 Fix SWCommand with 0 args
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-07-04 09:04:38 +02:00
Lixfel
48f11d3285 Fix SWCommand with 0 args, help WV, -1 ping, TICKET_LOG
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-07-04 08:36:43 +02:00
Lixfel
9c8ce57986 Fix Tablist for 1.21.
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-07-03 12:00:55 +02:00
Lixfel
e7f0e57e9d Fix DC alerts, DC commands, Poll command
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-29 23:39:09 +02:00
Lixfel
ff6fe9eeb5 Fix command logging, Discord ticket log
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-29 08:57:56 +02:00
Lixfel
dbe27e92d2 Fix command logging
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-29 08:46:02 +02:00
Lixfel
6350a99392 Fix command fixup, Discord command registration
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-29 08:10:14 +02:00
Lixfel
276587b07f Fix NPC packet, Fix discord channel
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 23:39:16 +02:00
Lixfel
5554b28894 Fix NPC packet
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 23:35:53 +02:00
Lixfel
e1eb392ffd Move command setup to the end of the initialization
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 15:47:24 +02:00
Lixfel
6232da87b5 Fix Bau delmember when player online but Bau not running
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 15:44:35 +02:00
Lixfel
8c098841ba Fix double Discord command registration, ConnectionListener and bau member commands
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 15:37:31 +02:00
Lixfel
0ef4fc147c Fix Discord bot shutdown, fight broadcasts, ErrorLogger, autoreconnect
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 13:24:12 +02:00
Lixfel
5d9d5de237 Fix DiscordCommands
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 10:41:23 +02:00
Lixfel
ba75129d57 Fix DiscordRanks, TypeValidators
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 10:37:48 +02:00
Lixfel
581f3be791 Fix Softreload
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 10:15:05 +02:00
Lixfel
c803fe2796 Fix DC Command regex, DC Ranks, no current server
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 10:12:30 +02:00
Lixfel
6a42b802e7 Fix DC Command logging, ChatRoom and double messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 09:42:20 +02:00
Lixfel
42dea17ff0 Fix ranks and ticketlog
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 09:27:16 +02:00
Lixfel
47f29e8bc7 Fix discord command registration
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 09:19:00 +02:00
Lixfel
c473182e7f Trigger rebuild
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 09:12:45 +02:00
Lixfel
d58c461a65 Fix DiscordConfig
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-28 09:10:37 +02:00
213bc3d319 Merge pull request 'Velocity' (#516) from velocity into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#516
2024-06-28 08:39:04 +02:00
Lixfel
755ca15cca Improve reworked ChecklistChannel
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-27 15:51:25 +02:00
Lixfel
a15bd4aa83 Reworked Checklist Channel, Working ErrorLogger
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-27 15:33:00 +02:00
Lixfel
b3a987f9a5 Reenable minimization, Mods
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-26 13:35:52 +02:00
Lixfel
7deaed4961 WIP Mods, Alpine Client support
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-22 17:00:13 +02:00
Lixfel
9d3b0ea0cd Chat, Softreload, Renaming package
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-22 12:25:03 +02:00
Lixfel
2ef06f61e4 Bugfixes
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-20 23:10:58 +02:00
286f06f866 Merge pull request 'Fix some SonarLint Issues and Modernize Java' (#517) from modernize into velocity
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Reviewed-on: SteamWar/BungeeCore#517
Reviewed-by: Lixfel <lixfel@steamwar.de>
2024-06-20 22:20:49 +02:00
101a8ed1e4 Remove Jetbrains Annotation
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2024-06-20 21:33:33 +02:00
fd1d556fa3 Jup
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2024-06-20 20:13:03 +02:00
07c7635ab4 Fix some SonarLint Issues and Modernize Java
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2024-06-19 23:56:31 +02:00
39571b897d Add Copyright(s)
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2024-06-19 17:48:52 +02:00
Lixfel
73b89256f0 Remove Packet
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-19 12:03:41 +02:00
Lixfel
2f4290e2fe Merge remote-tracking branch 'origin/velocity' into velocity
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2024-06-19 12:03:01 +02:00
Lixfel
c87ec5214a Persistent MonoRepo, Velocity: Tablist
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-19 12:02:45 +02:00
5e858cf506 Add UpdateTeamsPacket
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2024-06-16 21:13:52 +02:00
9b0d7bd856 Port SQLWrapperImpl
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2024-06-16 20:32:57 +02:00
Lixfel
61d42c7cca WIP Velocity: ArenaMode
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-16 20:13:04 +02:00
Lixfel
f6f568ee40 WIP Velocity: Mods, Listeners
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-16 19:31:33 +02:00
a1d8ec806f Copy over Code
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2024-06-16 04:04:05 +02:00
Lixfel
ef71323b05 WIP Velocity: Commands, Discord, Inventory
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-15 23:19:55 +02:00
Lixfel
c39e2a0566 Message deprecation, Discord refactoring
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
2024-06-15 12:16:18 +02:00
a188ce2c6f WIP message deprecation
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-05-13 17:23:42 +02:00
3b5be809dd WIP message deprecation
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-05-12 21:24:15 +02:00
e1e1d66177 WIP message deprecation
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-05-12 17:20:37 +02:00
d7798b3275 Fix error logging
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-05-05 00:11:12 +02:00
de51db2667 Fix team join
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-04-14 17:44:59 +02:00
59b2e397ba Controlify, Feather Client, Bugfixes
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-20 10:08:23 +01:00
a6feb68bf3 Geckolib, Waila, Midnightcontrols, Lambdacontrols
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-16 15:20:15 +01:00
457b787179 Update CommonCore, kick Litematica, kick MiniMaps
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-16 00:54:49 +01:00
9572347419 Fix sw:bridge, axiom, bau.steamwar.de
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-14 22:52:50 +01:00
a0a2d70c46 Add Various mods and Hostnames
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-14 21:51:35 +01:00
f214751d0b Merge pull request 'Add known Hostnames' (#511) from chaoscaot-add-hostnames-1 into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#511
Reviewed-by: Lixfel <lixfel@steamwar.de>
2024-03-14 21:47:54 +01:00
8f3422dce6 Fix
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-03-14 21:39:22 +01:00
Chaoscaot
2c6de937b3 src/de/steamwar/bungeecore/mods/Hostname.java aktualisiert
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Chaoscaot <chaoscaot@zohomail.eu>
2024-03-14 21:36:38 +01:00
49238463a5 Add Scanner hostnames, Geyser, xAeroMiniMap, Axiom support
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-14 15:56:53 +01:00
0fd86300ac Passthrough sw:hotkeys, add optifine brand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-14 12:18:27 +01:00
c74178abe1 Merge pull request 'Mod detection refactoring' (#509) from modDetectionRework into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#509
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2024-03-14 11:42:23 +01:00
a3a65b0f53 Disable Replay by default (for now, until tests have been done)
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-14 11:42:01 +01:00
1c99a9fb4b Merge pull request 'Use new Referee table, Multi spectate server support' (#510) from wargearseason into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#510
2024-03-14 09:34:30 +01:00
628e7b093c More elegant port solution
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-14 09:31:30 +01:00
dd90ee1ced Use new Referee table, Multi spectate server support
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-13 13:36:13 +01:00
8029dd09e9 Fix Node debug code changes, Debug messages, script_syntax,
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-11 22:29:22 +01:00
1e40decc9e Fix IP sanitizing impacts
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-04 12:44:33 +01:00
437d1c055c Fixed ReplayMod, FML2, FML3, FORGE, Hostname detection
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-03 18:36:28 +01:00
1436069cb5 Mod detection refactoring
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Adding Lunar support
Fixing LabyMod support
Restricting ReplayMod
Restricting WorldDownloader
Enabling Fabric without FabricModSender
Adding logging for unknown channels

Untested.

Signed-off-by: Lixfel <agga-games@gmx.de>
2024-03-02 00:43:42 +01:00
yoyosource
b852423442 Fix messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-02-17 09:09:14 +01:00
yoyosource
6f5bb3eb97 Fix HelpCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-02-17 09:06:25 +01:00
55d08ce0db Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-02-17 08:34:09 +01:00
b3efb223af Merge pull request 'Update BauMemberPermission' (#505) from PermissionUpdate into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#505
Reviewed-by: Lixfel <lixfel@steamwar.de>
2024-02-17 08:32:16 +01:00
74291bc143 Merge pull request 'Notify owner on lock blocking join' (#508) from buildLockNotification into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#508
Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
2024-02-13 10:52:52 +01:00
dabd880209 Notify owner on lock blocking join
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-02-06 22:34:23 +01:00
3b7fa8054d No Core Dumps on OOM/Crashes
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-02-06 22:20:45 +01:00
54b15ddd95 Remove TeamSpeak from tablist header
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-01-29 11:52:47 +01:00
70662386a7 Revert Hotfix: No fallback on server startup
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-01-20 09:00:01 +01:00
d7e9bb23fc Hotfix: No fallback on server startup
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-01-19 23:21:19 +01:00
yoyosource
04ebed15d3 Revert ServerStarter.builder startCondition
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Fix CommonCore
2024-01-19 16:47:53 +01:00
yoyosource
9688c38954 Revert ServerStarter.builder startCondition
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2024-01-19 16:44:52 +01:00
yoyosource
760cf4b3b1 Merge branch 'master' into PermissionUpdate
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
# Conflicts:
#	src/de/steamwar/bungeecore/ServerStarter.java
2024-01-19 16:37:51 +01:00
yoyosource
443a1b29c9 Fix messages
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Fix ServerStarter condition
2024-01-19 16:30:47 +01:00
c7c541676c Fix java version
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-01-18 01:41:15 +01:00
d7a5b72f72 Merge pull request 'Checkpoint support' (#506) from checkpoint into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#506
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2024-01-18 01:23:10 +01:00
510fed73d3 Fix missing ServerStarter
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-01-16 15:49:17 +01:00
f0e85c21ce Checkpoint support
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2024-01-16 15:45:46 +01:00
9567bd4c3f Ignore incoming HTTP GET requests
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-12-30 20:47:47 +01:00
yoyosource
3752f3f145 Update BauMemberPermission
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-12-22 17:07:14 +01:00
yoyosource
2cdbe68665 Fix Bau Lock messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-22 10:22:33 +01:00
ed5f84dc20 Merge pull request 'Add BauLockState.TEAM_AND_SERVERTEAM and BauLockState.SERVERTEAM as requested by many' (#504) from ExtendedBauLock into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#504
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-12-22 10:07:40 +01:00
yoyosource
c72a042bbb Add translations
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-21 19:20:14 +01:00
yoyosource
334afbac63 Add BauLockState.TEAM_AND_SERVERTEAM and BauLockState.SERVERTEAM as requested by many
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-21 18:15:23 +01:00
779d5f57dc Revert "Update Tablist colors"
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
This reverts commit 23291a7732.
2023-12-19 16:54:41 +01:00
5162c5b05b Revert "Fix NPE"
This reverts commit e1a0c4802f.
2023-12-19 16:54:41 +01:00
1b3ed278c6 Merge pull request 'Update Tablist colors' (#503) from TpAndTablist into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#503
2023-12-19 16:53:09 +01:00
yoyosource
e1a0c4802f Fix NPE
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-17 21:57:41 +01:00
yoyosource
23291a7732 Update Tablist colors
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-17 21:32:24 +01:00
d22766fedd Merge pull request 'Add TpCommand tabcompletions for Teamserver players not joining from SteamWar' (#502) from TpAndTablist into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#502
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-12-17 21:04:45 +01:00
yoyosource
5a0cf47878 Fix Peer Review issues
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-17 20:31:53 +01:00
yoyosource
99f3ad5f03 Add TpCommand tabcompletions for Teamserver players not joining from SteamWar
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Fix Tablist color for Teamserver players not joining from SteamWar
2023-12-17 19:52:50 +01:00
3d67919f0a Merge pull request 'Fix Tablist display names for SWTSI' (#500) from BetterSWTCITablistIntegration into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#500
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-12-06 16:55:44 +01:00
yoyosource
c017fd23a1 Fix Tablist display names for SWTSI
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-06 16:53:18 +01:00
a05ec1d6d9 Merge pull request 'Fix Tablist' (#499) from BetterSWTCITablistIntegration into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#499
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-12-06 16:50:44 +01:00
yoyosource
28f09e54b9 Fix Tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-06 16:49:58 +01:00
7411d9d875 Merge pull request 'Add external players of teamserver to tablist of player' (#498) from BetterSWTCITablistIntegration into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#498
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-12-06 16:41:41 +01:00
yoyosource
bdbe615790 Yoyo am losten
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-06 16:39:41 +01:00
yoyosource
bfefd5a197 Remove some useless boolean inverts
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-06 16:38:42 +01:00
yoyosource
56a9bd077c Add external players of teamserver to tablist of player
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-12-06 16:35:30 +01:00
6dd35a265b Fix Tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-12-06 12:33:07 +01:00
f270d4197b Fix tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-12-06 12:26:20 +01:00
2d85746d9f Debug tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-12-06 12:19:02 +01:00
9de6b8602d Tablist fix: Make similar to header and footer
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-12-06 12:07:43 +01:00
57b220f77c Tablist fix
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-12-06 12:01:53 +01:00
74cf9d4657 Tablist fix
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-12-06 11:57:35 +01:00
3ea910501a Fix Tablist for 1.20.3 Waterfall
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-12-06 11:40:34 +01:00
4979889468 Default to 1.20 Bau for Players > 1.19.4
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-12-05 16:31:14 +01:00
8e51002e6c Fix whois color code
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-11-29 18:34:41 +01:00
dad5c6029e Merge pull request 'Add restriction for checking own team schematics' (#494) from NoCheckingOfOwnTeamSchematics into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#494
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-11-29 18:31:08 +01:00
yoyosource
a571832d67 Update Peer Review stuff and add message
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-11-29 18:30:04 +01:00
yoyosource
6f31058d61 Remove CalendarCommand and CalendarListener from Bungee
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-11-29 18:15:20 +01:00
e36d18ae9d Likely arena nametag fix.
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-11-29 18:10:56 +01:00
yoyosource
bb8b46c437 Add restriction for checking own team schematics
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-11-29 17:49:24 +01:00
0df03a7dfb Star fixes, whois ID based only ADMINISTRATION, Prefix
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-11-29 17:20:19 +01:00
792bbd610d Merge pull request 'Fix QuickGear' (#493) from fix-quickgear into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#493
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-11-29 16:37:22 +01:00
45cacced9d Fix QuickGear
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-11-29 16:34:27 +01:00
d8d519765a Add QuickGear Rules, disable LevelHead on Badlion
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-11-29 16:22:06 +01:00
20481029c7 Merge pull request 'Help page addition: schem submit tutorial link' (#492) from helpSchemsubmit into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#492
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-11-29 16:02:48 +01:00
c3a011d98e Help page addition: schem submit tutorial link
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-11-29 15:07:45 +01:00
yoyosource
183d43dadb Remove CalendarCommand and CalendarListener from Bungee
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-11-28 20:47:17 +01:00
19903e9548 Fix playtime command
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-11-28 19:00:18 +01:00
04a2a31d80 Merge pull request 'Fix EloSchemHandler' (#489) from EloFixForPublicVsPublicAndRank into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#489
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-10-28 20:28:52 +02:00
yoyosource
ec6cb89bdb Fix EloSchemHandler
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-10-28 20:27:58 +02:00
3d64ee3b6f Merge pull request 'Fix ELO not given for public team vs public team' (#488) from EloFixForPublicVsPublicAndRank into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#488
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-10-28 20:23:04 +02:00
yoyosource
9be6ec94dc Fix ELO not given for public team vs public team
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Fix R1 vs R2
2023-10-25 08:29:22 +02:00
69720bfbd8 Merge pull request 'Add ModLoaderBlocker for lunar client' (#487) from LunarClient into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#487
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-10-24 12:16:41 +02:00
yoyosource
d46c89101d Fix ModLoaderBlocker for Legacy API, if still used?
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-10-24 11:37:36 +02:00
yoyosource
c4fcbdcb43 Add ModLoaderBlocker for lunar client
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-10-24 11:10:24 +02:00
24d909a4da Fix eventreschedule perms
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-30 19:57:15 +02:00
6aeeff235a Fix eventreload perms
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-30 19:53:38 +02:00
65fcb5329f Queue Packets
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-24 08:27:55 +02:00
e981cf5c02 Merge pull request 'Remove player tabcomplete in every command' (#486) from BetterTabCompleting into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#486
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-09-24 08:11:52 +02:00
yoyosource
5b627a7819 Fix some tab completions and optimize others
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-09-23 13:22:43 +02:00
yoyosource
157aea068e Remove player tabcomplete in every command
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Add player tab complete to every command needing it
Fix some tabcomplete things
2023-09-23 12:57:41 +02:00
38eb8d9c06 Fix BrandListener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-22 07:45:14 +02:00
ffc2cefcfe Fix Tablist to have 1.20.2 compatibility #2
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-22 07:40:46 +02:00
0fc0954d82 Fix Tablist to have 1.20.2 compatibility
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-22 07:38:04 +02:00
43bd25c13e Disable ForgeHandler for 1.20.2+
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-22 07:29:53 +02:00
b892450e2d Merge pull request 'Automatic Random arena when not specified' (#485) from autoRandom into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#485
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-09-16 11:45:47 +02:00
6fe4dbe13a Automatic Random arena when not specified
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-12 21:48:42 +02:00
dbc9ed8b57 Fix BanListener parsing
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-11 11:34:56 +02:00
ecf17dd347 Give Mods /mod permission
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-03 20:17:52 +02:00
244f922091 Change Colors
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-09-01 11:33:14 +02:00
ee05b42a07 Fix whois MODERATION
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-31 21:51:18 +02:00
fbbfc1bd03 Merge pull request 'Bau toggleall' (#482) from toggleall into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#482
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-08-31 16:35:48 +02:00
1e9b5ead35 Fix behaviour
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-31 16:30:53 +02:00
19b12c0055 Merge pull request 'Remove external shutdown' (#484) from no-external-shutdown into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#484
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-08-31 15:57:45 +02:00
e443235e34 Remove external shutdown
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-31 13:39:39 +02:00
cd044adc55 Rework whois
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-31 08:09:12 +02:00
a308f9b940 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-30 12:10:21 +02:00
af357cb554 Update CommonCore
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-29 20:04:59 +02:00
356afc9bff Update ColorChat Perm, Simplify BanListener
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-29 18:09:25 +02:00
2f928349d7 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-29 17:48:25 +02:00
7f05d0f9ca Update 4 years with various permission systems to UserPerm
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-29 17:47:49 +02:00
00e08b5943 Bau toggleall
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-26 00:30:43 +02:00
4db2ba6a5d Merge pull request 'Fix team leader stepdown and leaving' (#481) from teamDisband into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#481
Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
2023-08-25 17:26:24 +02:00
b35d5e214a Fix team leader stepdown and leaving
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-25 15:15:53 +02:00
3980961b76 Merge pull request 'Bau version refactoring, Bau 1.20 starter' (#480) from bau1.20 into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#480
Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
2023-08-20 21:56:20 +02:00
e5cc016652 Bau version refactoring, Bau 1.20 starter
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-20 21:46:15 +02:00
3db61577b0 Async builder deploy
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-19 13:28:26 +02:00
c0e1d3eff7 Fix script path
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-19 13:20:51 +02:00
6284cd8e7b Change to roundtrip-YAML parser
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-19 13:12:09 +02:00
443ce0377f Change to roundtrip-YAML parser
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-19 13:11:16 +02:00
0c3f200a91 Fix deployarena.py gamemode file loading
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-19 12:59:00 +02:00
8c03d2a348 Merge pull request 'Deploy arena command' (#479) from deployarena into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#479
Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
2023-08-19 12:54:21 +02:00
5aa402d6e8 Deploy arena command
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-19 12:39:58 +02:00
59168c3447 CommonCore update, 1.20 Buildercloud
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-08-17 22:53:31 +02:00
137ef647fb Fix buildercloud create
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-07-23 17:47:33 +02:00
1128a43010 Fix buildercloud
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-07-23 17:43:53 +02:00
5da9d55cb8 Merge pull request 'Buildercloud rework, no automatic map generation, renaming, hidden worlds' (#477) from buildercloud2 into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#477
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-07-23 17:26:48 +02:00
yoyosource
df3e082774 Hotfix build
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-07-18 22:11:19 +02:00
yoyosource
6192d0d458 Add user count to team info command
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-07-18 22:09:17 +02:00
yoyosource
3254755e61 Fix elo again
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-07-18 18:28:42 +02:00
yoyosource
e99f24b01b Fix another elo related thing
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-07-18 18:21:31 +02:00
01c90dc4ae Buildercloud rework, no automatic map generation, renaming, hidden worlds
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-07-14 15:44:52 +02:00
yoyosource
4dad89ec34 Update EloPlayerHandler.MEDIAN_ELO_GAIN and add EloPlayerHandler.MEDIAN_ELO_LOSE
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-06-26 21:42:51 +02:00
4385cd3589 Decrease logging spam
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-06-10 17:57:13 +02:00
eacf7fd6cf Fix SchemElo SchemID
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-05-23 19:52:18 +02:00
feeca8f523 Merge pull request 'Add Gradle Plugin' (#476) from gradle_plugin into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#476
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-05-22 09:20:40 +02:00
Chaoscaot
e5d48024cb Add Gradle Plugin
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-21 20:48:57 +02:00
yoyosource
8ed0847bcc Hotfix EloPlayer calculation
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-20 10:46:28 +02:00
yoyosource
e43a724550 Hotfix ELO_LOSE_CONSTANT
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-15 16:48:23 +02:00
yoyosource
9385f57612 Remove logging
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-14 12:39:52 +02:00
yoyosource
6002af7f6a Hotfix die letzte
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-14 12:38:46 +02:00
yoyosource
60d5a04d0c Add logging
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-14 12:35:52 +02:00
yoyosource
9e1653740d Hotfix (the last one hopefully) for the Elo handling
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-14 11:26:36 +02:00
yoyosource
618c4d24a2 Hotfix (the last one hopefully) for the Elo handling 2023-05-14 10:34:14 +02:00
yoyosource
fbcb043d1c Fix team ratio scaling
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-13 16:27:45 +02:00
yoyosource
fcd686a9ba Hotfix the cache
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-13 16:01:36 +02:00
yoyosource
4422fbdc8b Hotfix team elo scaling
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-13 15:35:47 +02:00
yoyosource
9af07f821d Update Title style
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-13 14:38:42 +02:00
yoyosource
7cd4a5bac8 Update messages and cleanup RankCommand visual clutter
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-13 13:14:55 +02:00
yoyosource
6c540c3bac Hotfix some player connection issues for title sending
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-13 09:02:20 +02:00
yoyosource
9e6c6ace27 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-12 23:40:26 +02:00
yoyosource
aaadb0e5e2 Update some more stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-12 23:36:48 +02:00
yoyosource
6ed534bcb3 Hotfix TeamCommand.tp
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-12 23:29:28 +02:00
yoyosource
6848bac447 Update some more stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-12 23:24:54 +02:00
yoyosource
6a3c47994a Add logging
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-12 23:15:11 +02:00
ab207b2234 Merge pull request 'Update to new ranked system' (#475) from NewRankedSystem into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#475
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-05-12 22:56:41 +02:00
yoyosource
5e09d018ba Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-12 22:54:54 +02:00
yoyosource
0c0cf594c4 Remove german translation
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-05-11 16:13:47 +02:00
yoyosource
9039928eb4 Update to new ranked system
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-05-11 16:06:27 +02:00
44e9c084c7 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-05-11 09:10:55 +02:00
3fa5e51f30 Merge pull request 'Only send FabricModSender messages if required.' (#474) from reduceJoinSpam into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#474
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-05-09 15:26:54 +02:00
98e80442b2 Only send FabricModSender messages if required.
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-05-09 12:51:24 +02:00
yoyosource
65950a939b Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-06 21:18:29 +02:00
yoyosource
4b38ed7c54 Hotfix TeamCommand.tp 2023-05-06 21:18:24 +02:00
3df1e556ae Merge pull request 'NoClassGC' (#473) from noclassgc into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#473
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-05-02 09:38:33 +02:00
5ac85f4e9d NoClassGC
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-05-02 09:36:11 +02:00
yoyosource
ff75a43c11 Hotfix die zweite
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-01 11:33:46 +02:00
yoyosource
95a9e8d2a6 Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-01 11:22:06 +02:00
yoyosource
ab24041d44 Fix CommonCore startOfSeason 2023-05-01 11:22:02 +02:00
4052e342fb Merge pull request 'Fix Fight Merging' (#472) from fix_fight_merging into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#472
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-05-01 10:29:35 +02:00
Chaoscaot
efc7a3fe48 Fix Fight Merging
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-05-01 10:10:25 +02:00
4f42c0eca4 Merge pull request 'RuleCommandUpdate' (#469) from RuleCommandUpdate into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#469
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-04-20 23:32:29 +02:00
MoBrot
481d4a7892 English translation
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-04-20 19:33:01 +02:00
ead97b9f87 Merge pull request 'Update MsgCommand' (#468) from FixMsgCommand into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#468
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-04-17 20:53:35 +02:00
yoyosource
4b33bd8082 Update MsgCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-04-17 20:51:15 +02:00
yoyosource
97934be675 Hotfix PunishmentCommand messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-04-10 12:07:04 +02:00
cb87862596 Merge pull request 'Scream Message' (#466) from scream into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#466
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-04-06 22:50:19 +02:00
Chaoscaot
1b05b66463 I wanna scream and shout
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-04-06 21:00:03 +02:00
Chaoscaot
84c8ad6807 I wanna scream and shout
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-04-06 20:57:48 +02:00
2a91876cb9 FabricModSender PP Circumventer notification
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-04-05 08:11:08 +02:00
MoBrot
265c841920 Add Code of Conduct to RegelnCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-03-19 22:26:25 +01:00
630ee612e0 Merge pull request 'Fix NoFight punishment for EventCommand' (#465) from FixNoFightServerPunishmentForEventCommand into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#465
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-03-13 16:38:28 +01:00
yoyosource
341cff0507 Fix NoFight punishment for EventCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-03-13 16:31:11 +01:00
92da1d8bc2 Fix Tab Team
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-03-11 21:35:28 +01:00
1f83004d64 Fix tutorial rate misusers
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-03-10 11:50:47 +01:00
9b79a9c593 Merge pull request 'Fix Reasonless Punishments' (#464) from reasonless into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#464
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-03-07 15:39:31 +01:00
yoyosource
24d4c9b213 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-03-05 21:59:30 +01:00
yoyosource
b6612fcf37 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-03-05 21:55:10 +01:00
Chaoscaot
a0f21a95da Fix Reasonless Punishments
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-03-05 15:39:38 +01:00
yoyosource
0d45cacbbc Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-03-04 12:36:57 +01:00
yoyosource
b5ca36c0d1 Update CommonCore 2023-03-04 12:36:53 +01:00
09c600ebed Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-03-04 12:13:20 +01:00
1a6fbb5a19 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-03-04 12:12:24 +01:00
2f2584a6ae No Discord on EventBungee
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-03-04 11:55:58 +01:00
603f3a09bf Fix zero broadcast messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-03-03 18:00:59 +01:00
ed3f8d8362 Change to 1.19.3
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-03-03 16:14:34 +01:00
5c6390f1f1 Fix MemberCache invalidation
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-26 15:50:34 +01:00
0db89d1424 Update BannedUserIPs
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-25 07:35:48 +01:00
891f39b28e Fix formatting
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-24 20:21:57 +01:00
yoyosource
ad535f2788 Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-24 20:21:26 +01:00
yoyosource
758365bc76 Hotfix TeamCommand 2023-02-24 20:21:21 +01:00
6e52fd7ded Hotfix NPE
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-24 17:08:26 +01:00
a681edd57e Hotfix NPE
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-24 13:36:26 +01:00
c096c5cbdf Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-24 10:39:54 +01:00
Chaoscaot
2f7f561c16 Add BIS
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-24 10:25:03 +01:00
Chaoscaot
2a69cadda8 Fix Schematic Upload
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-24 10:15:45 +01:00
Chaoscaot
7750398466 Fix Queries
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-24 09:31:35 +01:00
Chaoscaot
37dc1df094 Add License Header
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-23 18:20:04 +01:00
Chaoscaot
724246e48e Update to CommonDB
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-23 17:33:30 +01:00
Chaoscaot
a4509ab88e Merge branch 'master' into seperate_schemdata
# Conflicts:
#	src/de/steamwar/bungeecore/sql/SchematicNode.java
2023-02-23 17:29:21 +01:00
4441e9fa0c Update CommonCore: Team Lookup fix
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-23 14:04:05 +01:00
c0822b726b Merge pull request 'NoFabricFabric' (#460) from NoFabricFabric into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#460
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-02-23 10:21:31 +01:00
yoyosource
0d6e1f54bd Update check
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-23 08:35:43 +01:00
e2e2366759 Merge pull request 'CommonDB' (#463) from commonDB2 into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#463
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-02-23 08:09:24 +01:00
06432868cc Update to CommonCore master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-23 08:07:29 +01:00
yoyosource
242e19adb2 Hotfix TeamCommand tp and join
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-22 20:07:06 +01:00
yoyosource
b096f8251c Hotfix TeamCommand info
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-22 16:51:45 +01:00
99750ca767 Fix Bugs
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-22 16:18:16 +01:00
yoyosource
6e30c5e7ba Hotfix TeamCommand info
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-22 15:15:55 +01:00
5c9394e4b0 Merge branch 'master' into commonDB2
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
# Conflicts:
#	src/de/steamwar/bungeecore/commands/BasicCommand.java
#	src/de/steamwar/bungeecore/commands/EventCommand.java
#	src/de/steamwar/bungeecore/commands/JoinmeCommand.java
#	src/de/steamwar/bungeecore/commands/TeamCommand.java
#	src/de/steamwar/bungeecore/commands/TeamchatCommand.java
2023-02-22 07:12:23 +01:00
3136c2f6d9 Merge pull request 'port_to_commandframework' (#457) from port_to_commandframework into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#457
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-02-22 07:10:32 +01:00
yoyosource
02c8538d76 Fix another some weird tab completes
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-21 20:49:38 +01:00
yoyosource
ba064a1f9e Fix another one
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-21 20:45:00 +01:00
yoyosource
87db98a310 Fix 3 things
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-21 20:38:19 +01:00
734de7178b Es ist vollbracht
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-21 20:03:36 +01:00
c4bafb4591 WIP CommonDB: Milestone SWUser
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-21 18:22:42 +01:00
4d535c5550 Merge branch 'master' into commonDB2
# Conflicts:
#	CommonCore
2023-02-21 15:58:18 +01:00
Chaoscaot
6699e3843f Seperate SchematicData
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-21 13:31:03 +01:00
8a20d41f95 Hotfix LoginResult
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-20 17:05:44 +01:00
978fd1abe0 Fix Quilt FabricModSender requirement
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-19 22:46:58 +01:00
79a5e711c8 Merge branch 'master' into NoFabricFabric
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-18 15:57:42 +01:00
yoyosource
0dd50c7e09 Update timings
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-18 12:54:34 +01:00
yoyosource
05b6b3ac66 Add even better fabric check
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-18 12:49:24 +01:00
yoyosource
42c23e4521 Add exception log
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-18 11:04:29 +01:00
6735bf4d6a Merge pull request 'Add NonFabricFabricCheck' (#458) from NoFabricFabric into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#458
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-02-17 17:42:25 +01:00
yoyosource
68a2f78e04 Update messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 17:33:56 +01:00
yoyosource
5d70cc4185 Update messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 17:25:58 +01:00
yoyosource
91e73eab25 Update messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 17:24:49 +01:00
yoyosource
e4ab48a386 Fix vanilla brand check
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 17:22:49 +01:00
yoyosource
277304b7f2 Fix vanilla brand check
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 17:15:30 +01:00
yoyosource
bc44380c32 Add NonFabricFabricCheck
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 17:13:46 +01:00
a0dd4f5c57 HotFix Tablistpart
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-17 17:09:05 +01:00
yoyosource
9dd3cb7697 Update JoinmeCommand ProxiedPlayer Validator
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Fix typos in TeamCommand
2023-02-17 15:27:20 +01:00
yoyosource
dd8d65ff9d Merge remote-tracking branch 'origin/port_to_commandframework' into port_to_commandframework
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 15:22:09 +01:00
yoyosource
6de8ed282b Add usage messsage on no permission 2023-02-17 15:22:05 +01:00
dfcb754a83 Merge branch 'master' into port_to_commandframework
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 15:16:51 +01:00
yoyosource
b3a4c93c59 Update stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 15:08:55 +01:00
e26ee5f389 Merge pull request 'Improve needed mods check' (#456) from BetterNeededMods into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#456
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-02-17 14:58:29 +01:00
yoyosource
f524cb61dc Final fixes
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-02-17 14:57:23 +01:00
yoyosource
3f9f9546f6 Improve needed mods check
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-17 14:51:03 +01:00
8581d9e102 Merge branch 'master' into commonDB2
# Conflicts:
#	CommonCore
#	src/de/steamwar/bungeecore/commands/CheckCommand.java
2023-02-17 12:14:39 +01:00
27c241f2d4 Fix CheckCommand schematic deleted
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-17 11:54:20 +01:00
be6538c78d WIP CommonDB
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-17 11:47:58 +01:00
6e2546a596 Merge pull request 'ModCommand' (#445) from ModCommand into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#445
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-02-14 09:13:45 +01:00
01322548ef Merge branch 'master' into ModCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-12 20:34:26 +01:00
52b180468a Merge pull request 'Fix Logging of Upload schem to fix the whole thing' (#455) from schem_upload_logging into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#455
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-02-08 22:39:52 +01:00
b0eedf3944 Merge branch 'master' into ModCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-06 17:19:28 +01:00
zOnlyKroks
e3f84c0b4d Fix license header
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-06 17:19:10 +01:00
Chaoscaot
a40ad699f5 Fix Logging of Upload schem to fix the whole thing
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-05 23:42:35 +01:00
871e45ffbb WIP CommonDB
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-04 12:55:08 +01:00
be14a8cfcc Merge branch 'master' into commonDB2
# Conflicts:
#	CommonCore
2023-02-04 12:53:14 +01:00
yoyosource
0c13308997 Fix quotes
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-02-03 19:25:31 +01:00
48cdfe35f0 Fix Bugs and code problems
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-02-02 11:02:36 +01:00
yoyosource
7611abe4dc Remove BasicCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-23 18:28:12 +01:00
yoyosource
561289b5a6 Update TeamCommand (not finished)
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-23 18:15:37 +01:00
yoyosource
d559c61846 Update TeamCommand (not finished) 2023-01-23 18:00:06 +01:00
yoyosource
88ff8d8e74 Update TeamCommand (not finished)
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-23 16:37:08 +01:00
9c73ce868d WIP CommonDB 2
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-01-23 16:31:13 +01:00
be5833c0d0 WIP CommonDB 2
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-01-23 16:30:35 +01:00
zOnlyKroks
87efa9659d Fix more weird errors
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-23 15:44:31 +01:00
zOnlyKroks
7dee43c868 Resolve Merge Conflicts
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-23 15:40:42 +01:00
zOnlyKroks
39c52211a8 Merge branch 'master' into ModCommand
# Conflicts:
#	src/de/steamwar/bungeecore/listeners/ConnectionListener.java
#	src/de/steamwar/bungeecore/sql/Mod.java
2023-01-23 15:39:58 +01:00
yoyosource
a15cf2c94e Update JoinmeCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-21 22:28:46 +01:00
yoyosource
647702c0b0 Update JoinmeCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-21 22:22:55 +01:00
yoyosource
29945a351b Update EventCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-21 22:17:41 +01:00
yoyosource
9f9d082042 Update TpCommand 2023-01-21 16:49:39 +01:00
zOnlyKroks
334459b848 Smaller tweaks
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-21 16:31:19 +01:00
zOnlyKroks
24456458de Rework two commands
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-21 16:18:47 +01:00
b4ad223831 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-01-20 11:09:13 +01:00
yoyosource
527b1aee45 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-19 17:23:24 +01:00
c0536e35e2 Merge pull request 'Move BungeeCore-SQL to use CommonDB Statement backend' (#446) from commonDB1 into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#446
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2023-01-18 11:15:20 +01:00
b000745fcd Merge pull request 'Update WhoisCommand and make it public' (#447) from PublicWoisCommand into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#447
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-01-17 16:43:53 +01:00
yoyosource
95686121a7 Update WhoisCommand and make it public
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-17 16:42:50 +01:00
yoyosource
10f623b0e4 Update WhoisCommand and make it public
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-17 16:15:43 +01:00
zOnlyKroks
58fb831950 Push fixes
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-16 20:11:58 +01:00
zOnlyKroks
fc5c4922db Revert unwanted changes
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-16 20:03:33 +01:00
zOnlyKroks
fe67ad4b60 Update messanges
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-16 20:01:30 +01:00
990016aac7 Move BungeeCore-SQL to use CommonDB Statement backend
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-01-15 22:25:04 +01:00
9af9e84723 Set more sensible initial heap size for faster server startup time
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-01-15 21:19:19 +01:00
e859fe9211 Merge pull request 'Whois Fabric Mod Info' (#444) from whois_fabric_mods into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#444
Reviewed-by: Lixfel <lixfel@steamwar.de>
2023-01-15 16:42:17 +01:00
35232e63c3 Merge branch 'master' into whois_fabric_mods
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-15 16:20:23 +01:00
zOnlyKroks
5825c69fb9 Merge remote-tracking branch 'origin/whois_fabric_mods' into whois_fabric_mods
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-15 16:19:52 +01:00
zOnlyKroks
184d157276 fix illegal argument exception 2023-01-15 16:19:43 +01:00
6fc3bc9ab2 Adjust CI
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2023-01-15 12:25:54 +01:00
yoyosource
aa9bd8b00f Revert CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-13 22:18:36 +01:00
yoyosource
3303362f48 Revert CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-13 22:16:37 +01:00
zOnlyKroks
5d979310ff Fix pushed commoncore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-13 22:05:13 +01:00
zOnlyKroks
a39544abc6 Fix a minor unnecessary change
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-10 13:34:35 +01:00
zOnlyKroks
8def39d376 Finalise GUI and implement item names (not yet final)
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-10 13:27:13 +01:00
zOnlyKroks
69aa98e82e Finalise GUI and implement item names (not yet final)
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-08 14:21:29 +01:00
zOnlyKroks
60f6a9cb4c remove typo
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2023-01-06 23:41:41 +01:00
zOnlyKroks
d58ae049cf Ingamegui Working
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-06 23:41:03 +01:00
zOnlyKroks
c59da8ff49 wip ingame gui
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-06 22:11:25 +01:00
zOnlyKroks
dc234b2b33 Push fixes
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-04 20:31:31 +01:00
zOnlyKroks
e0a1542b03 Check if mod exists in database
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-04 15:15:16 +01:00
zOnlyKroks
1bec6c4cd4 Push initial implementation
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-04 12:00:27 +01:00
zOnlyKroks
93d530830d fix nullpointer
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 21:38:30 +01:00
zOnlyKroks
8b96e5d853 fix lang
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 21:33:37 +01:00
zOnlyKroks
d8d1f97790 Count total size of modlist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 18:28:47 +01:00
yoyosource
9f6db3d639 Fix some stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 18:22:19 +01:00
zOnlyKroks
b12e1ee1fa Fix a few things
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 16:18:07 +01:00
zOnlyKroks
62484dfea2 Correct message formatting
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 13:41:21 +01:00
zOnlyKroks
391859b61f Correct message formatting
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 13:39:06 +01:00
zOnlyKroks
1189ee9d77 Correct message formatting
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 13:37:45 +01:00
zOnlyKroks
cabac4f533 Revert deletion of more old unused code
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 13:35:11 +01:00
zOnlyKroks
99deeeb173 Fix formatting error + revert deletion of old code
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 13:33:09 +01:00
zOnlyKroks
798009176c fix a few small things
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-03 13:13:19 +01:00
zOnlyKroks
ed55af8952 Make it use more mod loader + add modloader + color coding
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-02 23:54:24 +01:00
zOnlyKroks
b6365d32f7 Rework whois command
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-02 13:05:52 +01:00
zOnlyKroks
abe45da57d Fix mod list array
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-01 21:05:34 +01:00
zOnlyKroks
c2a962a865 Initial whois Fabric Mod Implementation
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2023-01-01 16:19:57 +01:00
yoyosource
59854ef3f0 Add SWScriptSyntaxForwarder
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-12-25 11:53:41 +01:00
yoyosource
77811f7160 Fix CalendarCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-12-24 12:02:16 +01:00
yoyosource
4904e9b60f Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-12-17 12:29:14 +01:00
yoyosource
31253f284f Hotfix BauCommand testarena random map 2022-12-17 12:29:08 +01:00
e6d0bcc69f Disable LX
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-12-14 09:05:15 +01:00
5fd0dcae65 Fix NPC removal in Tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-12-10 12:38:07 +01:00
0c509bdfdc Test fix tablist order
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-12-10 12:30:10 +01:00
3be4da2392 Fix local Chat 1.19 - 1.19.2
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-12-10 11:25:22 +01:00
37f32033db Merge pull request 'Adapt to BungeeCord 1.19.3 API changes' (#443) from 1.19.3 into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#443
2022-12-10 01:03:28 +01:00
c8901fd58d Rebuild
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-12-10 01:02:20 +01:00
bcc5cc82d0 Adapt to BungeeCord 1.19.3 API changes
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-12-10 00:59:14 +01:00
64b4865e6f Adapt to BungeeCord 1.19.3 API changes
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-12-07 19:45:38 +01:00
yoyosource
c6235ded6e Hotfix CalendarCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-12-03 11:39:29 +01:00
15fedebff1 Merge pull request 'AdventCalendar' (#442) from AdventCalendar into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#442
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-11-27 18:54:24 +01:00
yoyosource
b2b51fa9b2 Finalize CalendarCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-25 08:05:40 +01:00
yoyosource
6b0c30c241 Finalize CalendarCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-24 17:26:29 +01:00
yoyosource
ca4a5b49dd Update calendar content
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-23 21:02:31 +01:00
yoyosource
40d10b5e39 Add message to CalendarListener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-22 16:51:13 +01:00
yoyosource
dbd9f977fd Add Listener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-22 16:44:35 +01:00
yoyosource
2e7c9e0fc7 Fix click
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-22 16:43:53 +01:00
yoyosource
e024282a20 Add CalendarListener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-22 16:39:24 +01:00
yoyosource
11a63101f1 Add CalendarCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-21 18:02:50 +01:00
yoyosource
ef11620e2f Hotfix PunishmentCommand.parseTime
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-01 23:22:24 +01:00
yoyosource
24a3885e2f Hotfix PunishmentCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-01 22:54:51 +01:00
yoyosource
24bfb12941 Hotfix TablistServer
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-11-01 22:14:19 +01:00
83839a292a Merge pull request 'Add relative punishment times' (#439) from RelativePunishments into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#439
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-10-28 10:10:12 +02:00
yoyosource
356db56da3 Hotfix weird tablist behaviour
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-25 21:14:51 +02:00
yoyosource
2b5b2c2443 Hotfix weird tablist behaviour
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-25 21:08:52 +02:00
yoyosource
c0195c1592 Add relative punishment times
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-24 18:03:01 +02:00
67a7b60bdc Merge pull request 'Add Team showcase in tablist' (#438) from TeamTablist into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#438
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-10-24 17:44:15 +02:00
yoyosource
79bd9598c7 Add Team showcase in tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-24 17:42:55 +02:00
yoyosource
fe4280f9e3 Add Team showcase in tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-24 17:30:02 +02:00
yoyosource
f2a8cb064e Add Team showcase in tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-24 17:27:19 +02:00
3606e75ab6 Merge branch 'master' into TeamTablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-24 17:17:35 +02:00
yoyosource
70a8d8e3ed Add Team showcase in tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-24 17:16:16 +02:00
e0e18cab92 No autopermaban
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-10-13 13:04:58 +02:00
2c896e204f Reduce error spam
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-10-10 16:54:05 +02:00
56cd61623d Change reader null message
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-10-07 14:14:41 +02:00
yoyosource
befae2d821 Hotfix HistoricCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-06 22:24:12 +02:00
yoyosource
e0ff7b5231 Hotfix EventRescheduleCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-10-06 22:18:15 +02:00
404462044a Test tablist with remove
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-10-02 22:56:50 +02:00
ed9aa9082d Fix 1.19 Tutorial rate
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-28 16:43:29 +02:00
435dcfceba Add lx
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-28 13:39:25 +02:00
yoyosource
a66372e5f7 Undo TypeMappers
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-24 11:27:25 +02:00
yoyosource
0296716a4e Hotfix TypeMappers
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-24 11:15:40 +02:00
yoyosource
5bfb2d5c71 Hotfix TypeMappers
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-24 11:02:37 +02:00
yoyosource
4205bce893 Hotfix BauCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-20 13:56:46 +02:00
93c96aea08 Merge pull request 'Update BauCommand' (#428) from BauCommand into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#428
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-09-20 13:17:52 +02:00
yoyosource
09cfb97e32 Add own help message
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-19 11:22:49 +02:00
yoyosource
60ed5da260 Hotfix versionselector() remove default
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-19 11:14:22 +02:00
yoyosource
3aa3776c59 Hotfix versionselector() order
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-19 11:08:33 +02:00
1e0eb5c039 Merge pull request 'Show no Chat Reports' (#436) from show_no_chat_reports into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#436
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2022-09-19 10:53:31 +02:00
yoyosource
43b123f2cf Hotfix StatCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-18 13:46:39 +02:00
Chaoscaot
4c0afb4bbd More Copyright
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-18 11:53:29 +02:00
Chaoscaot
1168f8cc86 Add Copyright
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-18 11:52:57 +02:00
Chaoscaot
a028db5462 Show no Chat Reports (Next to chat and Server List for NoChatReportsMod)
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-18 11:51:36 +02:00
yoyosource
c36a6885cf Fix merge conflicts
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-17 11:34:51 +02:00
yoyosource
47dd2503cf Merge branch 'master' into BauCommand
# Conflicts:
#	src/de/steamwar/bungeecore/commands/BauCommand.java
2022-09-17 11:33:10 +02:00
4cfb7830f9 Merge pull request '+Fixed player connect with teleport' (#435) from BauLock into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#435
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-09-17 09:30:15 +02:00
MoBrot
27ddb447fe Merge remote-tracking branch 'origin/BauLock' into BauLock
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-16 23:39:12 +02:00
MoBrot
e483e32b31 +Add BauLock copyright header 2022-09-16 23:38:55 +02:00
be41928520 Merge branch 'master' into BauLock
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-16 23:30:02 +02:00
MoBrot
3e9bd2768b +Fixed player connect with teleport
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-16 23:27:52 +02:00
yoyosource
eb8d8380d9 Update BauCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-14 17:54:25 +02:00
yoyosource
1a51e2c6a2 Merge branch 'master' into BauCommand
# Conflicts:
#	src/de/steamwar/bungeecore/commands/BauCommand.java
2022-09-14 17:47:48 +02:00
160d482392 Merge pull request 'Add BauLock' (#415) from BauLock into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#415
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-09-14 11:51:49 +02:00
MoBrot
451de152b2 +Fixed noby and IllegalArgumentException
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-13 22:52:38 +02:00
MoBrot
e5ba1ad633 Merge remote-tracking branch 'origin/BauLock' into BauLock
# Conflicts:
#	src/de/steamwar/bungeecore/commands/BauCommand.java
2022-09-13 22:36:27 +02:00
338772c002 Merge pull request 'BauLock2' (#432) from BauLock2 into BauLock
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Reviewed-on: SteamWar/BungeeCore#432
2022-09-13 22:35:17 +02:00
f9f0f83779 Don't kick players
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-13 22:34:59 +02:00
MoBrot
133f795c8f Merge remote-tracking branch 'origin/BauLock' into BauLock 2022-09-13 22:07:09 +02:00
093b861342 Merge pull request 'Fix Double Bans' (#434) from fix_double_bans into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#434
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-09-12 17:56:22 +02:00
Chaoscaot
02c81068e7 Fix Double Bans
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-12 17:54:42 +02:00
85c5201c82 Fix language
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-11 20:10:17 +02:00
6c9f9d17f8 Merge pull request 'Whois Fixes' (#433) from whois_fix into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#433
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-09-11 20:05:18 +02:00
Chaoscaot
2919283963 Whois Fixes
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-11 20:04:24 +02:00
7377f5513a Fix several issues
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-11 18:34:50 +02:00
fd1efaa22b Fix case sensitivity
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-11 18:16:06 +02:00
29a30ec5bb Fix missing return
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-11 18:11:58 +02:00
e83b399593 Fix wrong CommonDB
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-11 18:09:23 +02:00
3e1d60245a Fix fatal issues
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-11 18:08:42 +02:00
39562c9923 Merge pull request 'Bump JDA & close Inpustream' (#431) from fix_bot_upload into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#431
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-09-11 15:29:36 +02:00
Chaoscaot
1af7b03987 Bump JDA & close Inpustream
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-11 15:28:37 +02:00
197180631f Merge pull request 'Add current infos to Whois' (#430) from more_whois into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#430
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-09-11 15:02:42 +02:00
Chaoscaot
d7530cae86 Add current infos to Whois
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-09 20:38:37 +02:00
yoyosource
eee3dba1de Simplify arena map typemapper
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-09 16:35:05 +02:00
yoyosource
6206a80cc1 Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-09 16:11:39 +02:00
yoyosource
9e579ee3d6 Hotfix case sensitive maps 2022-09-09 16:11:34 +02:00
1cbec668d1 Merge branch 'master' into BauLock
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
# Conflicts:
#	src/de/steamwar/bungeecore/commands/HelpCommand.java
2022-09-09 15:49:04 +02:00
6ab0d3d983 Remove could not decode from ErrorLogger
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-09 08:40:55 +02:00
MoBrot
d4cd8a16a0 +Removed not used if statement 2022-09-08 21:32:41 +02:00
MoBrot
9a5b938fba +Fixed Owner message when locked
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-08 21:28:21 +02:00
MoBrot
fe0d0eaffb +Add Owner message when bau is locked for Team
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-08 20:49:17 +02:00
yoyosource
42898b0d4d Hotfix npe
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-08 19:45:20 +02:00
yoyosource
88724c75e3 Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-08 18:24:38 +02:00
yoyosource
e3e68af80f Hotfix ServerTeamchatCommand 2022-09-08 18:24:31 +02:00
3d958800fc Remove sorted checker in fabric
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-08 17:29:25 +02:00
150cf78607 Merge pull request 'Overload protection' (#429) from overloadProtection into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#429
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2022-09-06 20:51:14 +02:00
yoyosource
19c02ad786 Merge remote-tracking branch 'origin/overloadProtection' into BauCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-06 20:06:03 +02:00
43d5cb47bb Overload protection
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-09-06 19:08:00 +02:00
yoyosource
4c44bc0a83 Update BauCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-06 17:13:15 +02:00
yoyosource
2676f97cfb Hotfix TypeMappers
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-06 16:45:56 +02:00
baef387fdb Merge pull request 'Commands' (#427) from Commands into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#427
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-09-06 15:44:36 +02:00
yoyosource
16c3f93741 Fix stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-06 15:36:27 +02:00
yoyosource
2325190cf1 Fix stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-03 14:33:00 +02:00
MoBrot
ef6435b176 +Fix BauCommand.setLocked
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
+Fix BauCommand.isLocked
+Update BauLockState.NONE to BauLockState.NOBODY
+Move Userconfig.getUserLockState to BauCommand
2022-09-02 14:27:27 +02:00
yoyosource
669375e751 Update ChallengeCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Update FightCommand
Update HistoricCommand
2022-09-01 18:39:08 +02:00
yoyosource
7de6402a63 Update ChallengeCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-09-01 18:24:56 +02:00
yoyosource
cb591fda59 WIP
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-09-01 18:01:51 +02:00
e58fe20082 Merge pull request 'Improve Blocked Logging' (#426) from improve_blocked_logging into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#426
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-08-29 14:35:48 +02:00
Chaoscaot
d14d748911 Improve Blocked Logging
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-08-29 14:33:34 +02:00
f5675811ba Hotfix join permissions
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-28 08:43:07 +02:00
f1f159a330 Finish BuilderCloud command
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-27 18:01:16 +02:00
143a9aed4a Merge pull request 'Added BuilderCloudCommand' (#414) from BuilderCloud into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#414
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2022-08-27 17:51:03 +02:00
6b89afd07d Finish BuilderCloud command
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-27 17:16:02 +02:00
d17a4f882e Merge branch 'master' into BuilderCloud 2022-08-27 14:27:50 +02:00
bd86c81e7f Merge pull request 'Fix tablist failure on softreload' (#424) from fixSoftreload into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#424
Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
2022-08-23 22:14:28 +02:00
a6407d6bb0 Fix tablist failure on softreload
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-23 18:10:52 +02:00
d232d18fda Merge pull request 'Fix 7/ replacer' (#423) from fix7replacer into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#423
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2022-08-23 17:31:17 +02:00
b76164ac8d Merge pull request 'Add english aliases' (#422) from multilingAliases into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#422
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2022-08-23 17:22:32 +02:00
4217afef59 Fix 7/ replacer
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-23 17:21:49 +02:00
a27f74af56 Fix build
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-23 16:59:53 +02:00
a782f811fc Add english aliases
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-23 16:57:19 +02:00
yoyosource
5c127e0887 Rebuild
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-08-22 21:10:35 +02:00
yoyosource
3f99585b35 Rebuild
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-08-22 21:09:27 +02:00
yoyosource
e29fb553f0 Remove deprecated guard api
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-08-22 20:25:36 +02:00
yoyosource
6d717eb1b0 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-08-22 18:43:59 +02:00
yoyosource
3550b2c4fd Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-08-22 18:43:45 +02:00
yoyosource
c4204cd54d Update CommonCore 2022-08-22 18:43:36 +02:00
ea94195db8 Fix folder inconsistencies
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-22 16:07:21 +02:00
e4cd94aecd Fix lobbyconnection on disconnect
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-22 14:31:04 +02:00
b8404a74a7 Update to paper 1.19.2
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-22 06:50:53 +02:00
328d904f69 Merge pull request 'Bye Bye Mail.' (#421) from emaillessWeb into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#421
Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
2022-08-20 19:37:03 +02:00
bd1420cc90 Bye Bye Mail.
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-20 19:35:46 +02:00
5cf577c9e5 Bye Bye Mail.
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-20 19:22:21 +02:00
11106ab240 Bye Bye Mail.
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-20 19:15:28 +02:00
43a9b92b41 Bye Bye Mail.
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-20 19:10:26 +02:00
698f710138 Use /servers for server starts
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-20 18:15:02 +02:00
9439890131 Ignore took ms to process event in db
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-20 11:23:42 +02:00
yoyosource
abf4224788 Update WhoisCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-08-16 18:25:16 +02:00
MoBrot
c2211bdedf Add HelCommand for /bau lock
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Add HelCommand for /bau unlock
2022-08-14 00:11:18 +02:00
MoBrot
39b63198d5 Add BungeeCore_de.properties "BAU_LOCKED_OPTIONS" Color correction
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Add BungeeCore.properties "BAU_LOCKED_OPTIONS" Color correction
2022-08-13 22:23:29 +02:00
MoBrot
19dad58712 Replace BauLock to UserConfig
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Update BauLockState.ALL to BauLockState.NONE
Add "BAU_LOCKED_OPTIONS" in BungeeCore_de.properties
Add "BAU_LOCKED_OPTIONS" in BungeeCore.properties
2022-08-13 21:18:54 +02:00
MoBrot
386395725d Add BauLock
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Add BauCommand.isLocked
Add BauLockState
Add "BAU_LOCKED" and "BAU_UNLOCKED" in BungeeCore_de.properties
Add "Bau_LOCKED" and "BAU_UNLOCKED" in BungeeCore.properties
2022-08-10 19:20:33 +02:00
e2f2968813 Close inventory on world reset
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-05 12:02:08 +02:00
d2d8bc0bf8 1.19.1 Buildserver
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-05 08:14:15 +02:00
dfab5e7630 1.19.1 Buildserver
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-04 17:48:54 +02:00
8599df7e4e Fix CI again
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-04 17:10:17 +02:00
2f90bc2541 Fix CI
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-04 17:06:12 +02:00
a2f6a2c6ae 1.19.1 Support, API update
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-08-04 17:01:40 +02:00
MoBrot
229cf77035 Added BuilderCloudCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Added BungeeCore.properties message
Added BungeeCore_de.properties message
Added ServerStarter for the BuilderCloud
2022-07-28 18:00:02 +02:00
32bd46c97d Fix arena
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-22 10:25:14 +02:00
b562f1a24c Merge pull request 'CommandArena' (#373) from CommandArena into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#373
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-07-22 08:53:21 +02:00
3266a2fdd0 Fix Command19
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-21 12:25:14 +02:00
8aaad8647f Fix Command19
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-21 12:12:36 +02:00
0e376456e8 Potential tp fix, added link descriptor, MWG 1.19 build servers
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-21 11:31:53 +02:00
yoyosource
8bcefb102c Update ArenaCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-07-18 16:19:48 +02:00
yoyosource
183248c0b1 Update ArenaCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-07-17 20:38:59 +02:00
yoyosource
93757ff86e Merge branch 'master' into CommandArena 2022-07-17 20:34:19 +02:00
621c95b525 Merge pull request 'Fix local colorcodes' (#413) from colorFix into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#413
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2022-07-17 17:42:44 +02:00
e30f4cc2ee Fix strip
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-17 17:36:27 +02:00
3a54797d07 Use strip
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-17 17:34:15 +02:00
3053d5d301 Fix empty messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-17 17:31:11 +02:00
b80827ed1e Fix local colorcodes
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-17 17:12:48 +02:00
c79f49b166 Remove OpenJDK
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-17 16:31:55 +02:00
cfa1ccc4b8 Test 1.19 OpenJDK
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-15 22:57:35 +02:00
7e2f1f244d Remove lib
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-02 10:04:59 +02:00
66e97321ae To maven repo
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-07-01 21:40:18 +02:00
yoyosource
92cc4cf897 Fix TpCommand for teamserver
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-27 15:41:05 +02:00
yoyosource
4503ffce2e Fix TpCommand for teamserver
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-27 15:38:37 +02:00
yoyosource
d96d3caa43 Fix TpCommand for teamserver
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-27 15:35:58 +02:00
yoyosource
f26fd7a700 Fix TpCommand for teamserver
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-27 15:33:24 +02:00
yoyosource
2ce64e2203 Fix TpCommand for teamserver
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-27 15:27:30 +02:00
yoyosource
732ad43e23 Fix TpCommand for teamserver
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-27 15:25:06 +02:00
yoyosource
4b8950b369 Fix DevCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-26 17:45:23 +02:00
yoyosource
5c605df926 Fix TpCommand again
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-26 16:23:08 +02:00
yoyosource
c8cf039987 Fix TpCommand again
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-26 16:21:23 +02:00
yoyosource
61fff5ba08 Hotfix TpCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-26 16:17:44 +02:00
yoyosource
a6642d3d14 Update RCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-24 21:10:15 +02:00
0cd68d8ddc Fix tablist order
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-23 15:15:00 +02:00
b4fb2dcedf Merge pull request 'Add schem deadline message to /event' (#359) from deadline into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#359
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-23 10:02:48 +02:00
e327c939f7 Cleanup branch
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-23 10:00:26 +02:00
148067e42b Merge remote-tracking branch 'origin/deadline' into deadline
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-23 09:57:49 +02:00
yoyosource
7302dd715c Update deadline 2022-06-23 09:57:13 +02:00
yoyosource
4d8771eba1 Rebase onto master 2022-06-23 09:56:56 +02:00
yoyosource
e7b7cc01bc Add schem deadline message to /event 2022-06-23 09:56:51 +02:00
yoyosource
352497f658 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-21 22:23:43 +02:00
yoyosource
1938eeefff Add TabCompletionCache invalidation
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-21 22:22:54 +02:00
d507ca5df2 Merge pull request 'Optimize MsgCommand' (#410) from OptimizeMSGAndRCommand into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#410
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-20 13:08:51 +02:00
a34d847b3a Merge branch 'master' into OptimizeMSGAndRCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-20 12:31:43 +02:00
1f1dcff9b5 Fix chat spoofing
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-19 15:24:06 +02:00
52e3da1e6e Move network to own threads
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-19 13:00:23 +02:00
c30542970e Fix npcs #4
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 19:04:09 +02:00
cc6860b0a5 Fix npcs #3
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 19:01:29 +02:00
78e602fd26 Fix npcs #3
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 18:59:14 +02:00
c2338fe3d0 Fix npcs #2
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 18:55:34 +02:00
593fe7389b Fix npcs, revert failed fix
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 17:31:57 +02:00
cc01a4132d Test fix tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 16:07:06 +02:00
129e41cb77 Merge pull request 'Tablist' (#411) from tablist into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#411
Reviewed-by: Chaoscaot <chaoscaot444@gmail.com>
2022-06-18 15:31:48 +02:00
64567c1556 Fix softreload issues
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 14:32:25 +02:00
eb469896f9 Remove unnecessary put
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 14:17:38 +02:00
f7fbefec82 Make Tablist softreloadable
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 14:15:48 +02:00
616062354f Fixes, working
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 14:07:00 +02:00
f2ed575f8c Untested full tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 13:17:23 +02:00
2e17c380f0 Merge remote-tracking branch 'origin/tablist' into tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-18 13:16:58 +02:00
598dfcd8a0 Current tablist
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 13:16:44 +02:00
9703e9ea33 WIP new tablist
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-18 13:16:40 +02:00
eed24006fb Current tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-17 20:43:36 +02:00
yoyosource
1ce88d071c Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-17 09:53:30 +02:00
yoyosource
eb81ffc9d8 Optimize MsgCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Optimize RCommand
2022-06-17 09:53:04 +02:00
yoyosource
bbb0f99382 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 23:10:59 +02:00
yoyosource
81913953d8 Update MsgCommand and RCommand to new Validator API
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-16 23:10:27 +02:00
yoyosource
5eaa87885d Hotfix SWCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 22:53:25 +02:00
yoyosource
c6a68fa2a1 Hotfix SWCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 22:27:45 +02:00
yoyosource
6192fd98c7 Hotfix SWCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 22:25:00 +02:00
yoyosource
059a945867 Hotfix SWCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 22:18:44 +02:00
yoyosource
c97233b68b Hotfix SWCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 22:14:40 +02:00
yoyosource
cc839859a8 Hotfix SWCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 22:11:24 +02:00
yoyosource
742bc92f53 Hotfix WhoisCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 22:05:39 +02:00
yoyosource
cccba31c46 Hotfix SWCommand on hover
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 21:09:50 +02:00
yoyosource
49043c4b0c Fix TutorialCommand help messages
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 21:03:04 +02:00
yoyosource
146756c299 Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 20:54:22 +02:00
yoyosource
9b1a394cb2 Fix empty MsgCommand and RCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 20:54:07 +02:00
yoyosource
789bb62a14 Add Validator
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Update CommonCore
2022-06-16 20:41:52 +02:00
0da2383adb Merge branch 'master' into tablist 2022-06-16 14:45:37 +02:00
a4ad028f72 Fix imports
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-16 13:35:25 +02:00
7b06c64118 Merge branch 'master' into tablist
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-16 13:34:56 +02:00
dd9651d6c8 Merge pull request 'Update VerifyCommand' (#407) from CommandVerify into master
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Reviewed-on: SteamWar/BungeeCore#407
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:33:56 +02:00
d6e941bf72 Merge pull request 'Update WebregisterCommand' (#408) from CommandWebregister into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#408
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:33:09 +02:00
e156d3ad4a Merge pull request 'Update WhoisCommand' (#409) from CommandWhois into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#409
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:32:22 +02:00
7c1925ad71 Merge pull request 'Update UnIgnoreCommand' (#406) from CommandUnIgnore into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#406
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:30:54 +02:00
3299620cd6 Merge pull request 'Update TutorialCommand' (#405) from CommandTutorial into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#405
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:30:30 +02:00
adee8f565b Merge pull request 'Update StatCommand' (#402) from CommandStat into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#402
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:26:49 +02:00
01c721a753 Merge pull request 'Update SetLocaleCommand' (#401) from CommandSetLocale into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#401
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:26:27 +02:00
c3b3559875 Merge pull request 'Update ServerTeamchatCommand' (#400) from CommandServerTeamchat into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#400
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:25:54 +02:00
f00d1dc540 Merge pull request 'Update ServerSwitchCommand' (#399) from CommandServerSwitch into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#399
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:25:30 +02:00
c1a721cf4d Merge pull request 'Update PollCommand' (#392) from CommandPoll into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#392
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:24:40 +02:00
60ca6fde85 Merge pull request 'Update ReplayCommand' (#398) from CommandReplay into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#398
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:24:08 +02:00
ecb3723c7c Merge pull request 'Update RegelnCommand' (#397) from CommandRegeln into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#397
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:23:52 +02:00
6bcafde70c Merge pull request 'Update RankCommand' (#396) from CommandRank into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#396
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:23:28 +02:00
90c1208cf5 Merge pull request 'Update RCommand' (#395) from CommandR into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#395
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:22:55 +02:00
5c534305d9 Merge pull request 'Update PunishmentCommand' (#394) from CommandPunishment into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#394
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:22:34 +02:00
f2a537da90 Merge pull request 'Update PollresultCommand' (#393) from CommandPollresult into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#393
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:17:45 +02:00
8ae6e90628 Merge pull request 'Update PlaytimeCommand' (#391) from CommandPlaytime into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#391
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:14:58 +02:00
7f5ef05235 Merge pull request 'Update PingCommand' (#390) from CommandPing into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#390
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:14:36 +02:00
7c898ac869 Merge pull request 'Update MsgCommand' (#389) from CommandMsg into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#389
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:14:14 +02:00
d55e2abdb4 Merge pull request 'Update LocalCommand' (#388) from CommandLocal into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#388
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:13:42 +02:00
734e8fc6c5 Merge pull request 'Update ListCommand' (#387) from CommandList into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#387
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:13:24 +02:00
045b693c92 Merge pull request 'Update KickCommand' (#386) from CommandKick into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#386
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:13:02 +02:00
0e430fee9b Merge pull request 'Update IgnoreCommand' (#384) from CommandIgnore into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#384
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:11:18 +02:00
5bfac6c7b5 Merge pull request 'Update GDPRQuery' (#382) from CommandGDPRQuery into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#382
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:10:27 +02:00
1bfdecd6b0 Merge pull request 'Update EventreloadCommand' (#380) from CommandEventreload into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#380
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:03:28 +02:00
2aee854b5c Merge pull request 'Update EventRescheduleCommand' (#379) from CommandEventReschedule into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#379
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:02:13 +02:00
41f89f5f0a Merge pull request 'Update CheckCommand' (#377) from CommandCheck into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#377
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:00:46 +02:00
e46f68558a Merge pull request 'Update DevCommand' (#378) from CommandDev into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#378
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 13:00:32 +02:00
dfb6f89b35 Merge pull request 'Update BugCommand' (#375) from CommandBug into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#375
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 12:50:48 +02:00
df9f6e44e3 Merge pull request 'Update AlertCommand' (#372) from CommandAlert into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#372
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-16 12:39:52 +02:00
yoyosource
4766e0ab96 Update WhoisCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 12:21:46 +02:00
yoyosource
d64a483bb6 Update WebregisterCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 12:19:23 +02:00
yoyosource
99807470ec Update VerifyCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-16 12:18:15 +02:00
yoyosource
595929f4b2 Update UnIgnoreCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 12:17:01 +02:00
yoyosource
9e867a7457 Update TutorialCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 12:15:50 +02:00
yoyosource
29ed8b16b8 Update StatCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 11:19:50 +02:00
yoyosource
4cd0150042 Update SetLocaleCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-16 11:19:03 +02:00
yoyosource
b4b46b56a4 Update ServerTeamchatCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 11:18:13 +02:00
yoyosource
160136833e Update ServerSwitchCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-16 11:16:47 +02:00
yoyosource
279577a536 Update ReplayCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 11:15:43 +02:00
yoyosource
67d816e90b Update RegelnCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 11:10:19 +02:00
yoyosource
84ead29ddb Update RCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-16 11:09:24 +02:00
yoyosource
21f020e13d Update RankCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-16 11:08:12 +02:00
yoyosource
e4c07bc211 Update PunishmentCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 11:04:59 +02:00
yoyosource
a7541dc0c3 Update PollresultCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-16 10:57:12 +02:00
41a5c3b207 Merge branch 'master' into tablist
# Conflicts:
#	src/de/steamwar/bungeecore/BungeeCore.java
2022-06-15 21:36:56 +02:00
yoyosource
fd14666880 Update PollCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-15 20:18:31 +02:00
yoyosource
4134e564cc Update PlaytimeCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-15 20:12:25 +02:00
yoyosource
6c301c987d Update PingCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-15 20:11:21 +02:00
yoyosource
9f5e714912 Update MsgCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-15 20:10:09 +02:00
yoyosource
7236885590 Update LocalCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-15 20:07:29 +02:00
yoyosource
c6f9019ce3 Update ListCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-15 20:06:21 +02:00
yoyosource
19616aef84 Update KickCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-15 20:04:43 +02:00
f2006dd218 Merge branch 'master' into deadline
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
# Conflicts:
#	CommonCore
2022-06-15 18:07:38 +02:00
yoyosource
082656e3ee Update deadline
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-15 17:38:30 +02:00
yoyosource
8a21d5c93d Enable SWTSI again
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 22:53:22 +02:00
yoyosource
4fc0e69a47 Update IgnoreCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 21:56:04 +02:00
yoyosource
99f5fbc3b8 Update GDPRQuery
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 21:49:20 +02:00
yoyosource
d85b93364e Update EventRescheduleCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 21:42:05 +02:00
yoyosource
d0ac81aa93 Update EventreloadCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 21:31:48 +02:00
yoyosource
568f1bf598 Update DevCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-14 21:30:55 +02:00
yoyosource
d94080a0cb Update CheckCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-14 21:20:45 +02:00
yoyosource
546e507939 Update BugCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-14 20:46:13 +02:00
yoyosource
5c55bdacde Add tab completion to ArenaCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 20:16:36 +02:00
yoyosource
ae2a1d5779 Update ArenaCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 20:10:07 +02:00
yoyosource
08fdc1603e Update AlertCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 20:03:40 +02:00
8823368f0d CI Rebuild
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-14 19:44:18 +02:00
d83b6564d4 CI Rebuild
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-14 19:41:50 +02:00
46ae99f10d Merge pull request 'Fix some stuff for later use' (#371) from CommandAPI into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#371
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-14 19:32:34 +02:00
yoyosource
8a417e32c1 Fix some stuff for later use
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 18:19:25 +02:00
yoyosource
22ef3cd13d Fix some stuff for later use
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 18:16:44 +02:00
2cd808b8aa Merge branch 'master' into deadline
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 18:12:21 +02:00
60f4db4702 Merge pull request 'Add SWCommand and corresponding api' (#370) from CommandAPI into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#370
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-14 17:23:29 +02:00
7b5359b558 Merge branch 'master' into deadline
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 16:24:49 +02:00
yoyosource
a0ae828fbd Add SWCommand and corresponding api
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 16:18:45 +02:00
0f58e89d24 Merge pull request 'Add ServerMetaInfo' (#369) from AddMetaInfo into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#369
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-14 16:13:58 +02:00
yoyosource
bf4f7c6adf Add ServerMetaInfo
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 15:47:11 +02:00
7aadaa2df3 Fix communication
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-14 09:32:43 +02:00
b285585608 Fix packet direction
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-14 09:09:59 +02:00
03462b0900 Merge branch 'master' into deadline
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 09:08:38 +02:00
yoyosource
584b8197aa Merge branch 'master' into deadline
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-14 09:08:12 +02:00
07cb11e12b Fix SWInventory
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-14 09:08:05 +02:00
571fa8c7d1 Fix concurrency, fix cast
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-14 08:56:09 +02:00
98079a2331 Merge pull request 'Bungee Network' (#362) from network into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#362
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-14 08:50:04 +02:00
533f0a4269 Fix copyright
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-14 08:37:32 +02:00
41d27c567d Merge branch 'master' into network
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
# Conflicts:
#	src/de/steamwar/bungeecore/listeners/TablistManager.java
2022-06-14 08:28:10 +02:00
d05af2258b Fix translation
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-13 22:38:09 +02:00
9df8493b77 Merge pull request 'Cannot spoof chat my ass' (#368) from spoofChat into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#368
Reviewed-by: Chaoscaot <chaoscaot444@gmail.com>
2022-06-13 22:13:57 +02:00
0446af29aa Cannot spoof chat my ass
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-13 22:10:10 +02:00
c2544e44fc WIP new tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-13 21:04:24 +02:00
yoyosource
3a97baa267 Add debug messages for fabric checks
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-12 18:22:33 +02:00
yoyosource
8267966409 Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-12 18:17:51 +02:00
yoyosource
3d57f9ca80 Add debug messages for fabric checks 2022-06-12 18:17:44 +02:00
8e4729aab0 Merge pull request '1.19 Build server' (#366) from bau19 into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#366
Reviewed-by: YoyoNow <jwsteam@nidido.de>
2022-06-11 20:41:18 +02:00
Chaoscaot
e49546d3d8 Fix Remote Plugin Messages
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-11 09:44:39 +02:00
Chaoscaot
a97a6a78e2 Fix Remote Plugin Messages
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-11 08:55:51 +02:00
01ea928652 1.19 Build server
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-10 19:30:15 +02:00
1ef5f9e625 Merge pull request 'ConvertFromWaterfall' (#363) from ConvertFromWaterfall into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#363
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-08 16:54:22 +02:00
c5ae7fd229 Merge branch 'master' into ConvertFromWaterfall
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-08 16:53:01 +02:00
69c325cf17 Merge pull request 'FixBungeeTablistPlus' (#364) from FixBungeeTablistPlus into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#364
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-08 16:19:06 +02:00
2f06ea374e Simplify connection detection
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-08 16:18:04 +02:00
yoyosource
6769fd88e7 Fix TablistManager
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-08 16:06:31 +02:00
yoyosource
f63213c9aa Fix build.gradle
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-08 16:05:17 +02:00
yoyosource
bad4efd520 Convert everything from waterfall to plain bungee
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
2022-06-08 13:28:56 +02:00
yoyosource
9439887785 Fix TablistManager for newer BTLP plugin
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-08 13:18:24 +02:00
yoyosource
27750d4e71 Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-07 22:38:29 +02:00
yoyosource
1a91e561fa Disable SWTSI for now 2022-06-07 22:38:08 +02:00
Chaoscaot
446b4ad519 Bungee Network
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-07 20:53:09 +02:00
59672e8d02 Merge pull request 'Using sql connections in round robbin mode instead of the same (possibly)' (#361) from sql into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: SteamWar/BungeeCore#361
Reviewed-by: Lixfel <lixfel@steamwar.de>
2022-06-07 14:14:21 +02:00
c74b2b2c84 Fix settings changed npe
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-07 14:13:51 +02:00
9f7f5eef36 Test fix ban timeout
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-04 22:49:07 +02:00
6d0a1f6bfd Fix geyser floodgate null
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
2022-06-04 16:23:13 +02:00
dea8e0b731 Merge branch 'master' into sql
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-03 22:25:37 +02:00
yoyosource
d4e2e80dd5 Hotfix WhoisCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-03 13:26:03 +02:00
yoyosource
edfbfb614d Hotfix WhoisCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-03 13:24:47 +02:00
yoyosource
bb68a4a690 Using sql connections in round robbin mode instead of the same (possibly)
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-02 17:08:29 +02:00
yoyosource
e61a98c2a3 Update some stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-01 23:19:30 +02:00
yoyosource
abc775009e Merge branch 'master' into deadline
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-06-01 23:15:23 +02:00
yoyosource
163e40f2dd Fix ErrorLogger
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-05-30 15:35:51 +02:00
yoyosource
e3783c4bfe Fix ErrorLogger
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-05-30 15:34:58 +02:00
yoyosource
3713f828b2 Add schem deadline message to /event
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-05-30 12:16:07 +02:00
yoyosource
2fb2fbc781 Add arg to replay command for direct selection of map
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2022-05-30 11:31:15 +02:00
272 geänderte Dateien mit 12969 neuen und 15075 gelöschten Zeilen

5
.gitignore vendored
Datei anzeigen

@ -9,7 +9,4 @@ steamwar.properties
# IntelliJ IDEA
.idea
*.iml
# Other
lib
*.iml

Datei anzeigen

@ -1,23 +0,0 @@
# Building
Building SteamWar.de software requires certain libraries,
which cannot be provided over traditional ways (like maven)
due to copyright issues with compiled Spigot packages.
For building these libraries have to be named in a lib
directory named like in the following list.
A subset of the following libraries is required to build this software
(this is the list for being able to build all SteamWar.de software):
- BungeeCord.jar https://ci.md-5.net/job/BungeeCord/
- BungeeTabListPlus.jar https://www.spigotmc.org/resources/bungeetablistplus.313/
- PersistentBungeeCore.jar https://steamwar.de/devlabs/SteamWar/PersistentBungeeCore
- ProtocolLib.jar https://www.spigotmc.org/resources/protocollib.1997/
- Spigot-1.8.jar https://hub.spigotmc.org/jenkins/job/BuildTools/ (1.8.9)
- Spigot-1.9.jar https://hub.spigotmc.org/jenkins/job/BuildTools/ (1.9.4)
- Spigot-1.10.jar https://hub.spigotmc.org/jenkins/job/BuildTools/ (1.10.2)
- Spigot-1.12.jar https://hub.spigotmc.org/jenkins/job/BuildTools/ (1.12.2)
- Spigot-1.14.jar https://hub.spigotmc.org/jenkins/job/BuildTools/ (1.14.4)
- Spigot-1.15.jar https://hub.spigotmc.org/jenkins/job/BuildTools/ (1.15.2)
- SpigotCore.jar https://steamwar.de/devlabs/SteamWar/SpigotCore
- WorldEdit-1.12.jar https://dev.bukkit.org/projects/worldedit/files (6.1.9)
- WorldEdit-1.15.jar https://dev.bukkit.org/projects/worldedit/files (newest)

@ -1 +1 @@
Subproject commit 0f03b57e437c1d843816b7202d95b79ff0a8d2df
Subproject commit d000b8687d93eb43520bbf6685281099055eab9f

55
Persistent/build.gradle Normale Datei
Datei anzeigen

@ -0,0 +1,55 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
id 'java'
}
group 'de.steamwar'
version ''
compileJava.options.encoding = 'UTF-8'
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
sourceSets {
main {
java {
srcDirs = ['src/']
include '**/*.java', '**/*.kt'
}
resources {
srcDirs = ['src/']
exclude '**/*.java', '**/*.kt'
}
}
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.32'
testCompileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.32'
compileOnly 'de.steamwar:velocity:RELEASE'
annotationProcessor 'com.velocitypowered:velocity-api:3.3.0-SNAPSHOT'
}

Datei anzeigen

@ -0,0 +1,37 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.persistent;
import lombok.Getter;
@Getter
public class Arenaserver extends Subserver {
private final String mode;
private final String map;
private final boolean allowMerge;
public Arenaserver(String serverName, String mode, String map, boolean allowMerge, int port, ProcessBuilder processBuilder, Runnable shutdownCallback) {
super(Servertype.ARENA, serverName, port, processBuilder, shutdownCallback, null);
this.mode = mode;
this.map = map;
this.allowMerge = allowMerge;
}
}

Datei anzeigen

@ -0,0 +1,60 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.persistent;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.function.Consumer;
@Getter
public class Bauserver extends Subserver {
private static final Map<UUID, Bauserver> servers = new HashMap<>();
public static Bauserver get(UUID owner) {
synchronized (servers) {
return servers.get(owner);
}
}
private final UUID owner;
public Bauserver(String serverName, UUID owner, int port, ProcessBuilder processBuilder, Runnable shutdownCallback){
this(serverName, owner, port, processBuilder, shutdownCallback, null);
}
public Bauserver(String serverName, UUID owner, int port, ProcessBuilder processBuilder, Runnable shutdownCallback, Consumer<Exception> failureCallback){
super(Servertype.BAUSERVER, serverName, port, processBuilder, shutdownCallback, failureCallback);
this.owner = owner;
synchronized (servers) {
servers.put(owner, this);
}
}
@Override
protected void unregister() {
synchronized (servers) {
servers.remove(owner);
}
super.unregister();
}
}

Datei anzeigen

@ -0,0 +1,59 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.persistent;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
@Getter
public class Builderserver extends Subserver {
private static final Map<String, Builderserver> servers = new HashMap<>();
public static Builderserver get(String map) {
synchronized (servers) {
return servers.get(map);
}
}
private final String map;
public Builderserver(String serverName, String map, int port, ProcessBuilder processBuilder, Runnable shutdownCallback){
this(serverName, map, port, processBuilder, shutdownCallback, null);
}
public Builderserver(String serverName, String map, int port, ProcessBuilder processBuilder, Runnable shutdownCallback, Consumer<Exception> failureCallback){
super(Servertype.BUILDER, serverName, port, processBuilder, shutdownCallback, failureCallback);
this.map = map;
synchronized (servers) {
servers.put(map, this);
}
}
@Override
protected void unregister() {
synchronized (servers) {
servers.remove(map);
}
super.unregister();
}
}

Datei anzeigen

@ -0,0 +1,203 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.persistent;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Module;
import com.google.inject.name.Names;
import com.mojang.brigadier.Command;
import com.velocitypowered.api.command.BrigadierCommand;
import com.velocitypowered.api.command.CommandManager;
import com.velocitypowered.api.command.CommandMeta;
import com.velocitypowered.api.event.EventManager;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.plugin.PluginContainer;
import com.velocitypowered.api.plugin.PluginDescription;
import com.velocitypowered.api.plugin.PluginManager;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.scheduler.ScheduledTask;
import com.velocitypowered.proxy.plugin.PluginClassLoader;
import com.velocitypowered.proxy.plugin.VelocityPluginManager;
import com.velocitypowered.proxy.plugin.loader.VelocityPluginContainer;
import com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader;
import lombok.Getter;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import java.io.IOException;
import java.nio.file.Path;
import java.util.NoSuchElementException;
import java.util.ResourceBundle;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
@Plugin(
id = "persistentvelocitycore",
name = "PersistentVelocityCore"
)
public class Persistent {
private static final Reflection.Method<VelocityPluginManager> registerPlugin = new Reflection.Method<>(VelocityPluginManager.class, "registerPlugin", PluginContainer.class);
@Getter
private static Persistent instance;
@Getter
private final ProxyServer proxy;
@Getter
private final Logger logger;
private final Path directory;
@Inject
public Persistent(ProxyServer proxy, Logger logger, @DataDirectory Path dataDirectory) {
instance = this;
this.proxy = proxy;
this.logger = logger;
this.directory = dataDirectory;
}
@Subscribe
public void onEnable(ProxyInitializeEvent event) {
proxy.getCommandManager().register(
new BrigadierCommand(
BrigadierCommand.literalArgumentBuilder("softreload")
.requires(commandSource -> commandSource.hasPermission("bungeecore.softreload"))
.executes(commandContext -> softreload())
.build()
)
);
}
@Subscribe
public void onDisable(ProxyShutdownEvent event) {
Subserver.shutdown();
}
public int softreload() {
PluginContainer container = null;
ReloadablePlugin plugin = null;
try {
container = proxy.getPluginManager().getPlugin("velocitycore").orElseThrow();
plugin = (ReloadablePlugin) container.getInstance().orElseThrow();
} catch (NoSuchElementException e) {
logger.log(Level.WARNING, "Could not find loaded VelocityCore, continuing without unloading.");
}
PluginContainer newContainer;
try {
newContainer = prepareLoad();
} catch (Exception e) {
logger.log(Level.SEVERE, "Could not instantiate new VelocityCore, aborting softreload.", e);
return Command.SINGLE_SUCCESS;
}
broadcast("§eNetwork update is starting§8.");
try {
if(container != null && plugin != null) {
plugin.onProxyShutdown(new ProxyShutdownEvent());
unload(container, plugin);
}
registerPlugin.invoke((VelocityPluginManager) proxy.getPluginManager(), newContainer);
((ReloadablePlugin) newContainer.getInstance().orElseThrow()).onProxyInitialization(new ProxyInitializeEvent());
} catch (Throwable t) {
logger.log(Level.SEVERE, "Error during softreload", t);
broadcast("§cNetwork update failed§8, §cexpect network restart soon§8.");
return Command.SINGLE_SUCCESS;
}
broadcast("§eNetwork update complete§8.");
return Command.SINGLE_SUCCESS;
}
private void broadcast(String message) {
Component component = LegacyComponentSerializer.legacySection().deserialize("§eSteam§8War» " + message);
proxy.getAllPlayers().forEach(player -> player.sendMessage(component));
proxy.getConsoleCommandSource().sendMessage(component);
}
private PluginContainer prepareLoad() throws Exception {
Path plugins = directory.getParent();
JavaPluginLoader loader = new JavaPluginLoader(proxy, plugins);
PluginDescription description = loader.createPluginFromCandidate(loader.loadCandidate(plugins.resolve("VelocityCore.jar")));
PluginContainer container = new VelocityPluginContainer(description);
AbstractModule commonModule = new AbstractModule() {
@Override
protected void configure() {
this.bind(ProxyServer.class).toInstance(proxy);
this.bind(PluginManager.class).toInstance(proxy.getPluginManager());
this.bind(EventManager.class).toInstance(proxy.getEventManager());
this.bind(CommandManager.class).toInstance(proxy.getCommandManager());
this.bind(PluginContainer.class).annotatedWith(Names.named(container.getDescription().getId())).toInstance(container);
}
};
Module module = loader.createModule(container);
loader.createPlugin(container, module, commonModule);
return container;
}
private void unload(PluginContainer container, Object plugin) throws InterruptedException, IOException {
PluginClassLoader classLoader = ((PluginClassLoader) plugin.getClass().getClassLoader());
CommandManager commandManager = proxy.getCommandManager();
for(String alias : commandManager.getAliases()) {
CommandMeta meta = commandManager.getCommandMeta(alias);
if(meta != null && meta.getPlugin() == plugin)
commandManager.unregister(meta);
}
proxy.getEventManager().unregisterListeners(plugin);
proxy.getScheduler().tasksByPlugin(plugin).forEach(ScheduledTask::cancel);
container.getExecutorService().shutdown();
if(!container.getExecutorService().awaitTermination(100, TimeUnit.MILLISECONDS))
logger.log(Level.WARNING, "ExecutorService termination took longer than 100ms, continuing.");
for(Thread thread : Thread.getAllStackTraces().keySet()) {
if(thread.getClass().getClassLoader() != classLoader)
continue;
thread.interrupt();
thread.join(100);
if (thread.isAlive())
logger.log(Level.WARNING, "Could not stop thread %s of plugin %s. Still running".formatted(thread.getName(), container.getDescription().getId()));
}
//TODO close all log handlers
/*for (Handler handler : plugin.getLogger().getHandlers()) {
handler.close();
}*/
//Clear resource bundle cache
ResourceBundle.clearCache(classLoader);
classLoader.close();
}
}

Datei anzeigen

@ -0,0 +1,75 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.persistent;
import lombok.experimental.UtilityClass;
@UtilityClass
public class Reflection {
public static class Field<C, T> {
private final java.lang.reflect.Field f;
public Field(Class<C> target, String name) {
try {
f = target.getDeclaredField(name);
f.setAccessible(true);
} catch (NoSuchFieldException e) {
throw new IllegalArgumentException("Cannot find field with name " + name, e);
}
}
public T get(C target) {
try {
return (T) f.get(target);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Cannot access reflection.", e);
}
}
public void set(C target, T value) {
try {
f.set(target, value);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Cannot access reflection.", e);
}
}
}
public static class Method<C> {
private final java.lang.reflect.Method m;
public Method(Class<C> clazz, String methodName, Class<?>... params) {
try {
m = clazz.getDeclaredMethod(methodName, params);
m.setAccessible(true);
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException("Cannot find method with name " + methodName, e);
}
}
public Object invoke(C target, Object... arguments) {
try {
return m.invoke(target, arguments);
} catch (Exception e) {
throw new IllegalArgumentException("Cannot invoke method " + m, e);
}
}
}
}

Datei anzeigen

@ -0,0 +1,28 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.persistent;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
public interface ReloadablePlugin {
void onProxyInitialization(ProxyInitializeEvent event);
default void onProxyShutdown(ProxyShutdownEvent event) {}
}

Datei anzeigen

@ -0,0 +1,26 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.persistent;
public enum Servertype {
BAUSERVER,
ARENA,
BUILDER
}

Datei anzeigen

@ -0,0 +1,52 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.persistent;
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.server.ServerInfo;
import com.velocitypowered.proxy.protocol.packet.UpsertPlayerInfoPacket;
import lombok.experimental.UtilityClass;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@UtilityClass
public class Storage {
public static final Map<Player, List<Player>> challenges = new HashMap<>();
public static final Map<Player, Player> lastChats = new HashMap<>();
public static final Map<Integer, List<Integer>> teamInvitations = new HashMap<>(); // UserID -> List<TeamIDs>
public static final Map<Player, Timestamp> sessions = new HashMap<>(); // Contains session start timestamp
public static final Map<Integer, Subserver> eventServer = new HashMap<>(); // TeamID -> Subserver map
public static final Map<Player, Integer> fabricCheckedPlayers = new HashMap<>();
public static final Map<Player, Long> fabricExpectPluginMessage = new HashMap<>();
public static final Map<Integer, ServerInfo> teamServers = new HashMap<>(); // TeamID -> ServerInfo map
public static final Map<Player, Map<UUID, UpsertPlayerInfoPacket.Entry>> directTabItems = new HashMap<>();
}

Datei anzeigen

@ -0,0 +1,263 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.persistent;
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.proxy.server.ServerInfo;
import lombok.Getter;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import java.io.*;
import java.net.InetSocketAddress;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.logging.Level;
import java.util.logging.Logger;
@SuppressWarnings("unused")
public class Subserver {
private static final Component PREFIX = Component
.text("Steam").color(NamedTextColor.YELLOW)
.append(Component.text("War» ").color(NamedTextColor.DARK_GRAY));
private static final Logger logger = Persistent.getInstance().getLogger();
@Getter
private static final List<Subserver> serverList = new LinkedList<>();
private static final Map<ServerInfo, Subserver> infoToServer = new HashMap<>();
public static Subserver getSubserver(Player p) {
synchronized (serverList) {
for (int i = serverList.size() - 1; i >= 0; i--) {
if (serverList.get(i).onServer(p))
return serverList.get(i);
}
}
return null;
}
public static Subserver getSubserver(ServerInfo server) {
synchronized (serverList) {
return infoToServer.get(server);
}
}
static void shutdown() {
while (!serverList.isEmpty()) {
Subserver server = serverList.get(0);
server.stop();
}
}
private final String serverName;
private final boolean checkpoint;
private final Runnable shutdownCallback;
private final Consumer<Exception> failureCallback;
private final Process process;
private final PrintWriter writer;
@Getter
private final ServerInfo server;
@Getter
private RegisteredServer registeredServer;
@Getter
private final Servertype type;
private final Thread thread;
@Getter
private boolean started;
private final List<Player> cachedPlayers = new LinkedList<>();
@Getter
private final Map<Player, String> tablistNames = new HashMap<>();
protected Subserver(Servertype type, String serverName, int port, ProcessBuilder processBuilder, Runnable shutdownCallback, Consumer<Exception> failureCallback) {
this.started = false;
this.serverName = serverName;
this.type = type;
this.shutdownCallback = shutdownCallback;
this.failureCallback = failureCallback == null ? this::fatalError : failureCallback;
this.checkpoint = processBuilder.command().contains("criu");
try {
this.process = processBuilder.start();
} catch (IOException e) {
throw new SecurityException("Server could not be started", e);
}
InetSocketAddress address = new InetSocketAddress("127.0.0.1", port);
this.server = new ServerInfo(serverName, address);
this.writer = new PrintWriter(process.getOutputStream(), true);
this.thread = new Thread(this::run, "Subserver " + serverName);
this.thread.start();
}
public void sendPlayer(Player p) {
if (!started) {
p.sendActionBar(generateBar(0));
cachedPlayers.add(p);
} else {
p.createConnectionRequest(registeredServer).connect();
}
}
public void execute(String command) {
writer.println(command);
}
public void stop() {
try {
long pid = process.pid();
if (checkpoint)
pid = process.children().findAny().map(ProcessHandle::pid).orElse(pid);
Runtime.getRuntime().exec(new String[]{"kill", "-SIGUSR1", Long.toString(pid)});
} catch (IOException e) {
logger.log(Level.SEVERE, "Failed to send SIGUSR1 to subserver.", e);
}
try {
if (!process.waitFor(1, TimeUnit.MINUTES)) {
logger.log(Level.SEVERE, () -> serverName + " did not stop correctly, forcibly stopping!");
process.destroyForcibly();
}
thread.join();
} catch (InterruptedException e) {
logger.log(Level.SEVERE, "Subserver stop interrupted!", e);
Thread.currentThread().interrupt();
}
}
private boolean onServer(Player p) {
return cachedPlayers.contains(p) || (registeredServer != null && registeredServer.getPlayersConnected().contains(p));
}
private void fatalError(Exception e) {
logger.log(Level.SEVERE, e, () -> serverName + " did not run correctly!");
for (Player cached : cachedPlayers)
cached.sendMessage(PREFIX.append(Component.text("Unexpected error during server startup.").color(NamedTextColor.RED)));
if (registeredServer != null) {
for (Player player : registeredServer.getPlayersConnected())
player.sendMessage(PREFIX.append(Component.text("Lost connection to server.").color(NamedTextColor.RED)));
}
}
private void start(InputStream stream, Predicate<String> test) throws IOException {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) {
String line = "";
while (!started && (line = reader.readLine()) != null) {
started = test.test(line);
}
if (line == null)
throw new IOException(serverName + " did not start correctly!");
}
}
protected void register() {
if (Persistent.getInstance().getProxy().getServer(serverName).isPresent()) {
SecurityException e = new SecurityException("Server already registered: " + serverName);
stop();
failureCallback.accept(e);
throw e;
}
synchronized (serverList) {
registeredServer = Persistent.getInstance().getProxy().registerServer(server);
serverList.add(this);
infoToServer.put(server, this);
}
}
protected void unregister() {
synchronized (serverList) {
infoToServer.remove(server);
serverList.remove(this);
Persistent.getInstance().getProxy().unregisterServer(server);
registeredServer = null;
}
}
private void run() {
register();
Exception ex = null;
try {
if (checkpoint) {
start(process.getErrorStream(), line -> line.contains("Restore finished successfully."));
} else {
start(process.getInputStream(), line -> {
if (line.contains("Loading libraries, please wait"))
sendProgress(2);
else if (line.contains("Starting Minecraft server on"))
sendProgress(4);
else if (line.contains("Preparing start region"))
sendProgress(6);
return line.contains("Finished mapping loading");
});
}
if (!started)
return;
sendProgress(8);
Thread.sleep(300);
sendProgress(10);
for (Player cachedPlayer : cachedPlayers) {
sendPlayer(cachedPlayer);
}
cachedPlayers.clear();
process.waitFor();
} catch (IOException e) {
ex = e;
} catch (InterruptedException e) {
ex = e;
Thread.currentThread().interrupt();
} finally {
unregister();
shutdownCallback.run();
if (ex != null)
failureCallback.accept(ex);
}
}
private Component generateBar(int progress) {
return Component.text("".repeat(Math.max(0, progress))).color(NamedTextColor.YELLOW)
.append(Component.text("".repeat(Math.max(0, 10 - progress))).color(NamedTextColor.DARK_GRAY));
}
private void sendProgress(int progress) {
Component tc = generateBar(progress);
for (Player cached : cachedPlayers)
cached.sendActionBar(tc);
}
}

Datei anzeigen

@ -17,53 +17,24 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import org.apache.tools.ant.taskdefs.condition.Os
import java.util.function.BiConsumer
plugins {
// Adding the base plugin fixes the following gradle warnings in IntelliJ:
//
// Warning: root project 'module-work-multi': Unable to resolve all content root directories
// Details: java.lang.IllegalStateException: No value has been specified for this provider.
//
// Warning: root project 'module-work-multi': Unable to resolve additional project configuration.
// Details: java.lang.IllegalStateException: No value has been specified for this provider.
id 'base'
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '5.0.0'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'de.steamwar.gradle' version 'RELEASE'
}
group 'de.steamwar'
version ''
Properties steamwarProperties = new Properties()
if (file("steamwar.properties").exists()) {
steamwarProperties.load(file("steamwar.properties").newDataInputStream())
}
ext {
buildName = 'BungeeCore'
artifactName = 'bungeecore'
uberJarName = "${buildName}-all.jar"
jarName = "${artifactName}.jar"
libs = "${buildDir}/libs"
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
operatingSystem = "windows"
} else {
operatingSystem = "unix"
}
}
compileJava.options.encoding = 'UTF-8'
sourceCompatibility = 1.8
targetCompatibility = 1.8
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
mainClassName = ''
@ -79,173 +50,64 @@ sourceSets {
}
}
repositories {
mavenCentral()
maven {
url 'https://m2.dv8tion.net/releases'
allprojects {
repositories {
mavenCentral()
maven {
url 'https://repo.papermc.io/repository/maven-public/'
content {
includeGroup 'com.velocitypowered'
}
}
maven {
url 'https://m2.dv8tion.net/releases'
content {
includeGroup 'net.dv8tion'
}
}
maven {
url 'https://repo.lunarclient.dev'
content {
includeGroup 'com.lunarclient'
}
}
}
}
shadowJar {
exclude 'META-INF/*'
exclude 'org/sqlite/native/FreeBSD/**', 'org/sqlite/native/Mac/**', 'org/sqlite/native/Windows/**', 'org/sqlite/native/Linux-Android/**', 'org/sqlite/native/Linux-Musl/**'
exclude 'org/sqlite/native/Linux/aarch64/**', 'org/sqlite/native/Linux/arm/**', 'org/sqlite/native/Linux/armv6/**', 'org/sqlite/native/Linux/armv7/**', 'org/sqlite/native/Linux/ppc64/**', 'org/sqlite/native/Linux/x86/**'
exclude 'org/slf4j/**'
//https://imperceptiblethoughts.com/shadow/configuration/minimizing/
minimize {
exclude project(':')
exclude dependency('mysql:mysql-connector-java:.*')
}
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.22'
testCompileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
compileOnly 'org.projectlombok:lombok:1.18.32'
testCompileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.32'
compileOnly files("${projectDir}/lib/BungeeCord.jar")
compileOnly files("${projectDir}/lib/PersistentBungeeCore.jar")
compileOnly files("${projectDir}/lib/BungeeTabListPlus.jar")
implementation("net.dv8tion:JDA:4.3.0_299") {
annotationProcessor 'com.velocitypowered:velocity-api:3.3.0-SNAPSHOT'
compileOnly 'de.steamwar:velocity:RELEASE'
compileOnly project(":Persistent")
implementation project(":CommonCore")
implementation 'org.xerial:sqlite-jdbc:3.46.0.0'
implementation 'mysql:mysql-connector-java:8.0.33'
implementation("net.dv8tion:JDA:4.4.0_352") {
exclude module: 'opus-java'
}
implementation project(":CommonCore")
}
implementation 'org.msgpack:msgpack-core:0.9.8' //AlpineClient
task buildProject {
description 'Build this project'
group "Steamwar"
dependsOn build
}
task finalizeProject {
description 'Finalize this project'
group "Steamwar"
doLast {
if ("${buildDir}" == null) {
return
}
delete fileTree("${libs}").matching {
exclude("${uberJarName}")
}
file(libs + "/" + uberJarName).renameTo(file(libs + "/" + jarName))
}
}
build.finalizedBy(finalizeProject)
if (steamwarProperties.containsKey("hostname")) {
String hostname = steamwarProperties.get("hostname")
String uploadPath = steamwarProperties.getOrDefault("uploadPath", "~")
String server = steamwarProperties.getOrDefault("server", "DevBungee")
String serverStartFlags = steamwarProperties.getOrDefault("serverStartFlags", "")
task uploadProject {
description 'Upload this project'
group "Steamwar"
doLast {
await(shell("scp ${libs}/${jarName} ${hostname}:${uploadPath}/${server}/plugins"))
if (steamwarProperties.getOrDefault("directStart", "false") == "false" && !answer("Start ${server} server?")) {
return
}
serverStart(server, serverStartFlags, hostname)
}
}
uploadProject.dependsOn(buildProject)
task startDevServer {
description 'Start the DevBungee'
group "Steamwar"
doLast {
serverStart(server, serverStartFlags, hostname)
}
}
}
private def await(Process proc) {
def out = new StringBuilder()
def err = new StringBuilder()
proc.waitForProcessOutput(out, err)
return [out, err, proc.exitValue()]
}
private def shell(String command) {
if (operatingSystem == "unix") {
return ['bash', '-c', command].execute()
} else {
return ["cmd", "/c", command].execute()
}
}
private def serverStart(String serverName, String serverFlags, String hostname) {
def proc = shell("ssh -t ${hostname} \"./mc ${serverFlags} ${serverName}\"")
Set<String> strings = new HashSet<>()
File file = new File("${projectDir}/ignoredlog");
if (file.exists()) {
new BufferedReader(new InputStreamReader(new FileInputStream(file))).readLines().forEach({ s ->
strings.add(s)
})
}
Thread outputThread = new Thread({
Reader reader = proc.getInputStream().newReader();
Writer writer = System.out.newWriter();
try {
while (proc.alive) {
String s = reader.readLine()
if (s == null) {
return
}
if (strings.stream().anyMatch({check -> s.contains(check)})) {
continue
}
writer.write(s + "\n")
writer.flush()
}
} catch (IOException e) {
// Ignored
}
})
outputThread.setName("${serverName} - OutputThread")
outputThread.start()
Writer writer
Thread inputThread = new Thread({
Reader reader = System.in.newReader()
writer = proc.getOutputStream().newWriter()
try {
while (proc.alive) {
String s = reader.readLine()
writer.write(s + "\n")
writer.flush()
}
} catch (IOException e) {
// Ignored
}
})
inputThread.setName("${serverName} - InputThread")
inputThread.start()
gradle.buildFinished { buildResult ->
if (!proc.alive) {
return
}
writer = proc.getOutputStream().newWriter()
writer.write("stop\n")
writer.flush()
awaitClose(proc, outputThread, inputThread)
}
awaitClose(proc, outputThread, inputThread)
};
private static def awaitClose(Process proc, Thread outputThread, Thread inputThread) {
while (proc.alive) {
Thread.sleep(10)
}
proc.closeStreams()
outputThread.interrupt()
inputThread.interrupt()
}
private def answer(String question) {
while (System.in.available() > 0) System.in.read()
println(question)
boolean valid = "Yy".contains(((char) System.in.read()).toString())
while (System.in.available() > 0) System.in.read()
return valid
implementation 'com.lunarclient:apollo-api:1.1.0'
implementation 'com.lunarclient:apollo-common:1.1.0'
}

86
deployarena.py Ausführbare Datei
Datei anzeigen

@ -0,0 +1,86 @@
#!/usr/bin/env python3
import datetime
import os
import shutil
import sys
import tarfile
from os import path
# Non stdlib
from nbt import nbt
from ruamel.yaml import YAML
yaml = YAML()
if __name__ == "__main__":
configfile = f'/configs/GameModes/{sys.argv[1]}'
version = int(sys.argv[2])
worldname = sys.argv[3]
with open(configfile, 'r') as file:
gamemode = yaml.load(file)
builderworld = path.expanduser(f'~/builder{version}/{worldname}')
arenaworld = f'/servers/{gamemode["Server"]["Folder"]}/arenas/{worldname}'
if path.exists(arenaworld):
backupworld = path.expanduser(f'~/backup/arenas/{datetime.datetime.now()}-{worldname}-{version}.tar.xz')
with tarfile.open(backupworld, 'w:xz') as tar:
tar.add(arenaworld, arcname=worldname)
shutil.rmtree(arenaworld)
else:
gamemode['Server']['Maps'].append(worldname)
with open(configfile, 'w') as file:
yaml.dump(gamemode, file)
level = nbt.NBTFile(f'{builderworld}/level.dat')
level['Data']['Difficulty'] = nbt.TAG_Byte(2)
gameRules = level['Data']['GameRules']
gameRules['announceAdvancements'] = nbt.TAG_String('false')
gameRules['disableRaids'] = nbt.TAG_String('true')
gameRules['doDaylightCycle'] = nbt.TAG_String('false')
gameRules['doEntityDrops'] = nbt.TAG_String('false')
gameRules['doFireTick'] = nbt.TAG_String('true')
gameRules['doImmediateRespawn'] = nbt.TAG_String('true')
gameRules['doInsomnia'] = nbt.TAG_String('false')
gameRules['doLimitedCrafting'] = nbt.TAG_String('false')
gameRules['doMobLoot'] = nbt.TAG_String('false')
gameRules['doMobSpawning'] = nbt.TAG_String('false')
gameRules['doPatrolSpawning'] = nbt.TAG_String('false')
gameRules['doTileDrops'] = nbt.TAG_String('true')
gameRules['doTraderSpawning'] = nbt.TAG_String('false')
gameRules['doWardenSpawning'] = nbt.TAG_String('false')
gameRules['doWeatherCycle'] = nbt.TAG_String('false')
gameRules['drowningDamage'] = nbt.TAG_String('true')
gameRules['fallDamage'] = nbt.TAG_String('true')
gameRules['fireDamage'] = nbt.TAG_String('true')
gameRules['freezeDamage'] = nbt.TAG_String('true')
gameRules['keepInventory'] = nbt.TAG_String('true')
gameRules['lavaSourceConversion'] = nbt.TAG_String('false')
gameRules['maxEntityCramming'] = nbt.TAG_String('24')
gameRules['mobGriefing'] = nbt.TAG_String('false')
gameRules['naturalRegeneration'] = nbt.TAG_String('false')
gameRules['randomTickSpeed'] = nbt.TAG_String('3')
gameRules['reducedDebugInfo'] = nbt.TAG_String('true')
gameRules['snowAccumulationHeight'] = nbt.TAG_String('1')
gameRules['spawnRadius'] = nbt.TAG_String('0')
gameRules['spectatorsGenerateChunks'] = nbt.TAG_String('true')
gameRules['waterSourceConversion'] = nbt.TAG_String('true')
level.write_file()
if path.exists(arenaworld):
shutil.rmtree(arenaworld)
os.makedirs(f'{arenaworld}/backup')
shutil.copy2(f'{builderworld}/level.dat', f'{arenaworld}/backup/level.dat')
shutil.copytree(f'{builderworld}/region', f'{arenaworld}/backup/region')
shutil.copy2(f'{builderworld}/level.dat', f'{arenaworld}/level.dat')
shutil.copytree(f'{builderworld}/region', f'{arenaworld}/region')
shutil.copy2(f'{builderworld}/config.yml', f'{arenaworld}/config.yml')
if path.exists(f'{builderworld}/paper-world.yml'):
shutil.copy2(f'{builderworld}/paper-world.yml', f'{arenaworld}/backup/paper-world.yml')
shutil.copy2(f'{builderworld}/paper-world.yml', f'{arenaworld}/paper-world.yml')

Datei anzeigen

@ -1,5 +1,5 @@
#Sat Apr 10 23:34:12 CEST 2021
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists

Datei anzeigen

@ -17,6 +17,16 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
rootProject.name = 'BungeeCore'
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = uri("https://steamwar.de/maven/")
}
}
}
include 'CommonCore'
rootProject.name = 'VelocityCore'
include 'CommonCore'
include 'Persistent'

Datei anzeigen

@ -1,181 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore;
import de.steamwar.bungeecore.sql.SchematicType;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
public class ArenaMode {
private static final Map<String, ArenaMode> byChat = new HashMap<>();
private static final Map<String, ArenaMode> byInternal = new HashMap<>();
private static final Map<SchematicType, ArenaMode> bySchemType = new HashMap<>();
private static final List<ArenaMode> allModes = new LinkedList<>();
private static final Random random = new Random();
static {
File folder = new File(ProxyServer.getInstance().getPluginsFolder(), "FightSystem");
for(File configFile : Arrays.stream(folder.listFiles((file, name) -> name.endsWith(".yml") && !name.endsWith(".kits.yml"))).sorted().collect(Collectors.toList())) {
Configuration config;
try {
config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
} catch (IOException e) {
throw new SecurityException("Could not load SchematicTypes", e);
}
if(config.contains("Server"))
new ArenaMode(configFile.getName().replace(".yml", ""), config);
}
}
public static ArenaMode getByChat(String name){
return byChat.get(name.toLowerCase());
}
public static ArenaMode getByInternal(String name){
return byInternal.get(name);
}
public static List<String> getAllChatNames(boolean historic) {
List<String> chatNames = new LinkedList<>();
for(ArenaMode mode : byInternal.values()){
if(historic == mode.historic)
chatNames.addAll(mode.chatNames);
}
return chatNames;
}
public static List<String> getAllRankedChatNames(){
List<String> chatNames = new LinkedList<>();
for(ArenaMode mode : byInternal.values()){
if(mode.isRanked())
chatNames.addAll(mode.chatNames);
}
return chatNames;
}
public static ArenaMode getBySchemType(SchematicType schemType){
return bySchemType.get(schemType);
}
public static List<ArenaMode> getAllModes(){
return allModes;
}
private final String displayName;
private final String folder;
private final List<String> chatNames;
private final String serverJar;
private final String config;
private final List<String> maps;
private final boolean historic;
private final String internalName;
private final boolean ranked;
private final String schemType;
private ArenaMode(String internalName, Configuration config){
this.internalName = internalName;
this.folder = config.getString("Server.Folder");
this.serverJar = config.getString("Server.ServerJar");
this.config = internalName + ".yml";
this.maps = config.getStringList("Server.Maps");
this.displayName = config.getString("GameName", internalName);
this.chatNames = config.getStringList("Server.ChatNames");
this.schemType = config.getString("Schematic.Type", "").toLowerCase();
this.ranked = config.getBoolean("Server.Ranked", false);
this.historic = config.getBoolean("Server.Historic", false);
allModes.add(this);
byInternal.put(internalName, this);
for(String name : chatNames){
byChat.put(name.toLowerCase(), this);
}
if(!this.schemType.equals(""))
bySchemType.put(SchematicType.fromDB(this.schemType), this);
}
public String getDisplayName() {
return displayName;
}
public String serverJar() {
return serverJar;
}
public String getConfig(){
return config;
}
public String hasMap(String map){
for(String m : maps){
if(m.equalsIgnoreCase(map))
return m;
}
return null;
}
public String getFolder() {
return folder;
}
public String getRandomMap(){
return maps.get(random.nextInt(maps.size()));
}
public List<String> getMaps() {
return maps;
}
public String getChatName(){
return chatNames.get(0);
}
public boolean withoutChatName(){
return chatNames.isEmpty();
}
public boolean isHistoric(){
return historic;
}
public boolean isRanked() {
return ranked;
}
public String getSchemType() {
return schemType;
}
public String getInternalName() {
return internalName;
}
}

Datei anzeigen

@ -1,307 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.commands.*;
import de.steamwar.bungeecore.comms.SpigotReceiver;
import de.steamwar.bungeecore.listeners.*;
import de.steamwar.bungeecore.listeners.mods.*;
import de.steamwar.bungeecore.sql.*;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
public class BungeeCore extends Plugin {
public static String CHAT_PREFIX;
public static String WORLD_FOLDER;
public static String BAUWELT_PROTOTYP;
public static String LOBBY_SERVER;
public static String USERWORLDS15;
public static String BAUWELT15;
public static boolean EVENT_MODE;
private static BungeeCore instance;
public static final Map<String, String> serverPermissions = new HashMap<>();
public static final Map<String, String> commands = new HashMap<>();
private ErrorLogger errorLogger;
@Override
public void onEnable(){
getProxy().registerChannel("sw:bridge");
getProxy().registerChannel("fabricmodsender:mods");
setInstance(this);
loadConfig();
errorLogger = new ErrorLogger();
new ConnectionListener();
new Forge();
new Forge12();
new LabyMod();
new Badlion();
new ChatListener();
new BanListener();
new CheckListener();
new ModLoaderBlocker();
new WorldDownloader();
new BrandListener();
new Fabric();
new SubserverProtocolFixer();
new Node.LocalNode();
//new Node.RemoteNode("lx");
//new Node.RemoteNode("az");
commands.put("/tp", null);
commands.put("/bc", null);
commands.put("/bauchat", null);
commands.put("/local", null);
new TeamchatCommand();
new MsgCommand();
new RCommand();
new PingCommand();
new AlertCommand();
new KickCommand();
new JoinmeCommand();
new TpCommand();
new HelpCommand();
new TeamCommand();
new ServerTeamchatCommand();
new DevCommand();
new EventCommand();
new EventreloadCommand();
new EventRescheduleCommand();
new PollCommand();
new BugCommand();
new WhoisCommand();
new RegelnCommand();
new IgnoreCommand();
new UnIgnoreCommand();
new PollresultCommand();
new ListCommand();
new StatCommand();
new VerifyCommand();
new GDPRQuery();
new PlaytimeCommand();
new ArenaCommand();
new RankCommand();
new LocalCommand();
new SetLocaleCommand();
// Punishment Commands:
new PunishmentCommand("ban", Punishment.PunishmentType.Ban);
new PunishmentCommand("mute", Punishment.PunishmentType.Mute);
new PunishmentCommand("noschemreceiving", Punishment.PunishmentType.NoSchemReceiving);
new PunishmentCommand("noschemsharing", Punishment.PunishmentType.NoSchemSharing);
new PunishmentCommand("noschemsubmitting", Punishment.PunishmentType.NoSchemSubmitting);
new PunishmentCommand("nodev", Punishment.PunishmentType.NoDevServer);
new PunishmentCommand("nofight", Punishment.PunishmentType.NoFightServer);
new PunishmentCommand("noteamserver", Punishment.PunishmentType.NoTeamServer);
new PunishmentCommand("note", Punishment.PunishmentType.Note);
if(!EVENT_MODE){
new BauCommand();
new WebregisterCommand();
new FightCommand();
new ChallengeCommand();
new HistoricCommand();
new CheckCommand();
new ReplayCommand();
new TutorialCommand();
new Broadcaster();
}else{
new EventModeListener();
}
new EventStarter();
new SessionManager();
new SpigotReceiver();
new TablistManager();
new SettingsChangedListener();
getProxy().getScheduler().schedule(this, () -> {
SteamwarUser.clearCache();
UserElo.clearCache();
Team.clearCache();
}, 1, 1, TimeUnit.HOURS);
if (SteamwarDiscordBotConfig.loaded) {
try {
new SteamwarDiscordBot();
} catch (Throwable e) {
getLogger().log(Level.SEVERE, "Could not initialize discord bot", e);
}
}
}
@Override
public void onDisable(){
if (SteamwarDiscordBotConfig.loaded) {
try {
SteamwarDiscordBot.instance().getJda().shutdown();
} catch (Throwable e) {
getLogger().log(Level.SEVERE, "Could not shutdown discord bot", e);
}
}
errorLogger.unregister();
Statement.closeAll();
}
public static BungeeCore get() {
return instance;
}
public static TextComponent stringToText(String msg){
return new TextComponent(TextComponent.fromLegacyText(msg));
}
public static void send(ProxiedPlayer player, String msg){
send(player, msg, null, null);
}
public static void send(CommandSender sender, String msg){
sender.sendMessage(stringToText(msg));
}
public static void send(ProxiedPlayer player, ChatMessageType type, String msg){
send(player, type, msg, null, null);
}
public static void send(ProxiedPlayer player, String msg, String onHover, ClickEvent onClick){
send(player, ChatMessageType.SYSTEM, msg, onHover, onClick);
}
public static void send(ProxiedPlayer player, ChatMessageType type, String msg, String onHover, ClickEvent onClick){
if(type == ChatMessageType.CHAT && player.getChatMode() != ProxiedPlayer.ChatMode.SHOWN)
return;
TextComponent message = stringToText(msg);
if(onHover != null)
message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(onHover)));
if(onClick != null)
message.setClickEvent(onClick);
player.sendMessage(type, message);
}
public static void broadcast(String msg){
ProxyServer.getInstance().broadcast(stringToText(msg));
}
public static void broadcast(String msg, String onHover, ClickEvent onClick){
TextComponent message = stringToText(msg);
if(onHover != null)
message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(onHover)));
if(onClick != null)
message.setClickEvent(onClick);
ProxyServer.getInstance().broadcast(message);
}
public static void log(final ServerInfo server, final String msg){
log(server.getName() + ": " + msg);
}
public static void log(final ProxiedPlayer player, final String msg){
log(player.getName() + ": " + msg);
}
public static void log(final String msg){
log(Level.INFO, msg);
}
public static void log(final Level logLevel, final String msg){
get().getLogger().log(logLevel, msg);
}
public static void log(final String msg, final Throwable e){
get().getLogger().log(Level.SEVERE, msg, e);
}
private static void loadConfig(){
Configuration config;
try{
if(!get().getDataFolder().exists() && !get().getDataFolder().mkdir())
throw new IOException();
File configFile = new File(get().getDataFolder().getPath(), "config.yml");
if(!configFile.exists()){
boolean created = configFile.createNewFile();
if(created)
ProxyServer.getInstance().stop("Config file not initialized");
else
ProxyServer.getInstance().stop("Could not save conig file");
return;
}
config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
}catch(Exception e){
log("Could not save/load config.yml", e);
ProxyServer.getInstance().stop();
return;
}
CHAT_PREFIX = config.getString("prefix");
WORLD_FOLDER = config.getString("worldfolder");
BAUWELT_PROTOTYP = config.getString("bauweltprototyp");
LOBBY_SERVER = config.getString("lobbyserver");
USERWORLDS15 = config.getString("userworlds15");
BAUWELT15 = config.getString("bauwelt15");
EVENT_MODE = config.getBoolean("eventmode");
Broadcaster.setBroadCastMsgs(config.getStringList("broadcasts").toArray(new String[1]));
PollSystem.init(config.getString("poll.question"), config.getStringList("poll.answers"));
Persistent.setChatPrefix(CHAT_PREFIX);
Persistent.setLobbyServer(LOBBY_SERVER);
if (config.contains("discord")) {
SteamwarDiscordBotConfig.loadConfig(config.getSection("discord"));
}
final Configuration servers = config.getSection("servers");
for(final String serverName : servers.getKeys()){
final Configuration server = servers.getSection(serverName);
List<String> cmds = server.getStringList("commands");
serverPermissions.put(serverName, "bungeecore.server." + server.getString("permission"));
String cmd = cmds.remove(0);
new ServerSwitchCommand(
cmd,
serverName,
serverPermissions.get(serverName),
cmds.toArray(new String[0])
);
if(server.getBoolean("modchecked", false)) {
ModLoaderBlocker.addServer(serverName);
}
}
}
private static void setInstance(BungeeCore core){
instance = core;
}
}

Datei anzeigen

@ -1,94 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore;
import de.steamwar.bungeecore.sql.SWException;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
public class ErrorLogger extends Handler {
private int ddosRate = 0;
ErrorLogger(){
Logger.getLogger("").addHandler(this);
}
void unregister(){
Logger.getLogger("").removeHandler(this);
}
@Override
public void publish(LogRecord logRecord) {
if(logRecord.getLevel().intValue() < Level.WARNING.intValue())
return;
String message = MessageFormat.format(logRecord.getMessage(), logRecord.getParameters());
for(String reason : ignoreContains)
if(message.contains(reason))
return;
ByteArrayOutputStream stacktraceOutput = new ByteArrayOutputStream();
if(logRecord.getThrown() != null)
logRecord.getThrown().printStackTrace(new PrintStream(stacktraceOutput));
String stacktrace = stacktraceOutput.toString();
if(stacktrace.contains("Cannot request protocol")) {
if(++ddosRate % 1000 == 0) {
SWException.log("Bungee", "DDOS", ddosRate + "");
}
return;
} else if (stacktrace.contains("ErrorLogger")) {
return;
}
SWException.log("Bungee", message, stacktrace);
}
@Override
public void flush() {
//ignored
}
@Override
public void close() {
//ignored
}
private static final List<String> ignoreContains;
static {
List<String> contains = new ArrayList<>();
contains.add("Error authenticating ");
contains.add("read timed out");
contains.add("Connection reset by peer");
contains.add("No client connected for pending server");
contains.add("Error occurred processing connection for");
ignoreContains = Collections.unmodifiableList(contains);
}
}

Datei anzeigen

@ -1,96 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore;
import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.EventFight;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.scheduler.ScheduledTask;
import java.sql.Timestamp;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.TimeUnit;
import static de.steamwar.bungeecore.Storage.eventServer;
public class EventStarter implements Runnable {
private static ScheduledTask task = null;
EventStarter(){
EventFight.loadAllComingFights();
if(task != null)
task.cancel();
ProxyServer.getInstance().getScheduler().schedule(BungeeCore.get(), this, 1, 10, TimeUnit.SECONDS);
}
public static Map<Integer, Subserver> getEventServer() {
return eventServer;
}
@Override
public void run() {
eventServer.entrySet().removeIf(entry -> !Subserver.getServerList().contains(entry.getValue()));
Queue<EventFight> fights = EventFight.getFights();
EventFight next;
while((next = nextFight(fights)) != null){
Team blue = Team.get(next.getTeamBlue());
Team red = Team.get(next.getTeamRed());
//Don't start EventServer if not the event bungee
if(BungeeCore.EVENT_MODE || !Event.get(next.getEventID()).spectateSystem()) {
ServerStarter starter = new ServerStarter().event(next);
ProxiedPlayer leiter = ProxyServer.getInstance().getPlayer(SteamwarUser.get(next.getKampfleiter()).getUuid());
if(leiter != null)
starter.send(leiter);
Subserver subserver = starter.start();
eventServer.put(blue.getTeamId(), subserver);
eventServer.put(red.getTeamId(), subserver);
Message.broadcast("EVENT_FIGHT_BROADCAST", "EVENT_FIGHT_BROADCAST_HOVER",
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/event " + blue.getTeamKuerzel()), blue.getTeamColor(), blue.getTeamName(), red.getTeamColor(), red.getTeamName());
} else {
Message.broadcast("EVENT_FIGHT_BROADCAST", "EVENT_FIGHT_BROADCAST_HOVER",
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/spectate"), blue.getTeamColor(), blue.getTeamName(), red.getTeamColor(), red.getTeamName());
}
}
}
private EventFight nextFight(Queue<EventFight> fights){
EventFight next = fights.peek();
if(next == null)
return null;
if(!next.getStartTime().before(new Timestamp(System.currentTimeMillis())))
return null;
return fights.poll();
}
}

Datei anzeigen

@ -1,145 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore;
import de.steamwar.messages.ChatSender;
import de.steamwar.messages.SteamwarResourceBundle;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent;
import java.text.DateFormat;
import java.text.MessageFormat;
import java.util.Date;
import java.util.Locale;
import java.util.ResourceBundle;
public class Message {
@Deprecated
public static TextComponent parseToComponent(String message, boolean prefixed, CommandSender sender, Object... params){
return new TextComponent(TextComponent.fromLegacyText(parse(message, prefixed, locale(sender), params)));
}
@Deprecated
public static String parsePrefixed(String message, CommandSender sender, Object... params){
return parse(message, true, locale(sender), params);
}
@Deprecated
public static String parse(String message, CommandSender sender, Object... params){
return parse(message, false, locale(sender), params);
}
@Deprecated
public static String parse(String message, Locale locale, Object... params){
return parse(message, false, locale, params);
}
@Deprecated
private static Locale locale(CommandSender sender) {
return ChatSender.of(sender).getLocale();
}
@Deprecated
private static String parse(String message, boolean prefixed, Locale locale, Object... params){
if(locale == null)
locale = Locale.getDefault();
ResourceBundle resourceBundle = SteamwarResourceBundle.getResourceBundle(locale);
String pattern = "";
if(prefixed)
pattern = resourceBundle.getObject("PREFIX") + " ";
pattern += (String)resourceBundle.getObject(message);
MessageFormat format = new MessageFormat(pattern, locale);
for (int i = 0; i < params.length; i++) {
if(params[i] instanceof Message) {
Message msg = (Message) params[i];
params[i] = parse(msg.getFormat(), false, locale, msg.getParams());
} else if(params[i] instanceof Date) {
params[i] = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale).format((Date) params[i]);
}
}
return format.format(params);
}
@Deprecated
public static void send(String message, CommandSender sender, Object... params){
send(message, true, sender, ChatMessageType.SYSTEM, null, null, params);
}
@Deprecated
public static void sendPrefixless(String message, CommandSender sender, Object... params){
send(message, false, sender, ChatMessageType.SYSTEM, null, null, params);
}
@Deprecated
public static void send(String message, CommandSender sender, String onHover, ClickEvent onClick, Object... params){
send(message, true, sender, ChatMessageType.SYSTEM, onHover, onClick, params);
}
@Deprecated
public static void sendPrefixless(String message, CommandSender sender, String onHover, ClickEvent onClick, Object... params){
send(message, false, sender, ChatMessageType.SYSTEM, onHover, onClick, params);
}
@Deprecated
private static void send(String message, boolean prefixed, CommandSender s, ChatMessageType type, String onHover, ClickEvent onClick, Object... params){
ChatSender sender = ChatSender.of(s);
if(type == ChatMessageType.CHAT && !sender.chatShown())
return;
sender.send(prefixed, type, onHover != null ? new Message("PLAIN_STRING", onHover) : null, onClick, new Message(message, params));
}
public static void broadcast(String message, Object... params) {
broadcast(message, null, null, params);
}
public static void broadcast(String message, String onHover, ClickEvent onClick, Object... params) {
ChatSender.allReceivers().forEach(player -> player.system(message, onHover != null ? new Message(onHover, params) : null, onClick, params));
}
public static void team(String message, Object... params) {
team(message, null, null, params);
}
public static void team(String message, String onHover, ClickEvent onClick, Object... params) {
ChatSender.serverteamReceivers().filter(player -> player.user().getUserGroup().isTeamGroup()).forEach(player -> player.prefixless(message, onHover != null ? new Message(onHover, params) : null, onClick, params));
}
private final String format;
private final Object[] params;
public Message(String format, Object... params) {
this.format = format;
this.params = params;
}
public String getFormat() {
return format;
}
public Object[] getParams() {
return params;
}
}

Datei anzeigen

@ -1,266 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore;
import net.md_5.bungee.api.ProxyServer;
import java.io.*;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.logging.Level;
public abstract class Node {
private static final List<String> OPENJ9_ARGS = Arrays.asList("-Xgc:excessiveGCratio=80", "-Xsyslog:none", "-Xtrace:none", "-Xdisableexplicitgc", "-XX:+AlwaysPreTouch", "-XX:+CompactStrings", "-XX:-HeapDumpOnOutOfMemory", "-XX:+ExitOnOutOfMemoryError", "-Dlog4j.configurationFile=log4j2.xml");
private static final double MIN_FREE_MEM = 4.0 * 1024 * 1024; // 4 GiB
private static final Set<String> JAVA_8 = new HashSet<>();
static {
JAVA_8.add("paper-1.8.8.jar");
JAVA_8.add("paper-1.10.2.jar");
JAVA_8.add("spigot-1.8.8.jar");
JAVA_8.add("spigot-1.9.4.jar");
JAVA_8.add("spigot-1.10.2.jar");
}
private static final List<Node> nodes = new ArrayList<>();
public static Node local = null;
public static Node getNode() {
Node node = local;
double minLoad = local.getLoad();
if(minLoad < 0.5)
return local;
synchronized (nodes) {
Iterator<Node> it = nodes.iterator();
while(it.hasNext()) {
Node n = it.next();
double load = n.getLoad();
if (load < minLoad) {
minLoad = load;
node = n;
} else if (load == Double.POSITIVE_INFINITY) {
BungeeCore.get().getLogger().log(Level.SEVERE, "Removing " + n.getName() + " due to infinite load!");
it.remove();
}
}
}
return node;
}
public static void forEach(Consumer<Node> consumer) {
consumer.accept(local);
synchronized (nodes) {
nodes.forEach(consumer);
}
}
public abstract ProcessBuilder startServer(String serverJar, File directory, String worldDir, String levelName, int port, String xmx, String... dParams);
public abstract void execute(String... command);
public abstract String getName();
public abstract double getLoad();
protected void constructServerstart(File directory, List<String> cmd, String serverJar, String worldDir, String levelName, int port, String xmx, String... dParams) {
if (JAVA_8.contains(serverJar))
cmd.add("/usr/lib/jvm/java-8-openj9-amd64/bin/java");
else
cmd.add("java");
for(String param : dParams){
cmd.add("-D" + param);
}
cmd.add("-Xmx" + xmx);
cmd.add("-Xshareclasses:nonfatal,name=" + directory.getName());
cmd.addAll(OPENJ9_ARGS);
if (!JAVA_8.contains(serverJar)) {
cmd.add("--add-opens");
cmd.add("java.base/jdk.internal.misc=ALL-UNNAMED");
}
cmd.add("-jar");
cmd.add("/binarys/" + serverJar);
cmd.add("--log-strip-color");
cmd.add("--world-dir");
cmd.add(worldDir);
cmd.add("--level-name");
cmd.add(levelName);
cmd.add("--port");
cmd.add(String.valueOf(port));
cmd.add("nogui");
}
protected void execute(ProcessBuilder builder) {
try {
builder.start().waitFor();
} catch (IOException e) {
throw new SecurityException("Could not execute command", e);
} catch (InterruptedException e) {
ProxyServer.getInstance().getLogger().log(Level.SEVERE, "Interrupted during execution", e);
Thread.currentThread().interrupt();
}
}
public static class LocalNode extends Node {
private static final File meminfo = new File("/proc/meminfo");
private static final File loadavg = new File("/proc/loadavg");
private final int cores;
public LocalNode() {
this.cores = Runtime.getRuntime().availableProcessors();
local = this;
}
@Override
public ProcessBuilder startServer(String serverJar, File directory, String worldDir, String levelName, int port, String xmx, String... dParams) {
List<String> cmd = new ArrayList<>();
constructServerstart(directory, cmd, serverJar, worldDir, levelName, port, xmx, dParams);
ProcessBuilder builder = new ProcessBuilder(cmd);
builder.directory(directory);
return builder;
}
@Override
public void execute(String... command) {
execute(new ProcessBuilder(command));
}
@Override
public String getName() {
return "local";
}
@Override
public double getLoad() {
double totalMem;
double freeMem;
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(meminfo)))) {
totalMem = Double.parseDouble(bufferedReader.readLine().replaceAll(" +", " ").split(" ")[1]);
bufferedReader.readLine();
freeMem = Double.parseDouble(bufferedReader.readLine().replaceAll(" +", " ").split(" ")[1]);
} catch (IOException e) {
throw new SecurityException("Could not read local memory", e);
}
double cpuLoad;
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(loadavg)))) {
cpuLoad = Double.parseDouble(bufferedReader.readLine().split(" ")[0]);
} catch (IOException e) {
throw new SecurityException("Could not read local cpu", e);
}
return cpuLoad / cores + (freeMem > MIN_FREE_MEM ? 0 : ((totalMem - freeMem) / totalMem));
}
}
public static class RemoteNode extends Node {
private final int cores;
private final String remote;
public RemoteNode(String remote) {
this.remote = remote;
//Determine core count
Process process;
try {
process = new ProcessBuilder("ssh", remote, "nproc").start();
if(!process.waitFor(5, TimeUnit.SECONDS))
throw new IOException("Timeout of " + remote + " on init");
} catch (IOException e) {
BungeeCore.get().getLogger().log(Level.SEVERE, "Could not initialize " + remote);
cores = 1;
return;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
cores = 1;
return;
}
int c;
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
c = Integer.parseInt(bufferedReader.readLine());
} catch (IOException | NumberFormatException e) {
BungeeCore.get().getLogger().log(Level.SEVERE, "Could not read cores of" + remote, e);
c = 1;
}
cores = c;
BungeeCore.get().getLogger().log(Level.INFO, "Adding node " + remote + " with " + cores + " cores.");
synchronized (nodes) {
nodes.add(this);
}
}
@Override
public ProcessBuilder startServer(String serverJar, File directory, String worldDir, String levelName, int port, String xmx, String... dParams) {
List<String> cmd = new ArrayList<>();
cmd.add("ssh");
cmd.add("-L");
cmd.add(port + ":localhost:" + port);
cmd.add(remote);
cmd.add("cd");
cmd.add(directory.getPath());
cmd.add(";");
constructServerstart(directory, cmd, serverJar, worldDir, levelName, port, xmx, dParams);
return new ProcessBuilder(cmd);
}
@Override
public void execute(String... command) {
List<String> cmd = new ArrayList<>();
cmd.add("ssh");
cmd.add(remote);
cmd.addAll(Arrays.asList(command));
execute(new ProcessBuilder(cmd));
}
@Override
public String getName() {
return remote;
}
@Override
public double getLoad() {
Process process;
try {
process = new ProcessBuilder("ssh", remote, "cat /proc/loadavg;cat /proc/meminfo").start();
if(!process.waitFor(1, TimeUnit.SECONDS))
return Double.POSITIVE_INFINITY;
} catch (IOException e) {
BungeeCore.get().getLogger().log(Level.SEVERE, "Could starting process to read load", e);
return Double.POSITIVE_INFINITY;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return Double.POSITIVE_INFINITY;
}
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
double cpuLoad = Double.parseDouble(bufferedReader.readLine().split(" ")[0]);
double totalMem = Double.parseDouble(bufferedReader.readLine().replaceAll(" +", " ").split(" ")[1]);
bufferedReader.readLine();
double freeMem = Double.parseDouble(bufferedReader.readLine().replaceAll(" +", " ").split(" ")[1]);
return cpuLoad / cores + (freeMem > MIN_FREE_MEM ? 0 : ((totalMem - freeMem) / totalMem));
} catch (IOException e) {
BungeeCore.get().getLogger().log(Level.SEVERE, "Could read load", e);
return Double.POSITIVE_INFINITY;
}
}
}
}

Datei anzeigen

@ -1,290 +0,0 @@
package de.steamwar.bungeecore;
import de.steamwar.bungeecore.sql.EventFight;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team;
import de.steamwar.bungeecore.sql.Tutorial;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.io.File;
import java.net.InetSocketAddress;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.BooleanSupplier;
import java.util.function.Function;
import java.util.stream.Collectors;
public class ServerStarter {
private static final boolean MAIN_SERVER = ProxyServer.getInstance().getConfig().getListeners().stream().anyMatch(info -> ((InetSocketAddress) info.getSocketAddress()).getPort() == 25565);
private static final Portrange BAU_PORTS = MAIN_SERVER ? new Portrange(10100, 20000) : new Portrange(2100, 2200);
private static final Portrange ARENA_PORTS = MAIN_SERVER ? new Portrange(3000, 3100) : (BungeeCore.EVENT_MODE ? new Portrange(4000, 5000) : BAU_PORTS);
private static final String BACKBONE = "/home/minecraft/";
private static final String SERVER_PATH = BACKBONE + "server/";
private static final String EVENT_PATH = BACKBONE + "event/";
public static final String TEMP_WORLD_PATH = BACKBONE + "arenaserver/";
public static final String TUTORIAL_PATH = BACKBONE + "tutorials/";
public static final String WORLDS18_PATH = BACKBONE + "userworlds18/";
private File directory = null;
private String worldDir = null;
private Node node = null;
private String serverJar = "spigot-1.15.2.jar";
private String xmx = "768M";
private Portrange portrange = BAU_PORTS;
private Function<Integer, String> serverNameProvider = port -> node.getName() + port;
private BooleanSupplier startCondition = () -> true;
private Runnable worldSetup = () -> {};
private String worldName = null;
private Runnable worldCleanup = () -> {};
private boolean allowMerge = false;
private String fightMap = null;
private String gameMode = null;
private ServerConstructor constructor = (serverName, port, builder, shutdownCallback) -> new Arenaserver(serverName, gameMode, fightMap, allowMerge, port, builder, shutdownCallback);
private final Set<ProxiedPlayer> playersToSend = new HashSet<>();
private final Map<String, String> arguments = new HashMap<>();
public ServerStarter arena(ArenaMode mode, String map) {
portrange = ARENA_PORTS;
serverNameProvider = port -> mode.getDisplayName() + (port - portrange.start);
serverJar = mode.serverJar();
allowMerge = true;
fightMap = map;
gameMode = mode.getInternalName();
directory = new File(SERVER_PATH, mode.getFolder());
arguments.put("config", mode.getConfig());
tempWorld(SERVER_PATH + mode.getFolder() + "/arenas/" + map);
return this;
}
public ServerStarter event(EventFight eventFight) {
arena(eventFight.getSpielmodus(), eventFight.getMap());
node = Node.local;
worldDir = EVENT_PATH;
worldCleanup = () -> {};
arguments.put("fightID", String.valueOf(eventFight.getFightID()));
fightMap = eventFight.getMap();
gameMode = eventFight.getSpielmodus().getInternalName();
String serverName = Team.get(eventFight.getTeamBlue()).getTeamKuerzel() + " vs " + Team.get(eventFight.getTeamRed()).getTeamKuerzel();
serverNameProvider = port -> serverName;
worldName = serverToWorldName(serverName + eventFight.getStartTime().toLocalDateTime().format(DateTimeFormatter.ISO_TIME));
return this;
}
public ServerStarter test(ArenaMode mode, String map, ProxiedPlayer owner) {
arena(mode, map);
buildWithTemp(owner);
portrange = BAU_PORTS;
arguments.put("fightID", String.valueOf(-1));
return send(owner);
}
public ServerStarter blueLeader(ProxiedPlayer player) {
arguments.put("blueLeader", player.getUniqueId().toString());
return send(player);
}
public ServerStarter redLeader(ProxiedPlayer player) {
arguments.put("redLeader", player.getUniqueId().toString());
return send(player);
}
public ServerStarter check(int schemID) {
arguments.put("checkSchemID", String.valueOf(schemID));
return this;
}
public ServerStarter prepare(int schemID) {
arguments.put("prepareSchemID", String.valueOf(schemID));
return this;
}
public ServerStarter replay(int replayID) {
arguments.put("replay", String.valueOf(replayID));
return this;
}
public ServerStarter build18(UUID owner) {
directory = new File(SERVER_PATH, "Bau18");
serverJar = "paper-1.18.2.jar";
worldDir = WORLDS18_PATH;
worldName = String.valueOf(SteamwarUser.get(owner).getId());
buildWithWorld(owner, new File(directory, "Bauwelt").getPath());
return this;
}
public ServerStarter build15(UUID owner) {
directory = new File(SERVER_PATH, "Bau15");
worldDir = BungeeCore.USERWORLDS15;
worldName = String.valueOf(SteamwarUser.get(owner).getId());
buildWithWorld(owner, BungeeCore.BAUWELT15);
return this;
}
public ServerStarter build12(UUID owner) {
directory = new File(SERVER_PATH, "UserBau");
serverJar = "spigot-1.12.2.jar";
xmx = "256M";
worldDir = BungeeCore.WORLD_FOLDER;
worldName = owner.toString();
buildWithWorld(owner, BungeeCore.BAUWELT_PROTOTYP);
return this;
}
public ServerStarter tutorial(ProxiedPlayer owner, Tutorial tutorial) {
directory = new File(SERVER_PATH, "Tutorial");
buildWithTemp(owner);
tempWorld(TUTORIAL_PATH + tutorial.id());
arguments.put("tutorial", String.valueOf(tutorial.id()));
return send(owner);
}
private void tempWorld(String template) {
worldDir = TEMP_WORLD_PATH;
worldSetup = () -> copyWorld(node, template, worldDir + worldName);
worldCleanup = () -> SubserverSystem.deleteFolder(node, worldDir + worldName);
}
private void buildWithWorld(UUID owner, String prototype) {
build(owner);
worldSetup = () -> {
File world = new File(worldDir, worldName);
if (!world.exists())
copyWorld(node, prototype, world.getPath());
};
// Send players to existing server
startCondition = () -> {
for(Subserver subserver : Subserver.getServerList()) {
if(subserver.getType() == Servertype.BAUSERVER && ((Bauserver)subserver).getOwner().equals(owner)) {
for(ProxiedPlayer p : playersToSend)
SubserverSystem.sendPlayer(subserver, p);
return false;
}
}
return true;
};
}
private void buildWithTemp(ProxiedPlayer owner) {
build(owner.getUniqueId());
// Stop existing build server
startCondition = () -> {
if(startingBau(owner))
return false;
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(owner.getUniqueId()) && subserver.hasStarted()) {
subserver.stop();
break;
}
}
return !startingBau(owner);
};
}
private void build(UUID owner) {
constructor = (serverName, port, builder, shutdownCallback) -> new Bauserver(serverName, owner, port, builder, shutdownCallback);
serverNameProvider = port -> bauServerName(SteamwarUser.get(owner));
}
public ServerStarter send(ProxiedPlayer player) {
playersToSend.add(player);
return this;
}
public Subserver start() {
if(!startCondition.getAsBoolean())
return null;
int port = portrange.freePort();
String serverName = serverNameProvider.apply(port);
if(node == null)
node = Node.getNode();
if(worldName == null)
worldName = serverToWorldName(serverName);
worldSetup.run();
arguments.put("logPath", worldName);
Subserver subserver = constructor.construct(serverName, port, node.startServer(
serverJar, directory, worldDir, worldName, port, xmx, arguments.entrySet().stream().map(entry -> entry.getKey() + "=" + entry.getValue()).toArray(String[]::new)
), worldCleanup);
for(ProxiedPlayer p : playersToSend)
SubserverSystem.sendPlayer(subserver, p);
return subserver;
}
private static boolean startingBau(ProxiedPlayer p) {
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId()) && !subserver.hasStarted()) {
Message.send("BAU_START_ALREADY", p);
return true;
}
}
return false;
}
public static String bauServerName(SteamwarUser user) {
return user.getUserName() + "s Bau";
}
public static String serverToWorldName(String serverName) {
return serverName.replace(' ', '_').replace("[", "").replace("]", "");
}
public static void copyWorld(Node node, String template, String target) {
node.execute("cp", "-r", template, target);
}
private interface ServerConstructor {
Subserver construct(String serverName, int port, ProcessBuilder builder, Runnable shutdownCallback);
}
private static class Portrange {
private final int start;
private final int end;
private int current;
private Portrange(int start, int end) {
this.start = start;
this.end = end;
current = start;
}
private void increment() {
current++;
if(current == end)
current = start;
}
private synchronized int freePort() {
Set<Integer> usedPorts;
synchronized (Subserver.getServerList()) {
usedPorts = Subserver.getServerList().stream().map(server -> ((InetSocketAddress) server.getServer().getSocketAddress()).getPort()).collect(Collectors.toSet());
}
while(usedPorts.contains(current)) {
increment();
}
int result = current;
increment();
return result;
}
}
}

Datei anzeigen

@ -1,58 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore;
import de.steamwar.bungeecore.comms.handlers.FightInfoHandler;
import de.steamwar.bungeecore.comms.packets.StartingServerPacket;
import de.steamwar.bungeecore.sql.IgnoreSystem;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.UUID;
public class SubserverSystem {
private SubserverSystem(){}
public static void deleteFolder(Node node, String worldName) {
node.execute("rm", "-r", worldName);
}
public static void sendDeniedMessage(ProxiedPlayer p, UUID owner){
ProxiedPlayer o = ProxyServer.getInstance().getPlayer(owner);
if(o == null)
return;
if(IgnoreSystem.isIgnored(o, p)){
Message.send("SERVER_IGNORED", p);
return;
}
Message.send("SERVER_ADD_MEMBER", o, p.getName());
Message.sendPrefixless("SERVER_ADD_MESSAGE", o, Message.parse("SERVER_ADD_MESSAGE_HOVER", o, p.getName()),
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/bau addmember " + p.getName()));
}
public static void sendPlayer(Subserver subserver, ProxiedPlayer player) {
subserver.sendPlayer(player);
if(!subserver.hasStarted() && FightInfoHandler.onLobby(player))
new StartingServerPacket(SteamwarUser.get(player.getUniqueId())).send(player);
}
}

Datei anzeigen

@ -1,81 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Emoji;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.interactions.components.ActionRow;
import net.dv8tion.jda.api.interactions.components.Button;
import java.util.*;
import java.util.concurrent.TimeUnit;
public class AuthManager {
private static final Map<String, Long> TOKENS = new HashMap<>();
private static final Random rand = new Random();
public static String createDiscordAuthToken(Member member) {
if(TOKENS.containsValue(member.getIdLong())) return null;
byte[] randBytes = new byte[16];
rand.nextBytes(randBytes);
randBytes[0] = 'D';
randBytes[1] = 'C';
String code = Base64.getEncoder().encodeToString(randBytes);
TOKENS.put(code, member.getIdLong());
BungeeCore.log("Created Discord Auth-Token: " + code + " for: " + member.getUser().getAsTag());
BungeeCore.get().getProxy().getScheduler().schedule(BungeeCore.get(), () -> TOKENS.remove(code), 10, TimeUnit.MINUTES);
return code;
}
public static Member connectAuth(SteamwarUser user, String code) {
if (TOKENS.containsKey(code)) {
Member member = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD).retrieveMemberById(TOKENS.get(code).longValue()).complete();
if(member == null) return null;
user.setDiscordId(member.getIdLong());
MessageBuilder builder = new MessageBuilder();
builder.setContent(":white_check_mark: Dein Discord Konto wurde mit **" + user.getUserName() + "** verknüpft");
builder.setActionRows(ActionRow.of(Button.success("tada", Emoji.fromUnicode("U+1F389")), Button.danger("invalid", "Ich war das nicht")));
try {
member.getUser().openPrivateChannel().queue(privateChannel -> privateChannel.sendMessage(builder.build()).queue());
if (member.getNickname() == null) {
try {
member.getGuild().modifyNickname(member, user.getUserName()).queue();
} catch (Exception e) {
// Ignored
}
}
TOKENS.remove(code);
return member;
} catch (Exception e) {
return null;
}
} else {
return null;
}
}
}

Datei anzeigen

@ -1,166 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.bot.commands.*;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.bot.events.EventManager;
import de.steamwar.bungeecore.bot.events.SchematicsManager;
import de.steamwar.bungeecore.bot.listeners.*;
import de.steamwar.bungeecore.bot.util.DiscordRolesMessage;
import de.steamwar.bungeecore.bot.util.DiscordRulesMessage;
import de.steamwar.bungeecore.bot.util.DiscordTicketMessage;
import de.steamwar.bungeecore.sql.Event;
import de.steamwar.messages.ChatSender;
import lombok.Getter;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.OnlineStatus;
import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.exceptions.ErrorResponseException;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import net.dv8tion.jda.api.requests.restaction.CommandListUpdateAction;
import net.dv8tion.jda.api.utils.MemberCachePolicy;
import net.md_5.bungee.api.ProxyServer;
import javax.security.auth.login.LoginException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
public class SteamwarDiscordBot {
private static SteamwarDiscordBot INSTANCE;
public static SteamwarDiscordBot instance() {
return INSTANCE;
}
@Getter
private volatile AnnouncementListener announcementListener;
@Getter
private volatile DiscordChatListener ingameChatListener;
@Getter
private volatile DiscordChatListener serverTeamChatListener;
@Getter
private final JDA jda;
@Getter
private static Map<String, BasicDiscordCommand> discordCommandMap = new HashMap<>();
public SteamwarDiscordBot() {
INSTANCE = this;
JDABuilder builder = JDABuilder.createDefault(SteamwarDiscordBotConfig.TOKEN);
builder.setStatus(OnlineStatus.ONLINE);
builder.setMemberCachePolicy(MemberCachePolicy.ONLINE);
try {
jda = builder.build();
} catch (LoginException e) {
throw new SecurityException("Could not Login: " + SteamwarDiscordBotConfig.TOKEN, e);
}
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
try {
jda.awaitReady();
} catch (InterruptedException e) {
e.printStackTrace();
}
try {
activity();
} catch (Exception e) {
BungeeCore.get().getLogger().log(Level.SEVERE, "Could not set initial activity to discord", e);
}
EventManager.update();
SchematicsManager.update();
ProxyServer.getInstance().getScheduler().schedule(BungeeCore.get(), () -> {
try {
activity();
EventManager.update();
SchematicsManager.update();
} catch (ErrorResponseException e) {
//ignored
}
}, 30, 30, TimeUnit.SECONDS);
DiscordRolesMessage.sendMessage();
DiscordRulesMessage.sendMessage();
DiscordTicketMessage.sendMessage();
new RolesInteractionButtonListener();
new DiscordTicketListener();
new DiscordAuthListener();
new DiscordEventListener();
new PrivateMessageListener();
announcementListener = new AnnouncementListener();
ingameChatListener = new DiscordChatListener(SteamwarDiscordBotConfig.INGAME_CHANNEL, "CHAT_DISCORD_GLOBAL", ChatSender::globalReceivers);
serverTeamChatListener = new DiscordChatListener(SteamwarDiscordBotConfig.SERVER_TEAM_CHANNEL, "CHAT_SERVERTEAM", ChatSender::serverteamReceivers);
new SlashCommandListener();
jda.retrieveCommands().complete().forEach(command -> jda.deleteCommandById(command.getId()).queue());
Guild guild = jda.getGuildById(SteamwarDiscordBotConfig.GUILD);
guild.retrieveCommands().complete().forEach(command -> guild.deleteCommandById(command.getId()).complete());
CommandListUpdateAction commands = jda.getGuildById(SteamwarDiscordBotConfig.GUILD).updateCommands();
addCommand(commands, new MuteCommand());
addCommand(commands, new BanCommand());
addCommand(commands, new WhoisCommand());
addCommand(commands, new TeamCommand());
addCommand(commands, new ListCommand());
addCommand(commands, new UnbanCommand());
commands.complete();
});
}
private void addCommand(CommandListUpdateAction commands, BasicDiscordCommand basicDiscordCommand) {
commands.addCommands(basicDiscordCommand);
discordCommandMap.put(basicDiscordCommand.getName(), basicDiscordCommand);
}
private int index = 0;
private void activity() {
switch (index) {
case 0:
Event event = Event.get();
if (event != null) {
jda.getPresence().setActivity(Activity.competing("dem Event " + event.getEventName()));
} else {
jda.getPresence().setActivity(Activity.playing("auf SteamWar.de"));
}
break;
case 1:
int count = BungeeCore.get().getProxy().getOnlineCount();
if (count == 1) {
jda.getPresence().setActivity(Activity.playing("mit 1 Spieler"));
} else {
jda.getPresence().setActivity(Activity.playing("mit " + count + " Spielern"));
}
index = 0;
return;
}
index++;
}
public void addListener(ListenerAdapter listenerAdapter) {
jda.addEventListener(listenerAdapter);
}
}

Datei anzeigen

@ -1,67 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.commands.PunishmentCommand;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import java.sql.Timestamp;
public class BanCommand extends BasicDiscordCommand {
public BanCommand() {
super("ban", "Banne einen Nutzer, wenn du die Rechte hast.");
addOption(OptionType.STRING, "user", "Der Benutzer", true);
addOption(OptionType.STRING, "time", "Bis Wann", true);
addOption(OptionType.STRING, "reason", "Warum", true);
}
@Override
public void run(SlashCommandEvent event) {
if (!testPermission(event)) {
return;
}
SteamwarUser sender = SteamwarUser.get(event.getMember().getIdLong());
SteamwarUser target = SteamwarUser.getOrCreateOfflinePlayer(event.getOption("user").getAsString());
if (target == null) {
event.reply("Angegebener User invalide").setEphemeral(true).queue();
return;
}
Timestamp time = PunishmentCommand.parseTime(null, event.getOption("time").getAsString());
if (time == null) {
event.reply("Angegebene Zeit invalide").setEphemeral(true).queue();
return;
}
String msg = event.getOption("reason").getAsString();
boolean isPerma = event.getOption("time").getAsString().equals("perma");
target.punish(Punishment.PunishmentType.Ban, time, msg, sender.getId(), isPerma);
Message.team("BAN_TEAM", new Message("PREFIX"), target.getUserName(), sender.getUserName(), new Message((isPerma ? "BAN_PERMA" : "BAN_UNTIL"), time), msg);
event.reply("Erfolgreich " + target.getUserName() + (isPerma ? " permanent" : " bis " + time) + " gebannt").setEphemeral(true).queue();
}
}

Datei anzeigen

@ -1,54 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.commands;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.UserGroup;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.interactions.commands.build.CommandData;
public abstract class BasicDiscordCommand extends CommandData {
protected BasicDiscordCommand(String name, String description) {
super(name, description);
}
public abstract void run(SlashCommandEvent event);
protected SteamwarUser getSteamwarUser(SlashCommandEvent event) {
Member member = event.getMember();
SteamwarUser steamwarUser = SteamwarUser.get(member.getIdLong());
if (steamwarUser == null) {
return null;
}
return steamwarUser;
}
protected boolean testPermission(SlashCommandEvent event) {
Member member = event.getMember();
SteamwarUser steamwarUser = SteamwarUser.get(member.getIdLong());
if (steamwarUser == null || (!steamwarUser.getUserGroup().isTeamGroup() && steamwarUser.getUserGroup() != UserGroup.Builder)) {
event.reply("Du hast für " + event.getName() + " keine Rechte oder es existiert keine Verknüpfung für dich.").setEphemeral(true).queue();
return false;
}
return true;
}
}

Datei anzeigen

@ -1,43 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.commands;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import java.util.stream.Collectors;
public class ListCommand extends BasicDiscordCommand {
public ListCommand() {
super("list", "Gebe eine Liste aller online Spieler");
}
@Override
public void run(SlashCommandEvent event) {
de.steamwar.bungeecore.commands.ListCommand.getCustomTablist();
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setTitle("List");
de.steamwar.bungeecore.commands.ListCommand.getCustomTablist().forEach((s, proxiedPlayers) -> {
embedBuilder.addField(s, proxiedPlayers.stream().map(player -> "`" + player.getName() + "`").collect(Collectors.joining(", ")), true);
});
event.replyEmbeds(embedBuilder.build()).setEphemeral(true).queue();
}
}

Datei anzeigen

@ -1,67 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.commands.PunishmentCommand;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import java.sql.Timestamp;
public class MuteCommand extends BasicDiscordCommand {
public MuteCommand() {
super("mute", "Mute einen Nutzer, wenn du die Rechte hast.");
addOption(OptionType.STRING, "user", "Der Benutzer", true);
addOption(OptionType.STRING, "time", "Bis Wann", true);
addOption(OptionType.STRING, "reason", "Warum", true);
}
@Override
public void run(SlashCommandEvent event) {
if (!testPermission(event)) {
return;
}
SteamwarUser sender = SteamwarUser.get(event.getMember().getIdLong());
SteamwarUser target = SteamwarUser.getOrCreateOfflinePlayer(event.getOption("user").getAsString());
if (target == null) {
event.reply("Angegebener User invalide").setEphemeral(true).complete();
return;
}
Timestamp time = PunishmentCommand.parseTime(null, event.getOption("time").getAsString());
if (time == null) {
event.reply("Angegebene Zeit invalide").setEphemeral(true).complete();
return;
}
String msg = event.getOption("reason").getAsString();
boolean isPerma = event.getOption("time").getAsString().equals("perma");
target.punish(Punishment.PunishmentType.Mute, time, msg, sender.getId(), isPerma);
Message.team("MUTE_TEAM", new Message("PREFIX"), target.getUserName(), sender.getUserName(), new Message((isPerma ? "BAN_PERMA" : "BAN_UNTIL"), time), msg);
event.reply("Erfolgreich " + target.getUserName() + (isPerma ? " permanent" : " bis " + time) + " gemutet").setEphemeral(true).queue();
}
}

Datei anzeigen

@ -1,96 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.commands;
import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team;
import de.steamwar.bungeecore.sql.TeamTeilnahme;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.Emoji;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.interactions.commands.OptionMapping;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
import net.md_5.bungee.api.ProxyServer;
import java.awt.*;
import java.util.List;
import java.util.stream.Collectors;
public class TeamCommand extends BasicDiscordCommand {
public TeamCommand() {
super("team", "Alle Team bezogenen Befehle");
addSubcommands(new SubcommandData("info", "Infos über das Team oder deins")
.addOption(OptionType.STRING, "team", "Name oder Kuerzel", false)
);
}
private Emoji emoji = Emoji.fromUnicode("U+1F7E2");
@Override
public void run(SlashCommandEvent event) {
SteamwarUser steamwarUser = getSteamwarUser(event);
if (event.getSubcommandName() != null) {
switch (event.getSubcommandName()) {
case "info":
OptionMapping optionMapping = event.getOption("team");
Team team;
if (optionMapping == null) {
if (steamwarUser == null) {
event.reply("Dein Discord ist nicht verknüpft").setEphemeral(true).queue();
return;
}
if (steamwarUser.getTeam() == 0) {
event.reply("Du bist in keinem Team").setEphemeral(true).queue();
return;
}
team = Team.get(steamwarUser.getTeam());
} else {
team = Team.get(optionMapping.getAsString());
}
if (team == null) {
event.reply("Unbekanntes Team").setEphemeral(true).queue();
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setTitle("Team: " + team.getTeamName() + " [" + team.getTeamKuerzel() + "]");
embedBuilder.setColor(Color.GRAY);
List<SteamwarUser> members = team.getMembers().stream().map(SteamwarUser::get).collect(Collectors.toList());
embedBuilder.addField("Leader", members.stream().filter(SteamwarUser::isLeader).map(user -> "`" + (isOnline(user) ? emoji.getAsMention() : "") + user.getUserName() + "`").collect(Collectors.joining(" ")), false);
embedBuilder.addField("Member", members.stream().filter(user -> !user.isLeader()).map(user -> "`" + (isOnline(user) ? emoji.getAsMention() : "") + user.getUserName() + "`").collect(Collectors.joining(" ")), false);
embedBuilder.addField("Events", "`" + TeamTeilnahme.getEvents(team.getTeamId()).stream().map(Event::getEventName).collect(Collectors.joining("` `")) + "`", false);
event.replyEmbeds(embedBuilder.build()).setEphemeral(true).queue();
return;
default:
event.reply("Unbekannter Befehl").setEphemeral(true).queue();
return;
}
}
}
private boolean isOnline(SteamwarUser user) {
return ProxyServer.getInstance().getPlayer(user.getUuid()) != null;
}
}

Datei anzeigen

@ -1,59 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.commands;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import java.sql.Timestamp;
import java.util.Date;
public class UnbanCommand extends BasicDiscordCommand {
public UnbanCommand() {
super("unban", "Entbannt einen Nutzer, wenn du die Rechte hast.");
addOption(OptionType.STRING, "user", "Der Benutzer", true);
}
@Override
public void run(SlashCommandEvent event) {
if (!testPermission(event)) {
return;
}
SteamwarUser sender = SteamwarUser.get(event.getMember().getIdLong());
SteamwarUser target = SteamwarUser.getOrCreateOfflinePlayer(event.getOption("user").getAsString());
if (target == null) {
event.reply("Angegebener User invalide").setEphemeral(true).queue();
return;
}
if (!target.isPunished(Punishment.PunishmentType.Ban)) {
event.reply("Angegebener User ist nicht gebannt").setEphemeral(true).queue();
return;
}
target.punish(Punishment.PunishmentType.Ban, Timestamp.from(new Date().toInstant()), "Unban", sender.getId(), false);
event.reply("Erfolgreich " + target.getUserName() + " entbannt").setEphemeral(true).queue();
}
}

Datei anzeigen

@ -1,94 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.commands;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.util.List;
public class WhoisCommand extends BasicDiscordCommand {
public WhoisCommand() {
super("whois", "Der whois Befehl");
addOption(OptionType.STRING, "user", "Der Benutzer", true);
}
@Override
public void run(SlashCommandEvent event) {
if (!testPermission(event)) {
return;
}
String s = event.getOption("user").getAsString();
SteamwarUser user = SteamwarUser.get(s);
if (user == null) {
try {
int id = Integer.parseInt(s);
user = SteamwarUser.get(id);
} catch (NumberFormatException ignored) {
// Ignored
}
}
if (user == null) {
try {
long id = Long.parseLong(s);
user = SteamwarUser.get(id);
} catch (NumberFormatException ignored) {
// Ignored
}
}
if (user == null) {
event.reply("Der angegebene Spieler ist unbekannt").setEphemeral(true).complete();
return;
}
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setTitle("Whois: " + user.getUserName());
StringBuilder st = new StringBuilder();
st.append("UUID: ").append(user.getUuid()).append("\n");
st.append("ID: ").append(user.getId()).append("\n");
if (user.getDiscordId() != null) {
st.append("DiscordID: ").append(user.getDiscordId()).append("\n");
}
Timestamp timestamp = user.getFirstjoin();
st.append("Beigetreten am: ").append(timestamp == null ? "0000-00-00 00:00:00" : timestamp.toString()).append("\n");
st.append("Online Time: ").append(new DecimalFormat("###.##").format(user.getOnlinetime() / (double) 3600)).append("h\n");
Team team = Team.get(user.getTeam());
st.append("Team: [").append(team.getTeamKuerzel()).append("] ").append(team.getTeamName());
embedBuilder.addField("Daten:", st.toString(), false);
List<Punishment> punishmentList = Punishment.getAllPunishmentsOfPlayer(user.getId());
for (Punishment punishment : punishmentList) {
embedBuilder.addField(punishment.getType().name() + " von " + SteamwarUser.get(punishment.getPunisher()).getUserName(), "Von: " + punishment.getBantime(punishment.getStartTime(), false) + "\nBis: " + punishment.getBantime(punishment.getEndTime(), punishment.isPerma()) + "\nGrund: " + punishment.getReason(), true);
}
event.replyEmbeds(embedBuilder.build()).setEphemeral(true).queue();
}
}

Datei anzeigen

@ -1,39 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.config;
import lombok.AllArgsConstructor;
import lombok.Data;
import net.dv8tion.jda.api.entities.Emoji;
import net.dv8tion.jda.api.interactions.components.Button;
import net.dv8tion.jda.api.interactions.components.ButtonStyle;
@Data
@AllArgsConstructor
public class DiscordRole {
private String emoji;
private String label;
private String roleId;
public Button toButton() {
return Button.of(ButtonStyle.SECONDARY, roleId, label, Emoji.fromUnicode(emoji));
}
}

Datei anzeigen

@ -1,36 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.config;
import lombok.AllArgsConstructor;
import lombok.Data;
import net.dv8tion.jda.api.interactions.components.Button;
@Data
@AllArgsConstructor
public class DiscordRulesLink {
private String label;
private String link;
public Button toButton() {
return Button.link(link, label);
}
}

Datei anzeigen

@ -1,41 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.config;
import lombok.AllArgsConstructor;
import lombok.Data;
import net.dv8tion.jda.api.entities.Emoji;
import net.dv8tion.jda.api.interactions.components.Button;
import net.dv8tion.jda.api.interactions.components.ButtonStyle;
@Data
@AllArgsConstructor
public class DiscordTicketType {
private String key;
private String emoji;
private String label;
private String color;
private String preMessage;
public Button toButton() {
return Button.of(ButtonStyle.valueOf(color), key, Emoji.fromUnicode(emoji)).withLabel(label);
}
}

Datei anzeigen

@ -1,116 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.config;
import de.steamwar.bungeecore.sql.UserGroup;
import net.md_5.bungee.config.Configuration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SteamwarDiscordBotConfig {
public static boolean loaded = false;
public static String TOKEN;
public static String GUILD;
public static String ANNOUNCEMENTS_CHANNEL;
public static String EVENTS_CHANNEL;
public static String INGAME_CHANNEL;
public static String SERVER_TEAM_CHANNEL;
public static String SCHEMATICS_CHANNEL;
public static String ROLES_CHANNEL;
public static String ROLES_BASE_MESSAGE;
public static String ROLES_ADDED;
public static String ROLES_REMOVED;
public static List<DiscordRole> ROLES;
public static String RULES_CHANNEL;
public static String RULES_TITLE;
public static List<String> RULES_RULES;
public static List<DiscordRulesLink> RULES_LINKS;
public static String TICKET_CATEGORY;
public static String TICKET_CHANNEL;
public static String TICKET_MESSAGE;
public static String TICKET_CREATED;
public static String TICKET_LOG;
public static Map<String, DiscordTicketType> TICKET_TYPES;
public static Map<UserGroup, String> RANKS;
public static void loadConfig(Configuration config) {
TOKEN = config.getString("token");
GUILD = config.getString("guild");
ANNOUNCEMENTS_CHANNEL = config.getString("announcements-channel");
EVENTS_CHANNEL = config.getString("events-channel");
INGAME_CHANNEL = config.getString("ingame-channel");
SERVER_TEAM_CHANNEL = config.getString("server-team-channel");
SCHEMATICS_CHANNEL = config.getString("schematics-channel");
Configuration rolesSection = config.getSection("roles-claim");
ROLES_CHANNEL = rolesSection.getString("channel");
ROLES_BASE_MESSAGE = rolesSection.getString("base");
ROLES_ADDED = rolesSection.getString("added");
ROLES_REMOVED = rolesSection.getString("removed");
ROLES = new ArrayList<>();
for (String roles : rolesSection.getSection("roles").getKeys()) {
Configuration role = rolesSection.getSection("roles").getSection(roles);
ROLES.add(new DiscordRole(role.getString("emoji"),
role.getString("label"),
role.getString("roleId")));
}
Configuration rulesSection = config.getSection("rules");
RULES_CHANNEL = rulesSection.getString("channel");
RULES_TITLE = rulesSection.getString("title");
RULES_RULES = rulesSection.getStringList("rules");
RULES_LINKS = new ArrayList<>();
for (String links : rulesSection.getSection("links").getKeys()) {
Configuration link = rulesSection.getSection("links").getSection(links);
RULES_LINKS.add(new DiscordRulesLink(link.getString("label"),
link.getString("url")));
}
Configuration ticketSection = config.getSection("tickets");
TICKET_CATEGORY = ticketSection.getString("category");
TICKET_CHANNEL = ticketSection.getString("channel");
TICKET_MESSAGE = ticketSection.getString("message");
TICKET_CREATED = ticketSection.getString("created");
TICKET_LOG = ticketSection.getString("log");
TICKET_TYPES = new HashMap<>();
for (String types : ticketSection.getSection("types").getKeys()) {
Configuration type = ticketSection.getSection("types").getSection(types);
TICKET_TYPES.put(types, new DiscordTicketType(types,
type.getString("emoji"),
type.getString("label"),
type.getString("color"),
type.getString("pre")));
}
RANKS = new HashMap<>();
Configuration ranksSections = config.getSection("ranks");
for (String type : ranksSections.getKeys()) {
RANKS.put(UserGroup.getUsergroup(type), ranksSections.getString(type));
}
loaded = true;
}
}

Datei anzeigen

@ -1,73 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.events;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.commands.CheckCommand;
import de.steamwar.bungeecore.sql.SteamwarUser;
import lombok.experimental.UtilityClass;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel;
import java.awt.*;
@UtilityClass
public class SchematicsManager {
private Message message;
private TextChannel textChannel;
static {
textChannel = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD).getTextChannelById(SteamwarDiscordBotConfig.SCHEMATICS_CHANNEL);
assert textChannel != null;
if(textChannel.hasLatestMessage()) {
message = textChannel.getIterableHistory().complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null);
}
}
public void update() {
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setColor(Color.GRAY);
embedBuilder.setTitle("Check List");
embedBuilder.setAuthor("SteamWar", "https://www.steamwar.de");
CheckCommand.getSchemsToCheck().forEach(schematic -> {
StringBuilder st = new StringBuilder();
st.append("Typ: ").append(schematic.getSchemtype().getKuerzel());
st.append("\nVon: ").append(SteamwarUser.get(schematic.getOwner()).getUserName());
String checker = CheckCommand.getChecker(schematic);
if (checker != null) {
st.append("\nWird Geprüft von: ").append(checker);
}
embedBuilder.addField(schematic.getName(), st.toString(), true);
});
MessageBuilder messageBuilder = new MessageBuilder();
messageBuilder.setEmbeds(embedBuilder.build());
if (message == null) {
textChannel.sendMessage(messageBuilder.build()).queue(message1 -> message = message1);
} else {
message.editMessage(messageBuilder.build()).queue();
}
}
}

Datei anzeigen

@ -1,50 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.listeners;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
import org.jetbrains.annotations.NotNull;
public class AnnouncementListener extends BasicDiscordListener {
@Override
public void onGuildMessageReceived(@NotNull GuildMessageReceivedEvent event) {
if (!event.getChannel().getId().equals(SteamwarDiscordBotConfig.ANNOUNCEMENTS_CHANNEL)) {
return;
}
if (event.getAuthor().isBot()) {
return;
}
Message.broadcast("ALERT", event.getMessage().getContentDisplay());
}
public void announce(String message) {
TextChannel textChannel = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD).getTextChannelById(SteamwarDiscordBotConfig.ANNOUNCEMENTS_CHANNEL);
assert textChannel != null;
MessageBuilder messageBuilder = new MessageBuilder();
messageBuilder.append(message.replace("&", ""));
textChannel.sendMessage(messageBuilder.build()).queue();
}
}

Datei anzeigen

@ -1,30 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.listeners;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
public abstract class BasicDiscordListener extends ListenerAdapter {
BasicDiscordListener() {
SteamwarDiscordBot.instance().addListener(this);
}
}

Datei anzeigen

@ -1,59 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.listeners;
import de.steamwar.bungeecore.bot.AuthManager;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.dv8tion.jda.api.entities.ChannelType;
import net.dv8tion.jda.api.events.interaction.GenericComponentInteractionCreateEvent;
import net.dv8tion.jda.api.interactions.InteractionType;
import org.jetbrains.annotations.NotNull;
public class DiscordAuthListener extends BasicDiscordListener {
@Override
public void onGenericComponentInteractionCreate(@NotNull GenericComponentInteractionCreateEvent event) {
if(event.getType() == InteractionType.COMPONENT) {
if(event.getChannel().getId().equals(SteamwarDiscordBotConfig.RULES_CHANNEL) && event.getComponentId().equals("auth")) {
String authMessage = AuthManager.createDiscordAuthToken(event.getMember());
if(authMessage != null) {
event.reply("Gebe innerhalb der nächsten 10 Minuten ``/verify " + authMessage + "`` auf dem Minecraft Server ein").setEphemeral(true).queue();
} else {
event.reply("Du hast bereits einen Code am laufen").setEphemeral(true).queue();
}
}
if(event.getComponentId().equals("tada") && event.getChannelType() == ChannelType.PRIVATE) {
event.reply(":tada:").setEphemeral(false).queue();
}
if(event.getComponentId().equals("invalid") && event.getChannelType() == ChannelType.PRIVATE) {
SteamwarUser user = SteamwarUser.get(event.getUser().getIdLong());
if(user == null) {
event.reply(":question: Da ist keine verknüpfung?").setEphemeral(false).queue();
} else {
user.setDiscordId(null);
event.reply(":x: Die Verknüpfung wurde beendet").setEphemeral(false).queue();
}
}
}
}
}

Datei anzeigen

@ -1,71 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.listeners;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.listeners.ChatListener;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.messages.ChatSender;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
import org.jetbrains.annotations.NotNull;
import java.util.function.Supplier;
import java.util.stream.Stream;
public class DiscordChatListener extends BasicDiscordListener {
private final String channel;
private final String format;
private final Supplier<Stream<ChatSender>> targets;
public DiscordChatListener(String channel, String format, Supplier<Stream<ChatSender>> targets) {
this.channel = channel;
this.format = format;
this.targets = targets;
}
@Override
public void onGuildMessageReceived(@NotNull GuildMessageReceivedEvent event) {
if (!event.getChannel().getId().equals(channel) || event.getAuthor().isBot())
return;
Member member = event.getMember();
SteamwarUser steamwarUser = SteamwarUser.get(member.getIdLong());
if (steamwarUser == null || event.getMessage().getContentRaw().length() > 250 || steamwarUser.isPunished(Punishment.PunishmentType.Ban)) {
event.getMessage().delete().queue();
} else {
ChatListener.sendChat(ChatSender.of(event.getMessage(), steamwarUser), targets.get(), format, null, event.getMessage().getContentDisplay().replace('§', '&').replace('\n', ' '));
}
}
public void send(String message) {
TextChannel textChannel = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD).getTextChannelById(channel);
assert textChannel != null;
MessageBuilder messageBuilder = new MessageBuilder();
messageBuilder.append(message.replace("&", "").replace("@everyone", "`@everyone`").replace("@here", "`@here`").replaceAll("<[@#]!?\\d+>", "`$0`"));
textChannel.sendMessage(messageBuilder.build()).queue();
}
}

Datei anzeigen

@ -1,93 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.listeners;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.bot.events.EventManager;
import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team;
import de.steamwar.bungeecore.sql.TeamTeilnahme;
import net.dv8tion.jda.api.events.interaction.SelectionMenuEvent;
import net.dv8tion.jda.api.interactions.components.Component;
import org.jetbrains.annotations.NotNull;
import java.time.Instant;
public class DiscordEventListener extends BasicDiscordListener {
@Override
public void onSelectionMenu(@NotNull SelectionMenuEvent event) {
if(event.getChannel().getId().equals(SteamwarDiscordBotConfig.EVENTS_CHANNEL) && event.getComponentType() == Component.Type.SELECTION_MENU) {
if(event.getSelectedOptions().isEmpty()) {
event.deferReply(true).queue();
return;
}
if(event.getSelectedOptions().get(0).getValue().matches("([0-9]+)")) {
SteamwarUser user = SteamwarUser.get(event.getUser().getIdLong());
if(user == null) {
event.reply("Du hast dein Minecraft nicht verknüpft").setEphemeral(true).queue();
return;
}
if(user.getTeam() == 0) {
event.reply("Du bist in keinem Team").setEphemeral(true).queue();
return;
}
if(!user.isLeader()) {
event.reply("Du bist kein Leader in deinem Team").setEphemeral(true).queue();
return;
}
if(Event.get() != null) {
event.reply("Du kannst dich nicht während einem Event an einem Event anmelden").setEphemeral(true).queue();
return;
}
Event swEvent = Event.get(Integer.decode(event.getSelectedOptions().get(0).getValue()));
if(swEvent == null){
event.reply("Das Event gibt es nicht").setEphemeral(true).queue();
return;
}
if(Instant.now().isAfter(swEvent.getDeadline().toInstant())){
event.reply("Du kannst dich nicht mehr an diesen Event anmelden").setEphemeral(true).queue();
return;
}
Team team = Team.get(user.getTeam());
if(TeamTeilnahme.nimmtTeil(team.getTeamId(), swEvent.getEventID())){
TeamTeilnahme.notTeilnehmen(team.getTeamId(), swEvent.getEventID());
event.reply("Dein Team **" + team.getTeamName() + "** nimmt nun nicht mehr an **" + swEvent.getEventName() + "** teil!").setEphemeral(true).queue();
}else{
TeamTeilnahme.teilnehmen(team.getTeamId(), swEvent.getEventID());
event.reply("Dein Team **" + team.getTeamName() + "** nimmt nun an **" + swEvent.getEventName() + "** teil!").setEphemeral(true).queue();
}
EventManager.update();
} else {
event.reply("Lefuq?").setEphemeral(true).queue();
}
}
}
}

Datei anzeigen

@ -1,156 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.listeners;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.bot.config.DiscordTicketType;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.interaction.GenericComponentInteractionCreateEvent;
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
import net.dv8tion.jda.api.interactions.InteractionType;
import net.dv8tion.jda.api.interactions.components.ActionRow;
import net.dv8tion.jda.api.interactions.components.Button;
import net.md_5.bungee.api.chat.ClickEvent;
import org.jetbrains.annotations.NotNull;
import java.awt.*;
import java.time.Instant;
import java.util.LinkedList;
public class DiscordTicketListener extends BasicDiscordListener {
@Override
public void onGenericComponentInteractionCreate(@NotNull GenericComponentInteractionCreateEvent event) {
if(event.getType() == InteractionType.COMPONENT && event.getChannelType() == ChannelType.TEXT && event.getTextChannel().getParent() != null && event.getTextChannel().getParent().getId().equals(SteamwarDiscordBotConfig.TICKET_CATEGORY)) {
if(event.getTextChannel().getId().equals(SteamwarDiscordBotConfig.TICKET_CHANNEL) && SteamwarDiscordBotConfig.TICKET_TYPES.containsKey(event.getComponentId())) {
DiscordTicketType ticketType = SteamwarDiscordBotConfig.TICKET_TYPES.get(event.getComponentId());
Category ct = event.getGuild().getCategoryById(SteamwarDiscordBotConfig.TICKET_CATEGORY);
SteamwarUser swUser = SteamwarUser.get(event.getUser().getIdLong());
TextChannel ticketChannel = ct.createTextChannel((swUser == null?event.getUser().getName():swUser.getUserName()) + "-" + event.getComponentId() + "-" + System.currentTimeMillis() % 1000).complete();
ticketChannel.createPermissionOverride(event.getMember()).setAllow(Permission.VIEW_CHANNEL,
Permission.MESSAGE_WRITE,
Permission.MESSAGE_ATTACH_FILES,
Permission.MESSAGE_ADD_REACTION,
Permission.MESSAGE_READ,
Permission.MESSAGE_EMBED_LINKS,
Permission.MESSAGE_HISTORY).complete();
ticketChannel.getManager().setTopic(event.getUser().getId()).complete();
MessageBuilder messageBuilder = new MessageBuilder();
EmbedBuilder builder = new EmbedBuilder();
builder.setDescription(ticketType.getPreMessage());
builder.setTitle("Steamwar Ticket");
builder.setColor(Color.GREEN);
Button closeButton = Button.danger("close-" + ticketChannel.getName(), "Schließen").withEmoji(Emoji.fromUnicode("U+26A0"));
messageBuilder.setEmbeds(builder.build());
messageBuilder.setActionRows(ActionRow.of(closeButton));
ticketChannel.sendMessage(messageBuilder.build()).complete();
event.reply(SteamwarDiscordBotConfig.TICKET_CREATED.replace("%channel%", ticketChannel.getAsMention())).setEphemeral(true).complete();
Message.team("DISCORD_TICKET_NEW", ticketChannel.getName());
} else if(event.getComponentId().startsWith("close-")) {
TextChannel logChannel = event.getGuild().getTextChannelById(SteamwarDiscordBotConfig.TICKET_LOG);
LinkedList<StringBuilder> stringBuilders = new LinkedList<>();
stringBuilders.add(new StringBuilder());
new LinkedList<>(event.getTextChannel().getIterableHistory().complete()).descendingIterator().forEachRemaining(message -> {
if(message.getAuthor().isSystem() || message.getAuthor().isBot()) return;
StringBuilder currentBuilder = new StringBuilder();
currentBuilder.append("<t:").append(message.getTimeCreated().toInstant().getEpochSecond()).append("> ")
.append("**")
.append(message.getAuthor().getName())
.append("**: ")
.append(message.getContentRaw());
if(!message.getAttachments().isEmpty()) {
currentBuilder.append("\n")
.append("Files: ").append("\n");
message.getAttachments().forEach(attachment -> currentBuilder.append(attachment.getUrl()).append("\n"));
}
currentBuilder.append("\n");
if(currentBuilder.length() >= 4096) {
stringBuilders.getLast().append(currentBuilder.substring(0, 4090));
stringBuilders.add(new StringBuilder(currentBuilder.substring(4090, currentBuilder.length() - 1)));
} else if (currentBuilder.length() + stringBuilders.getLast().length() >= 4096) {
stringBuilders.add(new StringBuilder(currentBuilder.toString()));
} else {
stringBuilders.getLast().append(currentBuilder);
}
});
String footer = "<t:" + Instant.now().getEpochSecond() + "> **" + event.getUser().getName() + "**: Ticket geschlossen";
if(stringBuilders.getLast().length() + footer.length() > 4090) {
stringBuilders.add(new StringBuilder(footer));
} else {
stringBuilders.getLast().append(footer);
}
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setColor(Color.GREEN);
User user = event.getJDA().retrieveUserById(event.getTextChannel().getTopic()).complete();
SteamwarUser swuser = SteamwarUser.get(user.getIdLong());
embedBuilder.setAuthor(user.getName(), swuser==null?"https://steamwar.de/":("https://steamwar.de/users/" + swuser.getUserName().toLowerCase() + "/"), user.getAvatarUrl());
embedBuilder.setTimestamp(Instant.now());
embedBuilder.setTitle(event.getTextChannel().getName());
stringBuilders.forEach(stringBuilder -> {
embedBuilder.setDescription(stringBuilder.toString());
MessageBuilder builder = new MessageBuilder();
builder.setEmbeds(embedBuilder.build());
logChannel.sendMessage(builder.build()).queue();
});
Message.team("DISCORD_TICKET_CLOSED", event.getTextChannel().getName());
event.getTextChannel().delete().reason("Closed").queue();
}
}
}
@Override
public void onGuildMessageReceived(@NotNull GuildMessageReceivedEvent event) {
if(event.getChannel().getParent() != null && event.getChannel().getParent().getId().equals(SteamwarDiscordBotConfig.TICKET_CATEGORY)) {
if(!event.getChannel().getId().equals(SteamwarDiscordBotConfig.TICKET_CHANNEL) && !event.getChannel().getId().equals(SteamwarDiscordBotConfig.TICKET_LOG)) {
BungeeCore.get().getProxy().getPlayers().forEach(player -> {
if(event.getAuthor().isBot() || event.getAuthor().isSystem()) return;
SteamwarUser user = SteamwarUser.get(player);
boolean sendMessage;
if(user.getDiscordId() == null) {
sendMessage = user.getUserGroup().isCheckSchematics();
} else {
if(event.getAuthor().getId().equals(user.getDiscordId())) return;
sendMessage = user.getDiscordId().equals(event.getChannel().getTopic()) || user.getUserGroup().isCheckSchematics();
}
if(sendMessage) {
Message.sendPrefixless("DISCORD_TICKET_MESSAGE", player, "Zur nachricht", new ClickEvent(ClickEvent.Action.OPEN_URL, event.getMessage().getJumpUrl()), event.getChannel().getName(), event.getAuthor().getName(), event.getMessage().getContentRaw());
}
});
}
}
}
}

Datei anzeigen

@ -1,75 +0,0 @@
/*
* This file is a part of the SteamWar software.
* <p>
* Copyright (C) 2021 SteamWar.de-Serverteam
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* <p>
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.listeners;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SchematicNode;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.events.message.priv.PrivateMessageReceivedEvent;
public class PrivateMessageListener extends BasicDiscordListener {
@Override
public void onPrivateMessageReceived(PrivateMessageReceivedEvent event) {
if(!event.getMessage().getAttachments().isEmpty()) {
SteamwarUser user = SteamwarUser.get(event.getAuthor().getIdLong());
if (user == null) {
event.getMessage().reply("Du must dein Minecraft Account mit dem Bot verbinden, gehe dazu auf dem SteamWar Discord in den `regeln-infos` Channel und Klicke auf `Minecraft Verknüpfen`").complete();
return;
}
if(user.isPunished(Punishment.PunishmentType.NoSchemReceiving)) {
event.getMessage().reply("Du darfst keine Schematics hochladen").complete();
return;
}
for (Message.Attachment attachment : event.getMessage().getAttachments()) {
if(attachment.getFileExtension() == null ||
(!attachment.getFileExtension().equalsIgnoreCase("schem") &&
!attachment.getFileExtension().equalsIgnoreCase("schematic"))) {
event.getMessage().reply("`" + attachment.getFileName() + "` wird ignoriert, da die Datei keine Schematic ist").queue();
continue;
}
boolean newFormat = attachment.getFileExtension().equalsIgnoreCase("schem");
int dot = attachment.getFileName().lastIndexOf(".");
String name = attachment.getFileName().substring(0, dot);
if(SchematicNode.invalidSchemName(new String[] {name})) {
event.getMessage().reply("`" + name + "` hat nicht zugelassene Zeichen im Namen").queue();
continue;
}
SchematicNode node = SchematicNode.getSchematicNode(user.getId(), name, 0);
if(node == null) {
node = SchematicNode.createSchematic(user.getId(), name, null);
}
try {
node.saveFromStream(attachment.retrieveInputStream().get(), newFormat);
event.getMessage().reply("`" + name + "` wurde erfolgreich hochgeladen").queue();
} catch (Exception e) {
event.getMessage().reply("`" + name + "` konnte nicht hochgeladen werden, bitte versuche es später nochmal oder wende dich an einen Developer").queue();
BungeeCore.log("Could not Upload Schem \"" + name + "\" from User \"" + user.getUserName() + "\"" + e);
}
}
}
}
}

Datei anzeigen

@ -1,42 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.listeners;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import net.dv8tion.jda.api.entities.ChannelType;
import net.dv8tion.jda.api.events.interaction.GenericComponentInteractionCreateEvent;
import net.dv8tion.jda.api.interactions.InteractionType;
import org.jetbrains.annotations.NotNull;
public class RolesInteractionButtonListener extends BasicDiscordListener {
@Override
public void onGenericComponentInteractionCreate(@NotNull GenericComponentInteractionCreateEvent event) {
if(event.getType() == InteractionType.COMPONENT && event.getChannelType() == ChannelType.TEXT && event.getTextChannel().getId().equals(SteamwarDiscordBotConfig.ROLES_CHANNEL) && SteamwarDiscordBotConfig.ROLES.stream().anyMatch(discordRole -> discordRole.getRoleId().equals(event.getComponentId()))) {
if (event.getMember().getRoles().stream().anyMatch(role -> role.getId().equals(event.getComponentId()))) {
event.getGuild().removeRoleFromMember(event.getMember(), event.getGuild().getRoleById(event.getComponentId())).complete();
event.reply(SteamwarDiscordBotConfig.ROLES_REMOVED.replace("%role%", event.getGuild().getRoleById(event.getComponentId()).getAsMention())).setEphemeral(true).queue();
} else {
event.getGuild().addRoleToMember(event.getMember(), event.getGuild().getRoleById(event.getComponentId())).complete();
event.reply(SteamwarDiscordBotConfig.ROLES_ADDED.replace("%role%", event.getGuild().getRoleById(event.getComponentId()).getAsMention())).setEphemeral(true).queue();
}
}
}
}

Datei anzeigen

@ -1,69 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.util;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.sql.SteamwarUser;
import lombok.experimental.UtilityClass;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.exceptions.ErrorResponseException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@UtilityClass
public class DiscordRanks {
public void update(SteamwarUser steamwarUser) {
if (steamwarUser.getDiscordId() == null) {
return;
}
Guild guild = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD);
guild.retrieveMemberById(steamwarUser.getDiscordId()).queue(member -> {
List<Role> roleList = member.getRoles();
Set<String> strings = new HashSet<>(SteamwarDiscordBotConfig.RANKS.values());
String needed = SteamwarDiscordBotConfig.RANKS.get(steamwarUser.getUserGroup());
for (Role role : roleList) {
if (!strings.contains(role.getId())) {
continue;
}
if (role.getId().equals(needed)) {
needed = "";
continue;
}
guild.removeRoleFromMember(member, role).complete();
}
if (needed != null && !needed.isEmpty()) {
guild.addRoleToMember(member, guild.getRoleById(needed)).complete();
}
}, throwable -> {
if(throwable instanceof ErrorResponseException) {
ErrorResponseException e = (ErrorResponseException) throwable;
if(e.getErrorCode() == 10007) {
steamwarUser.setDiscordId(null);
}
}
});
}
}

Datei anzeigen

@ -1,61 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.util;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import lombok.experimental.UtilityClass;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.interactions.components.ActionRow;
import net.dv8tion.jda.api.interactions.components.Button;
import java.util.ArrayList;
import java.util.List;
@UtilityClass
public class DiscordRolesMessage {
public void sendMessage() {
TextChannel channel = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD).getTextChannelById(SteamwarDiscordBotConfig.ROLES_CHANNEL);
assert channel != null;
MessageBuilder builder = new MessageBuilder();
builder.setContent(SteamwarDiscordBotConfig.ROLES_BASE_MESSAGE);
List<Button> buttons = new ArrayList<>();
SteamwarDiscordBotConfig.ROLES.forEach(discordRole -> buttons.add(discordRole.toButton()));
builder.setActionRows(ActionRow.of(buttons));
if(channel.hasLatestMessage()) {
channel.getIterableHistory().queue(messages -> {
Message message = messages.stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null);
if (message != null) {
message.editMessage(builder.build()).queue();
} else {
channel.sendMessage(builder.build()).queue();
}
});
} else {
channel.sendMessage(builder.build()).queue();
}
}
}

Datei anzeigen

@ -1,68 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.util;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import lombok.experimental.UtilityClass;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Emoji;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.interactions.components.ActionRow;
import net.dv8tion.jda.api.interactions.components.Button;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@UtilityClass
public class DiscordRulesMessage {
public void sendMessage() {
TextChannel channel = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD).getTextChannelById(SteamwarDiscordBotConfig.RULES_CHANNEL);
assert channel != null;
Message message = null;
if(channel.hasLatestMessage()) {
message = channel.getIterableHistory().complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null);
}
EmbedBuilder builder = new EmbedBuilder();
builder.setDescription(SteamwarDiscordBotConfig.RULES_RULES.stream().reduce((s, s2) -> s + "\n" + s2).get());
builder.setColor(Color.GRAY);
builder.setAuthor("SteamWar", "https://www.steamwar.de");
builder.setTitle(SteamwarDiscordBotConfig.RULES_TITLE);
List<Button> buttons = new ArrayList<>();
SteamwarDiscordBotConfig.RULES_LINKS.forEach(discordRulesLink -> buttons.add(discordRulesLink.toButton()));
Button authButton = Button.primary("auth", Emoji.fromUnicode("U+2705")).withLabel("Minecraft verknüpfen");
MessageBuilder messageBuilder = new MessageBuilder();
messageBuilder.setEmbeds(builder.build());
messageBuilder.setActionRows(ActionRow.of(buttons), ActionRow.of(authButton));
if (message != null) {
message.editMessage(messageBuilder.build()).queue();
} else {
channel.sendMessage(messageBuilder.build()).queue();
}
}
}

Datei anzeigen

@ -1,79 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.util;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.sql.SchematicNode;
import de.steamwar.bungeecore.sql.SteamwarUser;
import lombok.experimental.UtilityClass;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Emoji;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.interactions.components.ActionRow;
import net.dv8tion.jda.api.interactions.components.Button;
import java.awt.*;
import java.time.Instant;
@UtilityClass
public class DiscordSchemAlert {
public void sendDecline(SchematicNode schematic, SteamwarUser user, String reason) {
if(user.getDiscordId() != null) {
User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete();
EmbedBuilder builder = new EmbedBuilder();
builder.setAuthor("SteamWar", "https://steamwar.de", "https://cdn.discordapp.com/app-icons/869606970099904562/60c884000407c02671d91d8e7182b8a1.png");
builder.setColor(Color.RED);
builder.setTitle("SteamWar-Schematic Info");
builder.setDescription("Deine Schematic **" + schematic.getName() + "** wurde abgelehnt. **Grund:** \n" + reason);
builder.setTimestamp(Instant.now());
MessageBuilder messageBuilder = new MessageBuilder();
messageBuilder.setEmbeds(builder.build());
try {
dcUser.openPrivateChannel().complete().sendMessage(messageBuilder.build()).queue();
} catch (Exception e) {
// Ignored
}
}
}
public void sendAccept(SchematicNode schematic, SteamwarUser user) {
if(user.getDiscordId() != null) {
User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete();
EmbedBuilder builder = new EmbedBuilder();
builder.setAuthor("SteamWar", "https://steamwar.de", "https://cdn.discordapp.com/app-icons/869606970099904562/60c884000407c02671d91d8e7182b8a1.png");
builder.setColor(Color.GREEN);
builder.setTitle("SteamWar-Schematic Info");
builder.setDescription("Deine Schematic **" + schematic.getName() + "** wurde angenommen.");
builder.setTimestamp(Instant.now());
MessageBuilder messageBuilder = new MessageBuilder();
messageBuilder.setEmbeds(builder.build());
messageBuilder.setActionRows(ActionRow.of(Button.success("tada", Emoji.fromUnicode("U+1F389"))));
try {
dcUser.openPrivateChannel().complete().sendMessage(messageBuilder.build()).queue();
} catch (Exception e) {
// Ignored
}
}
}
}

Datei anzeigen

@ -1,76 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.bot.util;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.bot.config.DiscordTicketType;
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import lombok.experimental.UtilityClass;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.interactions.components.ActionRow;
import net.dv8tion.jda.api.interactions.components.Button;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@UtilityClass
public class DiscordTicketMessage {
public void sendMessage() {
TextChannel channel = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD).getTextChannelById(SteamwarDiscordBotConfig.TICKET_CHANNEL);
assert channel != null;
Message message = null;
if(channel.hasLatestMessage()) {
message = channel.getIterableHistory().complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null);
}
EmbedBuilder builder = new EmbedBuilder();
builder.setDescription(SteamwarDiscordBotConfig.TICKET_MESSAGE);
builder.setTitle("Steamwar-Tickets");
builder.setColor(Color.RED);
List<List<Button>> buttons = new ArrayList<>();
chunked(new ArrayList<>(SteamwarDiscordBotConfig.TICKET_TYPES.values()), 5).forEach(discordTicketTypes -> {
buttons.add(discordTicketTypes.stream().map(DiscordTicketType::toButton).collect(Collectors.toList()));
});
MessageBuilder messageBuilder = new MessageBuilder();
messageBuilder.setEmbeds(builder.build());
messageBuilder.setActionRows(buttons.stream().map(ActionRow::of).collect(Collectors.toList()));
if (message != null) {
message.editMessage(messageBuilder.build()).queue();
} else {
channel.sendMessage(messageBuilder.build()).queue();
}
}
private static <T> List<List<T>> chunked(List<T> list, int chunkSize) {
List<List<T>> chunks = new ArrayList<>();
for (int i = 0; i < list.size(); i += chunkSize) {
chunks.add(list.subList(i, Math.min(i + chunkSize, list.size())));
}
return chunks;
}
}

Datei anzeigen

@ -1,69 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
public class AlertCommand extends BasicCommand {
public AlertCommand() {
super("alert", "bungeecore.alert", "broadcast", "bbc");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(args.length == 0){
Message.send("USAGE_ALERT", sender);
return;
}
String s;
boolean discordAnnounce = false;
if (args[0].equals("-discord")) {
if (args.length == 1) {
Message.send("USAGE_ALERT", sender);
return;
}
discordAnnounce = true;
s = join(1, args);
} else {
s = join(0, args);
}
Message.broadcast("ALERT", ChatColor.translateAlternateColorCodes('&', s));
if (discordAnnounce && SteamwarDiscordBot.instance() != null) {
SteamwarDiscordBot.instance().getAnnouncementListener().announce(s);
}
}
private String join(int startIndex, String... strings) {
StringBuilder st = new StringBuilder();
for (int i = startIndex; i < strings.length; i++) {
if (i != startIndex) {
st.append(" ");
}
st.append(strings[i]);
}
return st.toString();
}
}

Datei anzeigen

@ -1,51 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.Servertype;
import de.steamwar.bungeecore.Subserver;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public class ArenaCommand extends BasicCommand {
public ArenaCommand() {
super("arena", null);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", args));
Subserver subserver = Subserver.getSubserver(server);
if(server == null || subserver == null || subserver.getType() != Servertype.ARENA) {
Message.send("ARENA_NOT_FOUND", player);
return;
}
TpCommand.teleport(player, server);
}
}

Datei anzeigen

@ -1,69 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Command;
import net.md_5.bungee.api.plugin.TabExecutor;
import java.util.ArrayList;
import java.util.List;
abstract class BasicCommand extends Command implements TabExecutor {
public BasicCommand(String name, String permission, String... aliases) {
super(name, permission, aliases);
BungeeCore.commands.put("/" + name, permission);
ProxyServer.getInstance().getPluginManager().registerCommand(BungeeCore.get(), this);
}
Iterable<String> allPlayers(String begin) {
List<String> suggestions = new ArrayList<>();
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
String playerName = player.getName();
if(playerName.startsWith(begin))
suggestions.add(playerName);
}
return suggestions;
}
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
return new ArrayList<>();
}
protected SteamwarUser existingUser(CommandSender sender, String arg){
SteamwarUser target = SteamwarUser.get(arg);
if(target == null)
Message.send("UNKNOWN_PLAYER", sender);
return target;
}
protected SteamwarUser unsafeUser(CommandSender sender, String arg){
SteamwarUser target = SteamwarUser.getOrCreateOfflinePlayer(arg);
if(target == null)
Message.send("UNKNOWN_PLAYER", sender);
return target;
}
}

Datei anzeigen

@ -1,305 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.comms.packets.BaumemberUpdatePacket;
import de.steamwar.bungeecore.inventory.SWInventory;
import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.sql.BauweltMember;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public class BauCommand extends BasicCommand {
public BauCommand(){
super("bau", null, "b", "build", "gs");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer)) {
return;
}
ProxiedPlayer p = (ProxiedPlayer) sender;
versionSelector(p, args, 0,
() -> new ServerStarter().build18(p.getUniqueId()).send(p).start(),
() -> new ServerStarter().build15(p.getUniqueId()).send(p).start(),
() -> new ServerStarter().build12(p.getUniqueId()).send(p).start(),
() -> {
switch (args[0].toLowerCase()) {
case "addmember":
addmember(p, args);
break;
case "tp":
case "teleport":
teleport(p, args);
break;
case "info":
p.chat("/bauinfo");
break;
case "togglewe":
togglewe(p, args);
break;
case "toggleworld":
toggleworld(p, args);
break;
case "delmember":
delmember(p, args);
break;
case "resetall":
case "delete":
delete(p, args);
break;
case "testarena":
case "test":
testarena(p, args);
break;
default:
HelpCommand.sendBauHelp(ChatSender.of(p));
}
}
);
}
private static void addmember(ProxiedPlayer p, String[] args){
if (args.length == 1) {
Message.send("BAU_ADDMEMBER_USAGE", p);
return;
}
SteamwarUser target = SteamwarUser.get(args[1]);
if (target == null) {
Message.send("UNKNOWN_PLAYER", p);
return;
}else if(target.getUuid().equals(p.getUniqueId())) {
Message.send("BAU_ADDMEMBER_SELFADD", p);
return;
}else if (BauweltMember.getBauMember(p.getUniqueId(), target.getUuid()) != null) {
Message.send("BAU_ADDMEMBER_ISADDED", p);
return;
}
new BauweltMember(p.getUniqueId(), target.getUuid(), false, false);
Message.send("BAU_ADDMEMBER_ADDED", p);
ProxiedPlayer z = ProxyServer.getInstance().getPlayer(target.getUuid());
if(z != null)
Message.send("BAU_ADDMEMBER_ADDED_TARGET", z, p.getName());
}
private static void teleport(ProxiedPlayer p, String[] args){
if (args.length == 1) {
Message.send("BAU_TP_USAGE", p);
return;
}
SteamwarUser worldOwner = SteamwarUser.get(args[1]);
if (worldOwner == null) {
Message.send("UNKNOWN_PLAYER", p);
return;
}else if (!p.getUniqueId().equals(worldOwner.getUuid()) && BauweltMember.getBauMember(worldOwner.getUuid(), p.getUniqueId()) == null){
SubserverSystem.sendDeniedMessage(p, worldOwner.getUuid());
Message.send("BAU_TP_NOALLOWED", p);
return;
}
versionSelector(p, args, 2,
() -> new ServerStarter().build18(worldOwner.getUuid()).send(p).start(),
() -> new ServerStarter().build15(worldOwner.getUuid()).send(p).start(),
() -> new ServerStarter().build12(worldOwner.getUuid()).send(p).start(),
() -> HelpCommand.sendBauHelp(ChatSender.of(p)));
}
private static void versionSelector(ProxiedPlayer p, String[] args, int pos, Runnable run18, Runnable run15, Runnable run12, Runnable runElse) {
if(args.length <= pos) {
int version = p.getPendingConnection().getVersion();
if(version > 340) { // Version > 1.12.2
run15.run();
} else {
run12.run();
}
return;
}
switch (args[pos].toLowerCase()) {
case "18":
case "1.18":
run18.run();
break;
case "ws":
case "warship":
case "as":
case "airship":
case "mwg":
case "miniwargear":
case "wg":
case "wargear":
case "15":
case "1.15":
run15.run();
break;
case "12":
case "1.12":
run12.run();
break;
default:
runElse.run();
}
}
private static void togglewe(ProxiedPlayer p, String[] args){
BauweltMember target = toggle(p, args, "togglewe");
if(target == null)
return;
target.setWorldEdit(!target.isWorldEdit());
clearMembercache(p);
isAllowedTo(target.isWorldEdit(), p, target, "BAU_MEMBER_TOGGLE_WORLD_EDIT");
}
private static void toggleworld(ProxiedPlayer p, String[] args){
BauweltMember target = toggle(p, args, "toggleworld");
if(target == null)
return;
target.setWorld(!target.isWorld());
clearMembercache(p);
isAllowedTo(target.isWorld(), p, target, "BAU_MEMBER_TOGGLE_WORLD");
}
private static void clearMembercache(ProxiedPlayer p){
for(ServerInfo info : ProxyServer.getInstance().getServers().values()){
Subserver server = Subserver.getSubserver(info);
if(server != null && server.getType() == Servertype.BAUSERVER && ((Bauserver)server).getOwner().equals(p.getUniqueId())){
info.getPlayers().stream().findAny().ifPresent(player -> new BaumemberUpdatePacket().send(player));
break;
}
}
}
private static void delmember(ProxiedPlayer p, String[] args){
if (args.length == 1) {
Message.send("BAU_DELMEMBER_USAGE", p);
return;
}
BauweltMember target = member(p, SteamwarUser.get(args[1]));
if(target == null)
return;
if(SteamwarUser.get(target.getMemberID()).getUuid().equals(p.getUniqueId())) {
Message.send("BAU_DELMEMBER_SELFDEL", p);
return;
}
target.remove();
ProxiedPlayer toRemove = ProxyServer.getInstance().getPlayer(SteamwarUser.get(target.getMemberID()).getUuid());
if(toRemove != null){
Message.send("BAU_DELMEMBER_DELETED_TARGET", toRemove, p.getName());
Subserver currentServer = Subserver.getSubserver(toRemove.getServer().getInfo());
if (currentServer != null && currentServer.getType() == Servertype.BAUSERVER && ((Bauserver) currentServer).getOwner().equals(p.getUniqueId())) {
toRemove.connect(ProxyServer.getInstance().getServerInfo(BungeeCore.LOBBY_SERVER));
}
}
Message.send("BAU_DELMEMBER_DELETED", p);
}
private static void delete(ProxiedPlayer p, String[] args){
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
versionSelector(p, args, 1,
() -> deleteConfirmation(p, () -> deleteWorld(p, ServerStarter.WORLDS18_PATH + user.getId())),
() -> deleteConfirmation(p, () -> deleteWorld(p, BungeeCore.USERWORLDS15 + user.getId())),
() -> deleteConfirmation(p, () -> deleteWorld(p, BungeeCore.WORLD_FOLDER + p.getUniqueId().toString())),
() -> HelpCommand.sendBauHelp(ChatSender.of(p)));
}
private static void deleteConfirmation(ProxiedPlayer p, Runnable worldDeletion) {
SWInventory inventory = new SWInventory(p, 9, Message.parse("BAU_DELETE_GUI_NAME", p));
inventory.addItem(8, new SWItem(Message.parse("BAU_DELETE_GUI_CANCEL", p), 1), click ->
inventory.close()
);
inventory.addItem(0, new SWItem(Message.parse("BAU_DELETE_GUI_DELETE", p), 10), click ->
worldDeletion.run()
);
inventory.open();
}
private static void deleteWorld(ProxiedPlayer player, String world) {
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(player.getUniqueId())) {
subserver.stop();
break;
}
}
SubserverSystem.deleteFolder(Node.local, world);
Message.send("BAU_DELETE_DELETED", player);
});
}
private static void testarena(ProxiedPlayer p, String[] args){
FightCommand.createArena(p, "/bau testarena ", false, args, 1, false, (player, mode, map) -> ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> new ServerStarter().test(mode, map, p).start()));
}
private static BauweltMember member(ProxiedPlayer p, SteamwarUser member){
if (member == null) {
Message.send("UNKNOWN_PLAYER", p);
return null;
}
BauweltMember target = BauweltMember.getBauMember(p.getUniqueId(), member.getUuid());
if (target == null) {
Message.send("BAU_MEMBER_NOMEMBER", p);
return null;
}
return target;
}
private static BauweltMember toggle(ProxiedPlayer p, String[] args, String subcommand){
if (args.length == 1) {
Message.send("BAU_MEMBER_TOGGLE_USAGE", p, subcommand);
return null;
}
SteamwarUser member = SteamwarUser.get(args[1]);
return member(p, member);
}
private static void isAllowedTo(boolean permission, ProxiedPlayer p, BauweltMember target, String what){
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(SteamwarUser.get(target.getMemberID()).getUuid());
if(permission){
if(player != null)
Message.send("BAU_MEMBER_TOGGLE_TARGET", player, p.getName(), Message.parse(what, player));
Message.send("BAU_MEMBER_TOGGLE", p, Message.parse(what, p));
}else{
if(player != null)
Message.send("BAU_MEMBER_TOGGLE_TARGET_OFF", player, p.getName(), Message.parse(what, player));
Message.send("BAU_MEMBER_TOGGLE_OFF", p, Message.parse(what, p));
}
}
}

Datei anzeigen

@ -1,45 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SWException;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public class BugCommand extends BasicCommand {
public BugCommand() {
super("bug", null);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
String server = player.getServer().getInfo().getName();
String message = String.join(" ", args);
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
SWException.log(server, message, player.getName() + " " + user.getId());
Message.send("BUG_MESSAGE", player);
}
}

Datei anzeigen

@ -1,107 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker;
import de.steamwar.bungeecore.sql.IgnoreSystem;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
import java.util.LinkedList;
import static de.steamwar.bungeecore.Storage.challenges;
public class ChallengeCommand extends BasicCommand {
public ChallengeCommand() {
super("challenge", "");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(args.length < 1){
Message.send("CHALLENGE_USAGE", sender);
return;
}
if (!(sender instanceof ProxiedPlayer))
return;
if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender)) {
Message.send("MODLOADER_DENIED", sender);
return;
}
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
if(target == null){
Message.send("CHALLENGE_OFFLINE", sender);
return;
}else if(target == sender){
Message.send("CHALLENGE_SELF", sender);
return;
}else if (IgnoreSystem.isIgnored(target, (ProxiedPlayer) sender)) {
Message.send("CHALLENGE_IGNORED", sender);
return;
}
Subserver subserver = Subserver.getSubserver(target);
if(subserver != null && subserver.getType() == Servertype.ARENA){
Message.send("CHALLENGE_INARENA", sender);
return;
}
FightCommand.createArena(sender, "/challenge " + target.getName() + " ", false, args, 1, false, (player, mode, map) -> {
if(challenges.containsKey(target) && challenges.get(target).contains(player)){
challenges.remove(target);
challenges.remove(player);
Subserver arena = new ServerStarter().arena(mode, map).blueLeader(player).redLeader(target).start();
Message.broadcast("CHALLENGE_BROADCAST", "CHALLENGE_BROADCAST_HOVER",
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName(), target.getName());
}else{
if(!challenges.containsKey(player)){
challenges.put(player, new LinkedList<>());
}
challenges.get(player).add(target);
Message.send("CHALLENGE_CHALLENGED", player, target.getName(), mode.getDisplayName());
Message.send("CHALLENGE_CHALLENGED_TARGET", target, player.getName(), mode.getDisplayName(), mode.getMaps().size()!=1?Message.parse("CHALLENGE_CHALLENGED_MAP", target, map):"");
Message.send("CHALLENGE_ACCEPT", target, Message.parse("CHALLENGE_ACCEPT_HOVER", target), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/challenge " + player.getName() + " " + mode.getChatName() + " " + map));
}
});
}
public static void remove(ProxiedPlayer player){
challenges.remove(player);
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
if(args.length == 2)
return ArenaMode.getAllChatNames(false);
return new ArrayList<>();
}
}

Datei anzeigen

@ -1,351 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.bot.util.DiscordSchemAlert;
import de.steamwar.bungeecore.listeners.ConnectionListener;
import de.steamwar.bungeecore.sql.CheckedSchematic;
import de.steamwar.bungeecore.sql.SchematicNode;
import de.steamwar.bungeecore.sql.SchematicType;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.config.Configuration;
import java.sql.Timestamp;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
public class CheckCommand extends BasicCommand {
private static Map<SchematicType, List<String>> checkQuestions = new HashMap<>();
private static Map<SchematicType, List<String>> ranks = new HashMap<>();
private static Map<UUID, CheckSession> currentCheckers = new HashMap<>();
private static Map<Integer, CheckSession> currentSchems = new HashMap<>();
public static void setCheckQuestions(SchematicType checkType, Configuration config) {
checkQuestions.put(checkType, config.getStringList("CheckQuestions"));
if(!config.getStringList("Ranks").isEmpty())
ranks.put(checkType, config.getStringList("Ranks"));
}
public static boolean isChecking(ProxiedPlayer player){
return currentCheckers.containsKey(player.getUniqueId());
}
public static SchematicNode getCheckingSchem(ProxiedPlayer player) {
return currentCheckers.get(player.getUniqueId()).schematic;
}
public CheckCommand() {
super("check", ConnectionListener.CHECK_PERMISSION);
ProxyServer.getInstance().getScheduler().schedule(BungeeCore.get(), () -> {
List<SchematicNode> schematics = getSchemsToCheck();
if(schematics.size() != currentCheckers.size())
Message.team("CHECK_REMINDER", "CHECK_REMINDER_HOVER", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check list"), schematics.size() - currentCheckers.size());
}, 10, 10, TimeUnit.MINUTES);
}
public static void sendReminder(ProxiedPlayer player) {
List<SchematicNode> schematics = getSchemsToCheck();
if(schematics.size() != currentCheckers.size())
Message.send("CHECK_REMINDER", player, Message.parse("CHECK_REMINDER_HOVER", player), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check list"), schematics.size() - currentCheckers.size());
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length == 0){
help(sender);
return;
}
switch(args[0].toLowerCase()){
case "list":
list(player);
break;
case "schematic":
schematic(player, args[1]);
break;
case "next":
case "accept":
next(player, args);
break;
case "cancel":
abort(player);
break;
case "decline":
decline(player, args);
break;
default:
help(player);
}
}
public static List<SchematicNode> getSchemsToCheck(){
List<SchematicNode> schematicList = new LinkedList<>();
for (SchematicType type : SchematicType.values()) {
if (type.check())
schematicList.addAll(SchematicNode.getAllSchematicsOfType(type.toDB()));
}
return schematicList;
}
public static String getChecker(SchematicNode schematic) {
if (currentSchems.get(schematic.getId()) == null) return null;
return currentSchems.get(schematic.getId()).checker.getName();
}
private void list(ProxiedPlayer player) {
List<SchematicNode> schematicList = getSchemsToCheck();
Message.sendPrefixless("CHECK_LIST_HEADER", player, schematicList.size());
for (SchematicNode schematic : schematicList) {
CheckSession current = currentSchems.get(schematic.getId());
long waitedMillis = Timestamp.from(Instant.now()).getTime() - schematic.getLastUpdate().getTime();
String color = waitedMillis > 14400000 ? (waitedMillis > 86400000 ? "§c" : "§e") : "§a";
long hours = waitedMillis / 3600000;
long minutes = (waitedMillis - hours * 3600000) / 60000;
String waitTime = color + Message.parse("CHECK_LIST_WAIT", player, hours, (minutes < 10) ? "0" + minutes : minutes);
if (current == null) {
Message.sendPrefixless("CHECK_LIST_TO_CHECK", player,
Message.parse("CHECK_LIST_TO_CHECK_HOVER", player),
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check schematic " + schematic.getId()),
waitTime,
schematic.getSchemtype().getKuerzel(), SteamwarUser.get(schematic.getOwner()).getUserName(), schematic.getName());
} else {
Message.sendPrefixless("CHECK_LIST_CHECKING", player,
Message.parse("CHECK_LIST_CHECKING_HOVER", player),
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + current.checker.getName()),
waitTime,
schematic.getSchemtype().getKuerzel(), SteamwarUser.get(schematic.getOwner()).getUserName(), schematic.getName(), current.checker.getName());
}
}
}
private void schematic(ProxiedPlayer player, String schemID){
if(isChecking(player)){
Message.send("CHECK_SCHEMATIC_ALREADY_CHECKING", player);
return;
}
SchematicNode schem = SchematicNode.getSchematicNode(Integer.parseInt(schemID));
if(!schem.getSchemtype().check()){
ProxyServer.getInstance().getLogger().log(Level.SEVERE, player.getName() + " tried to check an uncheckable schematic!");
return;
}else if(schem.getOwner() == SteamwarUser.get(player.getUniqueId()).getId()) {
Message.send("CHECK_SCHEMATIC_OWN", player);
return;
}
new CheckSession(player, schem);
}
private static boolean notChecking(ProxiedPlayer player){
if(!isChecking(player)){
Message.send("CHECK_NOT_CHECKING", player);
return true;
}
return false;
}
private void next(ProxiedPlayer player, String[] args){
if(notChecking(player))
return;
int rank = 0;
if(args.length > 1){
try{
rank = Integer.parseInt(args[1]);
}catch(NumberFormatException e){
Message.send("CHECK_INVALID_RANK", player);
return;
}
}
currentCheckers.get(player.getUniqueId()).next(rank);
}
public static void abort(ProxiedPlayer player){
if(notChecking(player))
return;
Message.send("CHECK_ABORT", player);
currentCheckers.get(player.getUniqueId()).abort();
}
private void decline(ProxiedPlayer player, String[] args){
if(notChecking(player))
return;
if(args.length < 2) {
help(player);
return;
}
StringBuilder message = new StringBuilder();
for (int i = 1; i < args.length; i++)
message.append(args[i]).append(" ");
currentCheckers.get(player.getUniqueId()).decline(message.toString());
}
private void help(CommandSender sender){
Message.sendPrefixless("CHECK_HELP_LIST", sender);
Message.sendPrefixless("CHECK_HELP_NEXT", sender);
Message.sendPrefixless("CHECK_HELP_DECLINE", sender);
Message.sendPrefixless("CHECK_HELP_CANCEL", sender);
}
private static class CheckSession{
private final ProxiedPlayer checker;
private final SchematicNode schematic;
private final Timestamp startTime;
private final ListIterator<String> checkList;
private CheckSession(ProxiedPlayer checker, SchematicNode schematic){
this.checker = checker;
this.schematic = schematic;
this.startTime = Timestamp.from(Instant.now());
this.checkList = checkQuestions.get(schematic.getSchemtype()).listIterator();
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
ArenaMode mode = ArenaMode.getBySchemType(schematic.getSchemtype().fightType());
if(new ServerStarter().test(mode, mode.getRandomMap(), checker).check(schematic.getId()).start() == null) {
remove();
return;
}
currentCheckers.put(checker.getUniqueId(), this);
currentSchems.put(schematic.getId(), this);
for(CheckedSchematic previous : CheckedSchematic.previousChecks(schematic))
Message.sendPrefixless("CHECK_SCHEMATIC_PREVIOUS", checker, previous.getEndTime(), SteamwarUser.get(previous.getValidator()).getUserName(), previous.getDeclineReason());
next(0);
});
}
private void next(int rank) {
if(!checkList.hasNext()){
accept(rank);
return;
}
checker.sendMessage(TextComponent.fromLegacyText(checkList.next()));
TextComponent next = new TextComponent();
next.setColor(ChatColor.GREEN);
if(checkList.hasNext()){
next.setText(Message.parse("CHECK_NEXT", checker));
next.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check next"));
}else if(ranks.containsKey(schematic.getSchemtype())){
List<String> r = ranks.get(schematic.getSchemtype());
for(int i = 0; i < r.size(); i++){
Message.sendPrefixless("CHECK_RANK", checker,
Message.parse("CHECK_RANK_HOVER", checker),
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check accept " + (i+1)),
i+1, r.get(i));
Message.sendPrefixless("SPACER", checker);
}
}else{
next.setText(Message.parse("CHECK_ACCEPT", checker));
next.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check accept"));
}
TextComponent decline = new TextComponent(" " + Message.parse("CHECK_DECLINE", checker));
decline.setColor(ChatColor.RED);
decline.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/check decline "));
next.addExtra(decline);
checker.sendMessage(next);
}
private void accept(int rank){
if(ranks.containsKey(schematic.getSchemtype())){
if(rank <= 0 || ranks.get(schematic.getSchemtype()).size() < rank){
Message.send("CHECK_INVALID_RANK", checker);
return;
}
schematic.setRank(rank);
}
schematic.setType(schematic.getSchemtype().fightType().toDB());
CheckedSchematic.create(schematic, SteamwarUser.get(checker.getUniqueId()).getId(), startTime, Timestamp.from(Instant.now()), "freigegeben");
SteamwarUser user = SteamwarUser.get(schematic.getOwner());
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(user.getUuid());
if(player != null) {
Message.send("CHECK_ACCEPTED", player, schematic.getSchemtype().name(), schematic.getName());
} else {
DiscordSchemAlert.sendAccept(schematic, user);
}
Message.team("CHECK_ACCEPTED_TEAM", schematic.getName(), user.getUserName());
stop();
}
private void decline(String reason){
CheckedSchematic.create(schematic, SteamwarUser.get(checker.getUniqueId()).getId(), startTime, Timestamp.from(Instant.now()), reason);
SteamwarUser user = SteamwarUser.get(schematic.getOwner());
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(user.getUuid());
if(player != null) {
Message.send("CHECK_DECLINED", player, schematic.getSchemtype().name(), schematic.getName(), reason);
} else {
DiscordSchemAlert.sendDecline(schematic, user, reason);
}
Message.team("CHECK_DECLINED_TEAM", schematic.getName(), user.getUserName(), reason);
schematic.setType(SchematicType.Normal.toDB());
stop();
}
private void abort(){
CheckedSchematic.create(schematic, SteamwarUser.get(checker.getUniqueId()).getId(), startTime, Timestamp.from(Instant.now()), "Prüfvorgang abgebrochen");
stop();
}
private void stop(){
currentCheckers.remove(checker.getUniqueId());
currentSchems.remove(schematic.getId());
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(checker.getUniqueId())) {
subserver.stop();
break;
}
}
});
}
private void remove() {
currentCheckers.remove(checker.getUniqueId());
currentSchems.remove(schematic.getId());
}
}
}

Datei anzeigen

@ -1,123 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.io.File;
import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class DevCommand extends BasicCommand {
private final File devServerDir = new File("/configs/DevServer");
private final Map<String, ServerInfo> devServers = new HashMap<>();
public DevCommand() {
super("dev", "");
}
@Override
public void execute(CommandSender s, String[] args) {
if (!(s instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) s;
ChatSender sender = ChatSender.of(player);
if (sender.user().isPunishedWithMessage(sender, Punishment.PunishmentType.NoDevServer)) {
return;
}
updateDevServers();
if(devServers.isEmpty()) {
sender.system("DEV_NO_SERVER");
} else if (devServers.size() == 1) {
player.connect(devServers.values().stream().findAny().get());
} else if (args.length == 0) {
ServerInfo info = devServers.get(player.getName().toLowerCase());
if (info == null) {
sender.system("DEV_UNKNOWN_SERVER");
return;
}
player.connect(info);
} else {
ServerInfo info = devServers.get(args[0].toLowerCase());
if (info == null) {
sender.system("DEV_NO_SERVER");
return;
}
player.connect(info);
}
}
@Override
public Iterable<String> onTabComplete(CommandSender sender, String[] args) {
if (!(sender instanceof ProxiedPlayer) || args.length > 1) {
return Collections.emptyList();
}
updateDevServers();
return devServers.keySet().stream().filter(s -> {
if (args.length == 0) return true;
return s.startsWith(args[0].toLowerCase());
}).collect(Collectors.toList());
}
private void updateDevServers() {
String[] serverFiles = devServerDir.list();
Map<String, Integer> devServerFiles = new HashMap<>();
if(serverFiles != null) {
for(String serverFile : serverFiles) {
String[] server = serverFile.split("\\.");
devServerFiles.put(server[0], Integer.parseInt(server[1]));
}
}
devServers.entrySet().removeIf(entry -> {
if(!devServerFiles.containsKey(entry.getKey())) {
ProxyServer.getInstance().getServers().remove(entry.getValue().getName());
return true;
}
return false;
});
devServerFiles.forEach((key, value) -> {
if (devServers.containsKey(key))
return;
SteamwarUser user = SteamwarUser.get(key);
ServerInfo info = ProxyServer.getInstance().constructServerInfo("Dev " + user.getUserName(), new InetSocketAddress("127.0.0.1", value), "SteamWar.de - Subserver", false);
ProxyServer.getInstance().getServers().put(info.getName(), info);
devServers.put(user.getUserName().toLowerCase(), info);
});
}
}

Datei anzeigen

@ -1,128 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.EventFight;
import de.steamwar.bungeecore.sql.Team;
import de.steamwar.bungeecore.sql.TeamTeilnahme;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Set;
public class EventCommand extends BasicCommand {
public EventCommand() {
super("event", "");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
Event currentEvent = Event.get();
if(currentEvent == null) {
noCurrentEvent(player);
return;
}
if(args.length != 1){
eventOverview(player, currentEvent);
return;
}
Team team = Team.get(args[0]);
if(team == null){
Message.send("EVENT_NO_TEAM", player);
return;
}
Subserver eventArena = EventStarter.getEventServer().get(team.getTeamId());
if(eventArena == null || !Subserver.getServerList().contains(eventArena)){
Message.send("EVENT_NO_FIGHT_TEAM", player);
return;
}
SubserverSystem.sendPlayer(eventArena, player);
}
private void noCurrentEvent(ProxiedPlayer player){
Message.send("EVENT_NO_CURRENT", player);
List<Event> coming = Event.getComing();
Instant now = Instant.now();
if(!coming.isEmpty()){
DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern(Message.parse("EVENT_DATE_FORMAT", player));
Message.send("EVENT_COMING", player);
for(Event e : coming){
Message.send("EVENT_COMING_EVENT", player, e.getStart().toLocalDateTime().format(dateFormat), e.getEnd().toLocalDateTime().format(dateFormat), e.getEventName());
Set<Team> teams = TeamTeilnahme.getTeams(e.getEventID());
if(now.isBefore(e.getDeadline().toInstant())) {
Message.send("EVENT_COMING_DEADLINE", player, e.getDeadline());
}
if(!teams.isEmpty()){
StringBuilder tline = new StringBuilder();
for(Team t : teams){
tline.append(' ').append(Message.parse("EVENT_COMING_TEAM", player, t.getTeamColor(), t.getTeamKuerzel()));
}
Message.send("EVENT_COMING_TEAMS", player, tline.toString());
}
}
}
}
private void eventOverview(ProxiedPlayer player, Event currentEvent){
Message.send("EVENT_USAGE", player);
List<EventFight> fights = EventFight.getEvent(currentEvent.getEventID());
Message.send("EVENT_CURRENT_EVENT", player, currentEvent.getEventName());
DateTimeFormatter timeFormat = DateTimeFormatter.ofPattern(Message.parse("EVENT_TIME_FORMAT", player));
for(EventFight fight : fights){
Team blue = Team.get(fight.getTeamBlue());
Team red = Team.get(fight.getTeamRed());
StringBuilder fline = new StringBuilder(Message.parse("EVENT_CURRENT_FIGHT", player, fight.getStartTime().toLocalDateTime().format(timeFormat), blue.getTeamColor(), blue.getTeamKuerzel(),
red.getTeamColor(), red.getTeamKuerzel()));
if(fight.hasFinished()){
switch(fight.getErgebnis()){
case 1:
fline.append(Message.parse("EVENT_CURRENT_FIGHT_WIN", player, blue.getTeamColor(), blue.getTeamKuerzel()));
break;
case 2:
fline.append(Message.parse("EVENT_CURRENT_FIGHT_WIN", player, red.getTeamColor(), red.getTeamKuerzel()));
break;
default:
fline.append(Message.parse("EVENT_CURRENT_FIGHT_DRAW", player));
}
}
BungeeCore.send(player, fline.toString());
}
}
}

Datei anzeigen

@ -1,247 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.inventory.SWInventory;
import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.chat.hover.content.Text;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.LinkedList;
/**
* Jeder Fightcommand (auch bau testarena und challenge) haben folgende Optionskette:
*
* [ArenaMode] [Map]
*
* Sollte der ArenaMode fehlen, kann er mit getMode() bestimmt werden.
* Sollte die Map fehlen, kann sie mit getMap() bestimmt werden.
*/
public class FightCommand extends BasicCommand {
public FightCommand() {
super("fight", "", "f");
}
private static ArenaMode getMode(ChatSender sender, String arg){
ArenaMode mode = ArenaMode.getByChat(arg);
if(mode != null)
return mode;
sender.system("FIGHT_UNKNOWN_GAMEMODE", arg);
return null;
}
private static String getMap(ChatSender sender, ArenaMode mode, String arg){
String realMap = mode.hasMap(arg.toLowerCase());
if(realMap != null)
return realMap;
if(arg.equalsIgnoreCase("Random"))
return mode.getRandomMap();
sender.system("FIGHT_UNKNOWN_ARENA");
return null;
}
private static void getModes(ChatSender sender, String precommand, boolean historic){
TextComponent start = new TextComponent();
TextComponent current = start;
for(ArenaMode mode : ArenaMode.getAllModes()){
if(mode.withoutChatName() || mode.isHistoric() != historic)
continue;
String command = precommand + mode.getChatName();
current.setBold(true);
current.setColor(ChatColor.GRAY);
current.setText(mode.getChatName() + " ");
current.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("§e" + command)));
current.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command));
if(current != start)
start.addExtra(current);
current = new TextComponent();
}
sender.sendMessage(ChatMessageType.SYSTEM, start);
}
private static void getMaps(ChatSender sender, String precommand, ArenaMode mode){
TextComponent start = new TextComponent();
TextComponent current = start;
if(mode.getMaps().size() > 1){
String command = precommand + mode.getChatName() + " Random";
start.setBold(true);
start.setColor(ChatColor.GRAY);
start.setText(sender.parseToLegacy("FIGHT_ARENA_RANDOM") + " ");
start.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("§e" + command)));
start.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command));
current = new TextComponent();
}
for(String map : mode.getMaps()){
String command = precommand + mode.getChatName() + " " + map;
current.setBold(true);
current.setColor(ChatColor.GRAY);
current.setText(map + " ");
current.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("§e" + command)));
current.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command));
if(current != start)
start.addExtra(current);
current = new TextComponent();
}
sender.sendMessage(ChatMessageType.SYSTEM, start);
}
private static boolean alreadyInArena(ProxiedPlayer player){
Subserver subserver = Subserver.getSubserver(player);
if(subserver != null && subserver.getType() == Servertype.ARENA){
Message.send("FIGHT_IN_ARENA", player);
return true;
}
return false;
}
static void createArena(CommandSender s, String precommand, boolean allowMerging, String[] args, int startArg, boolean historic, FightCallback callback){
if(!(s instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) s;
ChatSender sender = ChatSender.of(player);
if (sender.user().isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) {
return;
}
if(alreadyInArena(player))
return;
if(ModLoaderBlocker.isFabric(player) && !precommand.equals("/bau testarena ")) {
sender.system("MODLOADER_DENIED");
return;
}
if(args.length < startArg+1){
getModes(sender, precommand, historic);
return;
}
ArenaMode mode = getMode(sender, args[startArg]);
if(mode == null)
return;
String map;
if(mode.getMaps().size() == 1){
map = mode.getRandomMap();
}else if(args.length < startArg+2){
getMaps(sender, precommand, mode);
return;
}else{
map = getMap(sender, mode, args[startArg+1]);
}
if(map == null)
return;
if(!allowMerging) {
callback.run(player, mode, map);
} else {
suggestMerging(player, mode, map, callback);
}
}
public static void suggestMerging(ProxiedPlayer player, ArenaMode mode, String map, FightCallback declineMerge) {
Arenaserver mergable = null;
synchronized (Subserver.getServerList()) {
for (Subserver subserver : Subserver.getServerList()) {
if(subserver instanceof Arenaserver) {
Arenaserver arenaserver = (Arenaserver) subserver;
if(mode.getInternalName().equals(arenaserver.getMode()) && map.equals(arenaserver.getMap()) && arenaserver.isAllowMerge() && arenaserver.getServer().getPlayers().size() == 1) {
mergable = arenaserver;
break;
}
}
}
}
if(mergable == null) {
declineMerge.run(player, mode, map);
return;
}
SWInventory inventory = new SWInventory(player, 9, Message.parse("FIGHT_MERGE_TITLE", player));
inventory.addItem(0, new SWItem(Message.parse("FIGHT_MERGE_DECLINE", player), 1), click -> {
inventory.close();
declineMerge.run(player, mode, map);
});
Arenaserver finalMergable = mergable;
SWItem item = new SWItem(Message.parse("FIGHT_MERGE_INFO", player, mode.getDisplayName(), finalMergable.getMap()), 11);
item.addLore(Message.parse("FIGHT_MERGE_INFO_LORE_1", player, finalMergable.getServer().getPlayers().toArray(new ProxiedPlayer[1])[0].getName()));
inventory.addItem(4, item, click -> {});
inventory.addItem(8, new SWItem(Message.parse("FIGHT_MERGE_ACCEPT", player), 10), click -> {
if(Subserver.getServerList().contains(finalMergable)) {
finalMergable.sendPlayer(player);
} else {
Message.send("FIGHT_MERGE_OFFLINE", player);
declineMerge.run(player, mode, map);
}
});
inventory.open();
}
@Override
public void execute(CommandSender sender, String[] args) {
createArena(sender, "/fight ", true, args, 0, false, (player, mode, map) -> {
Subserver arena = new ServerStarter().arena(mode, map).blueLeader(player).start();
Message.broadcast("FIGHT_BROADCAST", "FIGHT_BROADCAST_HOVER"
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName());
});
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
if(args.length == 1){
return ArenaMode.getAllChatNames(false);
}else if(args.length == 2){
ArenaMode mode = ArenaMode.getByChat(args[1]);
if(mode == null)
return new LinkedList<>();
return mode.getMaps();
}
return new LinkedList<>();
}
/**
* Is called when arena parameters are clear.
*/
interface FightCallback {
void run(ProxiedPlayer player, ArenaMode mode, String map);
}
}

Datei anzeigen

@ -1,123 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.ClickEvent;
public class HelpCommand extends BasicCommand {
public HelpCommand() {
super("help", "", "?");
}
@Override
public void execute(CommandSender s, String[] args) {
ChatSender sender = ChatSender.of(s);
if (args.length < 1) {
printPage(sender, ClickEvent.Action.RUN_COMMAND,
"HELP_LOBBY", "/l",
"HELP_BAU", "/bau",
"HELP_BAUSERVER", "/help bau",
"HELP_FIGHT", "/fight",
"HELP_CHALLENGE", "/challenge",
"HELP_HISTORIC", "/historic",
"HELP_TEAM", "/team",
"HELP_JOIN", "/join",
"HELP_LOCAL", "/local");
}else if (args[0].equalsIgnoreCase("bauserver")) {
sendBauHelp(sender);
}else if (args[0].equalsIgnoreCase("bau")) {
bauHelpGroup(sender, args);
}
}
private static void bauHelpGroup(ChatSender sender, String[] args) {
if (args.length < 2) {
sendBauHelpGroup(sender);
return;
}
switch (args[1].toLowerCase()) {
case "admin":
case "owner":
case "bauwelt":
sender.system("HELP_BAU_GROUP_ADMIN_TITLE");
sendBauHelp(sender);
return;
case "world":
printPage(sender, "HELP_BAU_GROUP_WORLD_TITLE", "HELP_TNT", "HELP_FIRE", "HELP_FREEZE", "HELP_TPSLIMIT", "HELP_PROTECT", "HELP_RESET");
return;
case "player":
printPage(sender, "HELP_BAU_GROUP_PLAYER_TITLE", "HELP_SPEED", "HELP_NV", "HELP_WV", "HELP_DEBUGSTICK", "HELP_TRACE", "HELP_LOADER");
return;
case "worldedit":
case "we":
case "world-edit":
case "edit":
printPage(sender, "HELP_BAU_GROUP_WE_TITLE", "HELP_WE_POS1", "HELP_WE_POS2", "HELP_WE_COPY", "HELP_WE_PASTE", "HELP_WE_FLOPY", "HELP_WE_FLOPYP", "HELP_WE_ROTATE_90", "HELP_WE_ROTATE_180", "HELP_WE_ROTATE_N90");
return;
case "other":
printPage(sender, "HELP_BAU_GROUP_OTHER_TITLE", "HELP_TESTBLOCK", "HELP_SKULL", "HELP_BAUINFO");
return;
default:
sendBauHelpGroup(sender);
}
}
private static void sendBauHelpGroup(ChatSender sender) {
printPage(sender, ClickEvent.Action.RUN_COMMAND,
"HELP_BAU_GROUP_ADMIN", "/help bau admin",
"HELP_BAU_GROUP_WORLD", "/help bau world",
"HELP_BAU_GROUP_PLAYER", "/help bau player",
"HELP_BAU_GROUP_WE", "/help bau we",
"HELP_BAU_GROUP_OTHER", "/help bau other");
}
static void sendBauHelp(ChatSender sender) {
printPage(sender, ClickEvent.Action.SUGGEST_COMMAND,
"HELP_BAU_TP", "/bau tp ",
"HELP_BAU_ADDMEMBER", "/bau addmember ",
"HELP_BAU_DELMEMBER", "/bau delmember ",
"HELP_BAU_TOGGLEWE", "/bau togglewe ",
"HELP_BAU_TOGGLEWORLD", "/bau toggleworld ",
"HELP_BAU_DELETE", "/bau delete ",
"HELP_BAU_TESTARENA", "/bau testarena ");
}
private static void printPage(ChatSender sender, ClickEvent.Action action, String... args) {
for(int i = 0; i < args.length; i += 2) {
String message = args[i];
String hoverMessage = message + "_HOVER";
String command = args[i+1];
sender.system(message, new Message(hoverMessage), new ClickEvent(action, command));
}
}
private static void printPage(ChatSender sender, String title, String... messages) {
sender.system(title);
for (String message : messages) {
sender.prefixless(message);
}
}
}

Datei anzeigen

@ -1,57 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.ArenaMode;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.ServerStarter;
import de.steamwar.bungeecore.Subserver;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.ClickEvent;
import java.util.LinkedList;
public class HistoricCommand extends BasicCommand {
public HistoricCommand() {
super("historic", null);
}
@Override
public void execute(CommandSender sender, String[] args) {
FightCommand.createArena(sender, "/historic ", true, args, 0, true, (player, mode, map) -> {
Subserver arena = new ServerStarter().arena(mode, map).blueLeader(player).start();
Message.broadcast("HISTORIC_BROADCAST", "HISTORIC_BROADCAST_HOVER"
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName());
});
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
if(args.length == 1){
return ArenaMode.getAllChatNames(true);
}else if(args.length == 2){
ArenaMode mode = ArenaMode.getByChat(args[1]);
if(mode == null)
return new LinkedList<>();
return mode.getMaps();
}
return new LinkedList<>();
}
}

Datei anzeigen

@ -1,63 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.IgnoreSystem;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public class IgnoreCommand extends BasicCommand {
public IgnoreCommand() {
super("ignore", null);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(args.length < 1) {
Message.send("USAGE_IGNORE", sender);
return;
}
if (!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer p = (ProxiedPlayer) sender;
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
SteamwarUser target = SteamwarUser.get(args[0]);
if(target == null){
Message.send("UNKNOWN_PLAYER", p);
return;
}
if(target.equals(user)){
Message.send("IGNORE_YOURSELF", p);
return;
}
if(IgnoreSystem.isIgnored(user, target)){
Message.send("IGNORE_ALREADY", p);
return;
}
IgnoreSystem.ignore(user, target);
Message.send("IGNORE_MESSAGE", p, target.getUserName());
}
}

Datei anzeigen

@ -1,93 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.sql.BauweltMember;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
public class JoinmeCommand extends BasicCommand {
public JoinmeCommand() {
super("joinme", "");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(sender instanceof ProxiedPlayer) {
ProxiedPlayer player = (ProxiedPlayer) sender;
if (args.length == 0 && player.hasPermission("bungeecore.joinme")) {
Message.broadcast("JOINME_BROADCAST", "JOINME_BROADCAST_HOVER"
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), player.getName(), player.getServer().getInfo().getName());
} else if (args.length == 1) {
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
if(target == null || !target.isConnected()){
Message.send("JOINME_PLAYER_OFFLINE", player);
return;
}else if(target.equals(player)){
Message.send("JOINME_PLAYER_SELF", player);
return;
}
ServerInfo server = target.getServer().getInfo();
String serverPerm = BungeeCore.serverPermissions.get(server.getName());
Subserver subserver = Subserver.getSubserver(target);
if(subserver != null) {
Servertype type = subserver.getType();
if (type == Servertype.ARENA) {
SubserverSystem.sendPlayer(subserver, player);
} else if (type == Servertype.BAUSERVER) {
Bauserver bauserver = (Bauserver) subserver;
if (bauserver.getOwner().equals(player.getUniqueId()) ||
BauweltMember.getBauMember(bauserver.getOwner(), player.getUniqueId()) != null) {
SubserverSystem.sendPlayer(subserver, player);
} else {
SubserverSystem.sendDeniedMessage(player, bauserver.getOwner());
Message.send("JOIN_PLAYER_BLOCK", player);
}
}
}else if(serverPerm != null && !player.hasPermission(serverPerm)){
Message.send("JOIN_PLAYER_BLOCK", player);
}else if(serverPerm == null && !player.getGroups().contains("team")) {
Message.send("JOIN_PLAYER_BLOCK", player);
}else{
player.connect(server);
}
} else {
Message.send("JOINME_USAGE", player);
}
}
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
if(args.length == 1){
return allPlayers(args[0]);
}
return new ArrayList<>();
}
}

Datei anzeigen

@ -1,68 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
public class KickCommand extends BasicCommand {
public KickCommand() {
super("kick", "bungeecore.kick");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(args.length == 0){
Message.send("KICK_USAGE", sender);
return;
}
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
if(target == null){
Message.send("KICK_OFFLINE", sender);
return;
}
if(args.length == 1){
target.disconnect(Message.parseToComponent("KICK_NORMAL", true, target));
}else{
StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append(BungeeCore.CHAT_PREFIX).append("§c");
for (int i = 1; i < args.length; i++){
msgBuilder.append(args[i]).append(" ");
}
target.disconnect(BungeeCore.stringToText(msgBuilder.toString()));
}
Message.send("KICK_CONFIRM", sender, target.getName());
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
if(args.length == 1)
return allPlayers(args[0]);
return new ArrayList<>();
}
}

Datei anzeigen

@ -1,74 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.Servertype;
import de.steamwar.bungeecore.Subserver;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.connection.Server;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;
import java.util.stream.Collectors;
public class ListCommand extends BasicCommand {
public ListCommand() {
super("list", "");
}
public static synchronized TreeMap<String, List<ProxiedPlayer>> getCustomTablist(){
TreeMap<String, List<ProxiedPlayer>> playerMap = new TreeMap<>();
for (ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) {
Server pserver = player.getServer();
if (pserver == null) //Happens temporarily
continue;
ServerInfo server = pserver.getInfo();
String serverName = server.getName();
Subserver subserver = Subserver.getSubserver(server);
if (subserver != null && subserver.getType() == Servertype.BAUSERVER) {
playerMap.computeIfAbsent("Bau", s -> new ArrayList<>()).add(player);
} else {
playerMap.computeIfAbsent(serverName, s -> new ArrayList<>()).add(player);
}
}
playerMap.forEach((server, players) -> players.sort((proxiedPlayer, t1) -> proxiedPlayer.getName().compareToIgnoreCase(t1.getName())));
return playerMap;
}
@Override
public void execute(CommandSender commandSender, String[] strings) {
TreeMap<String, List<ProxiedPlayer>> playerMap = getCustomTablist();
for (String server : playerMap.navigableKeySet()) {
String serverName = server;
if (server.equals("Bau")) {
serverName = Message.parse("TABLIST_BAU", commandSender);
}
Message.send("LIST_COMMAND", commandSender, serverName, playerMap.get(server).stream().map(CommandSender::getName).collect(Collectors.joining(", ")));
}
}
}

Datei anzeigen

@ -1,83 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.listeners.ChatListener;
import de.steamwar.bungeecore.sql.IgnoreSystem;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Stream;
import static de.steamwar.bungeecore.Storage.lastChats;
public class MsgCommand extends BasicCommand {
public MsgCommand() {
super("msg", "", "w", "tell");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
if (args.length < 2) {
ChatSender.of(sender).system("MSG_USAGE");
return;
}
msg((ProxiedPlayer) sender, ProxyServer.getInstance().getPlayer(args[0]), Arrays.copyOfRange(args, 1, args.length));
}
public static void msg(ProxiedPlayer player, ProxiedPlayer target, String[] args) {
ChatSender sender = ChatSender.of(player);
if(target == null || !target.isConnected()) {
sender.system("MSG_OFFLINE");
return;
}
if (IgnoreSystem.isIgnored(target, player)) {
sender.system("MSG_IGNORED");
return;
}
ChatSender receiver = ChatSender.of(target);
ChatListener.sendChat(sender, Stream.of(sender, receiver), "CHAT_MSG", receiver, String.join(" ", args));
lastChats.put(player, target);
lastChats.put(target, player);
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
if(args.length == 1){
return allPlayers(args[0]);
}
return new ArrayList<>();
}
public static void remove(ProxiedPlayer player){
lastChats.remove(player);
}
}

Datei anzeigen

@ -1,49 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import org.apache.commons.lang3.LocaleUtils;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
public class PlaytimeCommand extends BasicCommand{
public PlaytimeCommand() {
super("playtime", null);
}
@Override
public void execute(CommandSender sender, String[] strings) {
if(!(sender instanceof ProxiedPlayer))
return;
NumberFormat format = NumberFormat.getNumberInstance(((ProxiedPlayer)sender).getLocale());
format.setMaximumFractionDigits(2);
String formattedText = format.format((SteamwarUser.get((ProxiedPlayer) sender).getOnlinetime() / (double) 3600));
Message.send("HOURS_PLAYED", sender, formattedText);
}
}

Datei anzeigen

@ -1,54 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.listeners.PollSystem;
import de.steamwar.bungeecore.sql.PollAnswer;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.Map;
public class PollresultCommand extends BasicCommand {
public PollresultCommand() {
super("pollresult", "bungeecore.pollresults");
}
@Override
public void execute(CommandSender sender, String[] strings) {
if(!(sender instanceof ProxiedPlayer))
return;
if(PollSystem.noCurrentPoll()) {
Message.send("POLLRESULT_NOPOLL", sender);
return;
}
ProxiedPlayer player = (ProxiedPlayer) sender;
Map<String, Integer> voted = PollAnswer.getCurrentResults();
Message.send("POLLRESULT_HEADER", player, voted.values().stream().reduce(Integer::sum).orElse(0), PollSystem.getQuestion());
for (Map.Entry<String, Integer> e: voted.entrySet()) {
Message.send("POLLRESULT_LIST", sender, e.getKey(), e.getValue());
}
}
}

Datei anzeigen

@ -1,118 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Date;
public class PunishmentCommand {
public PunishmentCommand(String command, Punishment.PunishmentType punishmentType) {
new BasicCommand(command, "bungeecore.ban") {
@Override
public void execute(CommandSender sender, String[] args) {
if (punishmentType.isNeedsAdmin() && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) {
return;
}
if (args.length < 3) {
Message.send("PUNISHMENT_USAGE", sender, command);
return;
}
SteamwarUser target = unsafeUser(sender, args[0]);
if (target == null)
return;
Timestamp banTime = parseTime(sender, args[1]);
if (banTime == null)
return;
StringBuilder reason = new StringBuilder();
for (int i = 2; i < args.length; i++) {
reason.append(args[i]).append(" ");
}
boolean isPerma = args[1].equalsIgnoreCase("perma");
String msg = reason.toString();
target.punish(punishmentType, banTime, msg, SteamwarUser.get(sender.getName()).getId(), isPerma);
Message.team(punishmentType.getTeamMessage(), new Message("PREFIX"), target.getUserName(), sender.getName(), new Message((isPerma ? "PUNISHMENT_PERMA" : "PUNISHMENT_UNTIL"), banTime), msg);
}
};
if (punishmentType.getUnpunishmentMessage() == null) {
return;
}
String antiCommand = "un" + command;
new BasicCommand(antiCommand, "bungeecore.ban") {
@Override
public void execute(CommandSender sender, String[] args) {
if (punishmentType.isNeedsAdmin() && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) {
return;
}
if (args.length < 1) {
Message.send("UNPUNISHMENT_USAGE", sender, antiCommand);
return;
}
SteamwarUser target = existingUser(sender, args[0]);
if (target == null)
return;
if (!target.isPunished(punishmentType)) {
Message.send(punishmentType.getUsageNotPunished(), sender);
return;
}
Message.send(punishmentType.getUnpunishmentMessage(), sender, target.getUserName());
target.punish(punishmentType, Timestamp.from(new Date().toInstant()), antiCommand, SteamwarUser.get(sender.getName()).getId(), false);
}
};
}
public static Timestamp parseTime(CommandSender sender, String arg) {
if (arg.equalsIgnoreCase("perma")) {
return Punishment.PERMA_TIME;
} else {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy_HH:mm");
try {
Date parsedDate = dateFormat.parse(arg);
return new java.sql.Timestamp(parsedDate.getTime());
} catch (ParseException e) {
dateFormat = new SimpleDateFormat("dd.MM.yyyy");
try {
Date parsedDate = dateFormat.parse(arg.split("_")[0]);
return new java.sql.Timestamp(parsedDate.getTime());
} catch (ParseException exception) {
if (sender != null) {
Message.send("INVALID_TIME", sender);
}
return null;
}
}
}
}
}

Datei anzeigen

@ -1,70 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.ArenaMode;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.UserElo;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.Optional;
public class RankCommand extends BasicCommand {
public RankCommand() {
super("rank", null);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
if (args.length > 0) {
SteamwarUser nUser = SteamwarUser.get(args[0]);
if (nUser == null) {
Message.send("RANK_PLAYER_NOT_FOUND", player);
return;
}
Message.send("RANK_PLAYER_FOUND", player, nUser.getUserName());
user = nUser;
}
for(ArenaMode mode : ArenaMode.getAllModes()) {
if (!mode.isRanked())
continue;
Message.send("RANK_HEADER", player, mode.getChatName());
Optional<Integer> elo = UserElo.getElo(user.getId(), mode.getSchemType());
if (elo.isPresent()) {
int placement = UserElo.getPlacement(elo.get(), mode.getSchemType());
Message.send("RANK_PLACED", player, placement, elo.get());
} else {
Message.send("RANK_UNPLACED", player);
}
Message.send("RANK_EMBLEM", player, UserElo.getEmblemProgression(player, mode.getChatName(), user.getId()));
}
}
}

Datei anzeigen

@ -1,44 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public class RegelnCommand extends BasicCommand {
public RegelnCommand() {
super("regeln", null);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
Message.send("REGELN_RULES", player);
Message.sendPrefixless("REGELN_AS", player, Message.parse("REGELN_AS_HOVER", player), new ClickEvent(ClickEvent.Action.OPEN_URL, Message.parse("REGELN_AS_URL", player)));
Message.sendPrefixless("REGELN_MWG", player, Message.parse("REGELN_MWG_HOVER", player), new ClickEvent(ClickEvent.Action.OPEN_URL, Message.parse("REGELN_MWG_URL", player)));
Message.sendPrefixless("REGELN_WG", player, Message.parse("REGELN_WG_HOVER", player), new ClickEvent(ClickEvent.Action.OPEN_URL, Message.parse("REGELN_WG_URL", player)));
Message.sendPrefixless("REGELN_WS", player, Message.parse("REGELN_WS_HOVER", player), new ClickEvent(ClickEvent.Action.OPEN_URL, Message.parse("REGELN_WS_URL", player)));
}
}

Datei anzeigen

@ -1,91 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.inventory.SWListInv;
import de.steamwar.bungeecore.inventory.SWStreamInv;
import de.steamwar.bungeecore.sql.Fight;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SchematicType;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class ReplayCommand extends BasicCommand {
public ReplayCommand() {
super("replay", null);
}
@Override
public void execute(CommandSender s, String[] args) {
if(!(s instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) s;
ChatSender sender = ChatSender.of(player);
if (sender.user().isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer))
return;
new SWStreamInv<>(player, Message.parse("REPLAY_TITLE", player), (click, fight) -> {
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
ArenaMode mode = fight.getGameMode();
ServerStarter starter = new ServerStarter().replay(fight.getFightID()).blueLeader(player);
if (user.getUserGroup().isAdminGroup() && click.isShiftClick() && fight.replayExists()) {
starter.test(mode, mode.getRandomMap(), player).start();
} else if(!fight.replayAllowed()) {
sender.system("REPLAY_UNAVAILABLE");
} else {
starter.arena(mode, mode.getRandomMap()).start();
}
}, page -> Fight.getPage(page, 45).stream().map(fight -> new SWListInv.SWListEntry<>(getFightItem(sender, fight), fight)).collect(Collectors.toList())).open();
}
private SWItem getFightItem(ChatSender sender, Fight fight) {
SchematicType type = fight.getSchemType();
SWItem item = new SWItem(type != null ? type.getMaterial() : "BARRIER", parseLeader(sender, fight.getBlueLeader(), fight.getBluePlayers().size(), fight.getWin() == 1));
List<String> lore = new ArrayList<>();
lore.add(parseLeader(sender, fight.getRedLeader(), fight.getRedPlayers().size(), fight.getWin() == 2));
lore.add(sender.parseToLegacy("REPLAY_TIME", fight.getStartTime()));
lore.add("");
lore.add(sender.parseToLegacy("REPLAY_SERVER", fight.getServer()));
if(!fight.replayAllowed())
lore.add(sender.parseToLegacy("REPLAY_UNAVAILABLE"));
item.setLore(lore);
if(fight.replayAllowed())
item.setEnchanted(true);
return item;
}
private String parseLeader(ChatSender sender, SteamwarUser leader, int players, boolean winner) {
return sender.parseToLegacy(winner ? (players > 1 ? "REPLAY_WINNER" : "REPLAY_SOLO_WINNER") : (players > 1 ? "REPLAY_LOSER" : "REPLAY_SOLO_LOSER"), leader.getUserName(), players - 1);
}
}

Datei anzeigen

@ -1,768 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.Storage;
import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.inventory.SWListInv;
import de.steamwar.bungeecore.sql.*;
import de.steamwar.messages.ChatSender;
import io.netty.channel.ConnectTimeoutException;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.UserConnection;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.ServerConnectEvent;
import java.net.*;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import static de.steamwar.bungeecore.Storage.teamInvitations;
public class TeamCommand extends BasicCommand {
private static final List<SWListInv.SWListEntry<String>> COLOR_CODES = new ArrayList<>();
static {
addColor("4", 1);
addColor("c", 15);
addColor("6", 14);
addColor("e", 11);
addColor("2", 2);
addColor("a", 10);
addColor("b", 12);
addColor("3", 6);
addColor("1", 4);
addColor("9", 6);
addColor("d", 9);
addColor("5", 5);
addColor("f", 15);
addColor("7", 7);
addColor("8", 8);
addColor("0", 16);
}
private static void addColor(String color, int colorCode) {
COLOR_CODES.add(new SWListInv.SWListEntry(new SWItem("§" + color, colorCode), color));
}
public TeamCommand() {
super("team", "");
}
private void help(CommandSender sender){
Message.send("TEAM_HELP_HEADER", sender);
Message.send("TEAM_HELP_LIST", sender);
Message.send("TEAM_HELP_INFO", sender);
Message.send("TEAM_HELP_TP", sender);
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
if(user.getTeam() == 0) {
Message.send("TEAM_HELP_CREATE", sender);
Message.send("TEAM_HELP_JOIN", sender);
}else{
Message.send("TEAM_HELP_CHAT", sender);
Message.send("TEAM_HELP_EVENT", sender);
Message.send("TEAM_HELP_LEAVE", sender);
if(user.isLeader()){
Message.send("TEAM_HELP_INVITE", sender);
Message.send("TEAM_HELP_REMOVE", sender);
Message.send("TEAM_HELP_KUERZEL", sender);
Message.send("TEAM_HELP_NAME", sender);
Message.send("TEAM_HELP_COLOR", sender);
Message.send("TEAM_HELP_LEADER", sender);
Message.send("TEAM_HELP_STEP_BACK", sender);
Message.send("TEAM_HELP_SERVER", sender);
}
}
}
@Override
public void execute(CommandSender sender, String[] args){
if(args.length < 1){
help(sender);
return;
}
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
Team team = Team.get(user.getTeam());
switch(args[0].toLowerCase()){
case "create":
create(player, user, team, args);
break;
case "join":
join(player, user, args);
break;
case "stepback":
stepBack(player,user,team);
break;
case "leave":
leave(player, user, team);
break;
case "invite":
invite(player, user, team, args);
break;
case "remove":
remove(player, user, team, args);
break;
case "changekuerzel":
changekuerzel(player, user, team, args);
break;
case "changename":
changename(player, user, team, args);
break;
case "promote":
promote(player, user, team, args);
break;
case "changecolor":
changeColor(player, user, team);
break;
case "info":
info(player, user, team, args);
break;
case "list":
list(player, args);
break;
case "event":
event(player, user, team, args);
break;
case "tp":
tp(player, user, team, args);
break;
case "server":
server(player, user, team, args);
break;
default:
help(player);
}
}
private void create(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(unwantedInTeam(player, user))
return;
if(args.length < 3){
Message.send("TEAM_CREATE_USAGE", player);
return;
}
if(checkTeamKuerzel(player, team, args[1]))
return;
if(checkTeamName(player, team, args[2]))
return;
Team.create(args[1], args[2]);
user.setTeam(Team.get(args[1]).getTeamId());
user.setLeader(true);
Message.send("TEAM_CREATE_CREATED", player, args[2]);
}
private void join(ProxiedPlayer player, SteamwarUser user, String[] args){
if(unwantedInTeam(player, user))
return;
if(notDuringEvent(player))
return;
if(!teamInvitations.containsKey(user.getId())){
Message.send("TEAM_JOIN_NO_INVITE", player);
return;
}
List<Integer> invs = teamInvitations.get(user.getId());
Integer t = null;
if(invs.size() == 1){
t = invs.get(0);
}else{
if(args.length != 2){
Message.send("TEAM_JOIN_USAGE", player);
StringBuilder sb = new StringBuilder();
for(int inv : invs){
Team team = Team.get(inv);
sb.append(team.getTeamName()).append(" ");
}
Message.send("TEAM_JOIN_INVITED", player, sb.toString());
return;
}
for(int inv : invs){
Team team = Team.get(inv);
if(team.getTeamName().equals(args[1])){
t = inv;
break;
}
}
if(t == null){
Message.send("TEAM_JOIN_NOT_BY_TEAM", player);
return;
}
}
user.setTeam(t);
teamInvitations.remove(user.getId());
Message.send("TEAM_JOIN_JOINED", player, Team.get(t).getTeamName());
}
private void stepBack(ProxiedPlayer player, SteamwarUser user, Team team) {
if(notLeader(player, user, team))
return;
if(team.size() > 1 && team.getMembers().stream().map(SteamwarUser::get).filter(member -> user != member).noneMatch(SteamwarUser::isLeader)){
Message.send("TEAM_OTHER_LEADER_REQUIRED", player);
return;
}
user.setLeader(false);
Message.send("TEAM_STEP_BACK", player);
}
private void leave(ProxiedPlayer player, SteamwarUser user, Team team){
if(notInTeam(player, user))
return;
int teamSize = team.size();
if(teamSize > 1 && user.isLeader() && team.getMembers().stream().map(SteamwarUser::get).filter(member -> user != member).noneMatch(SteamwarUser::isLeader)){
Message.send("TEAM_OTHER_LEADER_REQUIRED", player);
return;
}
user.setTeam(0);
if(teamSize == 1){
team.disband(user);
}
Message.send("TEAM_LEAVE_LEFT", player);
}
private void invite(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(notLeader(player, user, team))
return;
if(notDuringEvent(player))
return;
if(args.length != 2){
Message.send("TEAM_INVITE_USAGE", player);
return;
}
SteamwarUser target = SteamwarUser.get(args[1]);
if(target == null){
Message.send("TEAM_INVITE_NO_PLAYER", player);
return;
}else if(target.getTeam() != 0){
Message.send("TEAM_INVITE_IN_TEAM", player);
return;
}
if(!teamInvitations.containsKey(target.getId()))
teamInvitations.put(target.getId(), new LinkedList<>());
if(teamInvitations.get(target.getId()).contains(team.getTeamId())){
Message.send("TEAM_INVITE_ALREADY_INVITED", player);
return;
}
teamInvitations.get(target.getId()).add(team.getTeamId());
Message.send("TEAM_INVITE_INVITED", player, args[1]);
ProxiedPlayer p = ProxyServer.getInstance().getPlayer(target.getUuid());
if(p != null)
Message.send("TEAM_INVITE_INVITED_TARGET", p, team.getTeamColor(), team.getTeamName());
}
private void remove(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(notLeader(player, user, team))
return;
if(args.length != 2){
Message.send("TEAM_REMOVE_USAGE", player);
return;
}
SteamwarUser target = SteamwarUser.get(args[1]);
if(target == null){
Message.send("TEAM_REMOVE_NOT_PLAYER", player);
return;
}
if (target.isLeader()) {
Message.send("TEAM_REMOVE_NOT_LEADER", player);
return;
}
if(teamInvitations.containsKey(target.getId())){
if(teamInvitations.get(target.getId()).remove((Integer) team.getTeamId())){
Message.send("TEAM_REMOVE_INVITE", player);
if(teamInvitations.get(target.getId()).isEmpty())
teamInvitations.remove(target.getId());
}else{
Message.send("TEAM_REMOVE_NO_INVITE", player);
}
return;
}
if(target.getTeam() != user.getTeam()){
Message.send("TEAM_REMOVE_NOT_IN_TEAM", player);
return;
}
target.setTeam(0);
Message.send("TEAM_REMOVE_REMOVED", player);
ProxiedPlayer p = ProxyServer.getInstance().getPlayer(target.getUuid());
if(p != null)
Message.send("TEAM_REMOVE_REMOVED_TARGET", player);
}
private void changekuerzel(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(notLeader(player, user, team))
return;
if(notDuringEvent(player))
return;
if(args.length < 2){
Message.send("TEAM_KUERZEL_USAGE", player);
return;
}
if(checkTeamKuerzel(player, team, args[1]))
return;
team.setTeamKuerzel(args[1]);
Message.send("TEAM_KUERZEL_CHANGED", player);
}
private void changename(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(notLeader(player, user, team))
return;
if(notDuringEvent(player))
return;
if(args.length < 2){
Message.send("TEAM_NAME_USAGE", player);
return;
}
if(checkTeamName(player, team, args[1]))
return;
team.setTeamName(args[1]);
Message.send("TEAM_NAME_CHANGED", player);
}
private void promote(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(notLeader(player, user, team))
return;
if(notDuringEvent(player))
return;
if(args.length < 2){
Message.send("TEAM_LEADER_USAGE", player);
return;
}
SteamwarUser target = SteamwarUser.get(args[1]);
if(target == null){
Message.send("TEAM_LEADER_NOT_USER", player, args[1]);
return;
}
if(target.getTeam() != user.getTeam()){
Message.send("TEAM_LEADER_NOT_MEMBER", player);
return;
}
target.setLeader(true);
Message.send("TEAM_LEADER_PROMOTED", player, args[1]);
}
private String playerName(SteamwarUser user){
return ProxyServer.getInstance().getPlayer(user.getUuid()) != null ? "§a" + user.getUserName() : "§e" + user.getUserName();
}
private void info(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(args.length == 1 && user.getTeam() == 0){
Message.send("TEAM_INFO_USAGE", player);
return;
}else if(user.getTeam() == 0 || args.length == 2){
team = Team.get(args[1]);
}
if(team == null){
Message.send("UNKNOWN_TEAM", player);
return;
}
Message.sendPrefixless("TEAM_INFO_TEAM", player, team.getTeamName(), team.getTeamColor(), team.getTeamKuerzel());
List<SteamwarUser> users = team.getMembers().stream().map(SteamwarUser::get).collect(Collectors.toList());
Message.sendPrefixless("TEAM_INFO_LEADER", player, getMemberList(users, true));
String members = getMemberList(users, false);
if(members.length() > 0) {
Message.sendPrefixless("TEAM_INFO_MEMBER", player, members);
}
Set<Event> events = TeamTeilnahme.getEvents(team.getTeamId());
if(!events.isEmpty()){
Message.sendPrefixless("TEAM_INFO_EVENTS", player, events.stream().map(Event::getEventName).collect(Collectors.joining(", ")));
}
}
private String getMemberList(List<SteamwarUser> users, boolean leaders) {
StringBuilder sb = new StringBuilder();
for(SteamwarUser user : users) {
if(user.isLeader() == leaders) {
sb.append(playerName(user)).append(" ");
}
}
return sb.toString();
}
private void list(ProxiedPlayer player, String[] args){
final int TEAMS_PER_PAGE = 10;
int page;
if(args.length > 1){
try{
page = Integer.parseInt(args[1]);
}catch(NumberFormatException e){
Message.send("TEAM_LIST_NOT_PAGE", player);
return;
}
}else
page = 1;
List<Team> all = Team.getAll();
final int lastPage = ((all.size() - 1) / 10) + 1;
if(page < 1 || page > lastPage){
Message.send("TEAM_LIST_UNKNOWN_PAGE", player);
return;
}
Message.sendPrefixless("TEAM_LIST_HEADER", player, page, lastPage);
for(int i = (page-1) * TEAMS_PER_PAGE; i < (page-1) * TEAMS_PER_PAGE + TEAMS_PER_PAGE && i < all.size(); i++){
Team tm = all.get(i);
Message.sendPrefixless("TEAM_LIST_TEAM", player, Message.parse("TEAM_LIST_TEAM_HOVER", player),
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + tm.getTeamKuerzel()), tm.getTeamColor(), tm.getTeamKuerzel(), tm.getTeamName());
}
TextComponent beforePage = new TextComponent("««");
if(page > 1){
beforePage.setColor(ChatColor.YELLOW);
beforePage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Message.parse("TEAM_LIST_PREV", player)).create()));
beforePage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team list " + (page - 1)));
}else
beforePage.setColor(ChatColor.DARK_GRAY);
TextComponent nextPage = new TextComponent(" " + Message.parse("TEAM_LIST_PAGE", player) +" »»");
if(page < lastPage){
nextPage.setColor(ChatColor.YELLOW);
nextPage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Message.parse("TEAM_LIST_NEXT", player)).create()));
nextPage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team list " + (page + 1)));
}else
nextPage.setColor(ChatColor.DARK_GRAY);
beforePage.addExtra(nextPage);
player.sendMessage(beforePage);
}
private void event(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(notInTeam(player, user))
return;
if(args.length < 2){
Message.send("TEAM_EVENT_USAGE", player);
Set<Event> events = TeamTeilnahme.getEvents(team.getTeamId());
if(!events.isEmpty()){
Message.send("TEAM_EVENT_HEADER", player);
DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern(Message.parse("EVENT_DATE_FORMAT", player));
for(Event e : events)
Message.sendPrefixless("TEAM_EVENT_EVENT", player, e.getStart().toLocalDateTime().format(dateFormat), e.getEventName());
}
return;
}
if(notLeader(player, user, team))
return;
if(notDuringEvent(player))
return;
Event event = Event.get(args[1]);
if(event == null){
Message.send("TEAM_EVENT_NO_EVENT", player);
return;
}
if(Instant.now().isAfter(event.getDeadline().toInstant())){
Message.send("TEAM_EVENT_OVER", player);
return;
}
if(TeamTeilnahme.nimmtTeil(team.getTeamId(), event.getEventID())){
TeamTeilnahme.notTeilnehmen(team.getTeamId(), event.getEventID());
Message.send("TEAM_EVENT_LEFT", player);
}else{
TeamTeilnahme.teilnehmen(team.getTeamId(), event.getEventID());
Message.send("TEAM_EVENT_JOINED", player, event.getEventName());
Message.sendPrefixless("TEAM_EVENT_HOW_TO_LEAVE", player);
}
}
private void tp(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(args.length == 1){
if(notInTeam(player, user))
return;
tp(player, team);
return;
}
Team targetTeam = Team.get(args[1]);
if(targetTeam == null){
Message.send("TEAM_TP_NO_TEAM", player);
return;
}
tp(player, targetTeam);
}
private void tp(ProxiedPlayer player, Team targetTeam) {
if (targetTeam.getAddress() == null) {
Message.send("TEAM_NO_ADDRESS", player);
return;
}
ServerInfo serverInfo = Storage.teamServers.computeIfAbsent(targetTeam.getTeamId(), integer -> {
InetSocketAddress address = new InetSocketAddress(targetTeam.getAddress(), targetTeam.getPort());
ServerInfo info = ProxyServer.getInstance().constructServerInfo("Team " + targetTeam.getTeamKuerzel(), address, "SteamWar.de - Teamserver", false);
ProxyServer.getInstance().getServers().put(info.getName(), info);
return info;
});
((UserConnection) player).connect(serverInfo, (success, error) -> {
if (error != null) {
Message.send("TEAM_OFFLINE", player);
}
}, false, ServerConnectEvent.Reason.PLUGIN, BungeeCord.getInstance().getConfig().getServerConnectTimeout(), false);
}
private void server(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(notLeader(player, user, team))
return;
if (user.isPunishedWithMessage(ChatSender.of(player), Punishment.PunishmentType.NoTeamServer)) {
return;
}
if (args.length < 2) {
Message.send("TEAM_SERVER_USAGE", player);
return;
}
String server = args[1];
try {
if (isLocalhost(InetAddress.getByName(server))) {
Message.send("TEAM_SERVER_ADDRESS_INVALID", player);
return;
}
} catch (UnknownHostException e) {
Message.send("TEAM_SERVER_ADDRESS_INVALID", player);
return;
}
int port = 25565;
if (args.length == 3) {
try {
port = Integer.parseInt(args[2]);
if (port < 1 || port > 65535) {
Message.send("TEAM_SERVER_PORT_INVALID", player);
return;
}
} catch (NumberFormatException e) {
Message.send("TEAM_SERVER_PORT_INVALID", player);
return;
}
}
team.setAddress(server);
team.setPort(port);
Storage.teamServers.remove(team.getTeamId());
Message.send("TEAM_SERVER_SET", player);
}
private static boolean isLocalhost(InetAddress addr) {
// Check if the address is a valid special local or loop back
if (addr.isAnyLocalAddress() || addr.isLoopbackAddress())
return true;
// Check if the address is defined on any interface
try {
return NetworkInterface.getByInetAddress(addr) != null;
} catch (SocketException e) {
return false;
}
}
private void changeColor(ProxiedPlayer player, SteamwarUser user, Team team) {
if(notLeader(player, user, team))
return;
if(notDuringEvent(player))
return;
List<SWListInv.SWListEntry<String>> colors = new ArrayList<>();
COLOR_CODES.forEach(stringSWListEntry -> {
SWItem item = stringSWListEntry.getItem().clone();
item.setName(stringSWListEntry.getItem().getTitle() + Team.get(user.getTeam()).getTeamKuerzel());
colors.add(new SWListInv.SWListEntry<>(item, stringSWListEntry.getObject()));
});
SWListInv<String> inv = new SWListInv<>(player, Message.parse("TEAM_COLOR_TITLE", player), colors, (click, element) -> {});
inv.setCallback((click, element) -> {
inv.close();
team.setTeamColor(element);
});
inv.open();
}
private boolean checkTeamName(ProxiedPlayer player, Team team, String arg){
if(arg.length() < 4 || arg.length() > 15){
Message.send("TEAM_NAME_LENGHT", player);
return true;
}
Team t = Team.get(arg);
if(t != null && t.getTeamId() != team.getTeamId()){
Message.send("TEAM_NAME_TAKEN", player);
return true;
}
return false;
}
private boolean checkTeamKuerzel(ProxiedPlayer player, Team team, String arg){
if(arg.length() < 2 || arg.length() > 4){
Message.send("TEAM_KUERZEL_LENGHT", player);
return true;
}
Team t = Team.get(arg);
if(t != null && (team == null || t.getTeamId() != team.getTeamId())){
Message.send("TEAM_KUERZEL_TAKEN", player);
return true;
}
return false;
}
private boolean unwantedInTeam(ProxiedPlayer player, SteamwarUser user){
if(user.getTeam() != 0){
Message.send("TEAM_IN_TEAM", player);
return true;
}
return false;
}
private boolean notInTeam(ProxiedPlayer player, SteamwarUser user){
if(user.getTeam() == 0){
Message.send("TEAM_NOT_IN_TEAM", player);
return true;
}
return false;
}
private boolean notLeader(ProxiedPlayer player, SteamwarUser user, Team team){
if(notInTeam(player, user))
return true;
if(!user.isLeader()){
Message.send("TEAM_NOT_LEADER", player);
return true;
}
return false;
}
private boolean notDuringEvent(ProxiedPlayer player){
if(Event.get() != null){
Message.send("TEAM_NOT_IN_EVENT", player);
return true;
}
return false;
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args){
List<String> tab = new ArrayList<>();
if(args.length == 1){
tab.add("create");
tab.add("join");
tab.add("invite");
tab.add("stepback");
tab.add("leave");
tab.add("info");
tab.add("remove");
tab.add("event");
tab.add("changekuerzel");
tab.add("changename");
tab.add("promote");
tab.add("changecolor");
tab.add("tp");
tab.add("server");
}else if(args.length == 2){
if(args[1].equalsIgnoreCase("event")){
List<Event> coming = Event.getComing();
coming.forEach(event -> tab.add(event.getEventName()));
}else if(args[1].equalsIgnoreCase("join") || args[1].equalsIgnoreCase("info") || args[1].equalsIgnoreCase("tp")){
List<Team> teams = Team.getAll();
teams.forEach(team -> {
tab.add(team.getTeamName());
tab.add(team.getTeamKuerzel());
});
}
}
return tab;
}
}

Datei anzeigen

@ -1,135 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.sql.*;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
public class TpCommand extends BasicCommand {
public TpCommand(){
super("join", null, "tp", "teleport");
}
@Override
public void execute(CommandSender s, String[] args) {
if(!(s instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) s;
ChatSender sender = ChatSender.of(player);
if(args.length == 0){
if(Event.get() == null)
sender.system("TP_USAGE");
else
sender.system("TP_USAGE_EVENT");
return;
}
ServerInfo server = getTarget(player, args[0]);
//Give control of teleport command to server
if(server == null) {
player.chat("/tp " + String.join(" ", args));
return;
}
teleport(player, server);
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
if(args.length > 0)
return allPlayers(args[args.length - 1]);
return new ArrayList<>();
}
public static void teleport(ProxiedPlayer player, ServerInfo server){
ChatSender sender = ChatSender.of(player);
if(CheckCommand.isChecking(player)){
sender.system("CHECK_CHECKING");
return;
}
String serverPerm = BungeeCore.serverPermissions.get(server.getName());
Subserver subserver = Subserver.getSubserver(server);
if (subserver != null && subserver.getType() == Servertype.ARENA) {
if (!sender.user().isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer))
SubserverSystem.sendPlayer(subserver, player);
} else if(subserver instanceof Bauserver) {
Bauserver bauserver = (Bauserver) subserver;
ProxiedPlayer checker = BungeeCord.getInstance().getPlayer(bauserver.getOwner());
if (checker != null && CheckCommand.isChecking(checker)) {
SteamwarUser steamwarUser = SteamwarUser.get(player);
if (steamwarUser.getUserGroup().isCheckSchematics() || CheckCommand.getCheckingSchem(checker).getOwner() == steamwarUser.getId()) {
SubserverSystem.sendPlayer(subserver, player);
} else {
sender.system("JOIN_PLAYER_BLOCK");
}
} else if (bauserver.getOwner().equals(player.getUniqueId()) || BauweltMember.getBauMember(bauserver.getOwner(), player.getUniqueId()) != null) {
SubserverSystem.sendPlayer(subserver, player);
} else {
SubserverSystem.sendDeniedMessage(player, bauserver.getOwner());
sender.system("JOIN_PLAYER_BLOCK");
}
} else if (serverPerm != null && !player.hasPermission(serverPerm)) {
sender.system("JOIN_PLAYER_BLOCK");
} else if (serverPerm == null && !player.getGroups().contains("team")) {
sender.system("JOIN_PLAYER_BLOCK");
} else {
player.connect(server);
}
}
private static ServerInfo getTarget(ProxiedPlayer player, String arg) {
ServerInfo server = null;
//Get target player server
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(arg);
if(target != null)
server = target.getServer().getInfo();
//Get target team event arena
if(server == null){
Team team = Team.get(arg);
if(team != null){
Subserver eventArena = EventStarter.getEventServer().get(team.getTeamId());
if(eventArena != null && Subserver.getServerList().contains(eventArena))
server = eventArena.getServer();
}
}
if(server == player.getServer().getInfo())
server = null;
return server;
}
}

Datei anzeigen

@ -1,176 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.inventory.SWInventory;
import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.inventory.SWListInv;
import de.steamwar.bungeecore.inventory.SWStreamInv;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Tutorial;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.stream.Collectors;
public class TutorialCommand extends BasicCommand {
public TutorialCommand() {
super("tutorial", null);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length == 0) {
openInventory(player, true, false);
return;
}
switch(args[0].toLowerCase()) {
case "rate":
if(args.length < 2) {
player.chat("/tutorial rate");
return;
}
int id;
try {
id = Integer.parseInt(args[1]);
} catch (NumberFormatException e) {
BungeeCore.get().getLogger().log(Level.SEVERE, "rate executed with non number: " + args[1]);
return;
}
Tutorial tutorial = Tutorial.get(id);
if(tutorial == null) {
BungeeCore.get().getLogger().log(Level.SEVERE, "rate executed with nonexistent id: " + id);
return;
}
rate(player, tutorial);
break;
case "create":
if(args.length < 3) {
Message.send("TUTORIAL_CREATE_HELP", player);
return;
}
create(player, Arrays.stream(args).skip(2).collect(Collectors.joining(" ")), args[1].toUpperCase());
break;
case "own":
openInventory(player, false, true);
break;
case "unreleased":
if (SteamwarUser.get(player.getUniqueId()).getUserGroup().isTeamGroup()) {
openInventory(player, false, false);
break;
}
default:
Message.send("TUTORIAL_CREATE_HELP", player);
Message.send("TUTORIAL_OWN_HELP", player);
}
}
private void openInventory(ProxiedPlayer player, boolean released, boolean own) {
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
new SWStreamInv<>(
player,
Message.parse("TUTORIAL_TITLE", player),
(click, tutorial) -> {
if(!released && click.isShiftClick() && user.getUserGroup().isTeamGroup() && user != tutorial.creator()) {
tutorial.release();
openInventory(player, released, own);
return;
} else if(own && click.isShiftClick() && click.isRightClick()) {
tutorial.delete();
openInventory(player, released, own);
return;
}
new ServerStarter().tutorial(player, tutorial).start();
},
page -> (own ? Tutorial.getOwn(user, page, 45) : Tutorial.getPage(page, 45, released)).stream().map(tutorial -> new SWListInv.SWListEntry<>(getTutorialItem(player, tutorial, own), tutorial)).collect(Collectors.toList())
).open();
}
private SWItem getTutorialItem(ProxiedPlayer player, Tutorial tutorial, boolean personalHighlights) {
SWItem item = new SWItem(tutorial.item(), Message.parse("TUTORIAL_NAME", player, tutorial.name()));
item.setHideAttributes(true);
List<String> lore = new ArrayList<>();
lore.add(Message.parse("TUTORIAL_BY", player, tutorial.creator().getUserName()));
lore.add(Message.parse("TUTORIAL_STARS", player, String.format("%.1f", tutorial.stars())));
if (personalHighlights)
lore.add(Message.parse("TUTORIAL_DELETE", player));
item.setLore(lore);
if (personalHighlights && tutorial.released())
item.setEnchanted(true);
return item;
}
private void rate(ProxiedPlayer player, Tutorial tutorial) {
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
int[] rates = new int[]{1, 2, 3, 4, 5};
new SWListInv<>(player, Message.parse("TUTORIAL_RATE_TITLE", player), Arrays.stream(rates).mapToObj(rate -> new SWListInv.SWListEntry<>(new SWItem("NETHER_STAR", Message.parse("TUTORIAL_RATE", player, rate)), rate)).collect(Collectors.toList()), (click, rate) -> {
tutorial.rate(user, rate);
SWInventory.close(player);
}).open();
}
private void create(ProxiedPlayer player, String name, String item) {
Subserver subserver = Subserver.getSubserver(player);
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
File tempWorld = new File(ServerStarter.TEMP_WORLD_PATH, ServerStarter.serverToWorldName(ServerStarter.bauServerName(user)));
if(subserver == null || !subserver.hasStarted() || subserver.getType() != Servertype.BAUSERVER || !tempWorld.exists()) {
Message.send("TUTORIAL_CREATE_MISSING", player);
return;
}
subserver.execute("save-all");
ProxyServer.getInstance().getScheduler().schedule(BungeeCore.get(), () -> {
Tutorial tutorial = Tutorial.create(user, name, item);
File tutorialWorld = tutorial.world();
if (tutorialWorld.exists())
SubserverSystem.deleteFolder(Node.local, tutorialWorld.getPath());
ServerStarter.copyWorld(Node.local, tempWorld.getPath(), tutorialWorld.getPath());
Message.send("TUTORIAL_CREATED", player);
}, 1, TimeUnit.SECONDS);
}
}

Datei anzeigen

@ -1,59 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.IgnoreSystem;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public class UnIgnoreCommand extends BasicCommand {
public UnIgnoreCommand() {
super("unignore", null);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(args.length < 1) {
Message.send("UNIGNORE_USAGE", sender);
return;
}
if (!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer p = (ProxiedPlayer) sender;
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
SteamwarUser target = SteamwarUser.get(args[0]);
if(target == null){
Message.send("UNIGNORE_NOT_PLAYER", p);
return;
}else if(!IgnoreSystem.isIgnored(user, target)){
Message.send("UNIGNORE_NOT_IGNORED", p);
return;
}
IgnoreSystem.unIgnore(user, target);
Message.send("UNIGNORE_UNIGNORED", p, target.getUserName());
}
}

Datei anzeigen

@ -1,68 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.bot.AuthManager;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.dv8tion.jda.api.entities.Member;
import net.md_5.bungee.api.CommandSender;
import java.util.Base64;
public class VerifyCommand extends BasicCommand {
public VerifyCommand() {
super("verify", "");
}
@Override
public void execute(CommandSender sender, String[] strings) {
if(strings.length < 1) {
Message.send("VERIFY_USAGE", sender);
return;
}
byte[] bytes;
try {
bytes = Base64.getDecoder().decode(strings[0]);
} catch (IllegalArgumentException e) {
Message.send("VERIFY_INVALID", sender);
return;
}
if(bytes.length != 16) {
Message.send("VERIFY_INVALID", sender);
return;
}
if(bytes[0] == 'D' && bytes[1] == 'C') {
Member member = AuthManager.connectAuth(SteamwarUser.get(sender.getName()), strings[0]);
if(member != null) {
BungeeCore.log(sender.getName() + " Verified with Discorduser: " + member.getIdLong());
Message.send("VERIFY_SUCCESS", sender, member.getUser().getAsTag());
} else {
Message.send("VERIFY_INVALID", sender);
}
} else {
Message.send("VERIFY_INVALID", sender);
}
}
}

Datei anzeigen

@ -1,95 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SWException;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class WebregisterCommand extends BasicCommand {
public WebregisterCommand() {
super("webregister", null, "web", "webpw");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length != 1){
Message.send("WEB_USAGE", player);
return;
}
ProcessBuilder pb = new ProcessBuilder("php", "/var/www/register.php", player.getName(), args[0]);
pb.redirectErrorStream(true);
try {
Process regProcess = pb.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(regProcess.getInputStream()));
String errorLine;
boolean error = false;
while((errorLine = reader.readLine()) != null){
switch(errorLine){
case "username_exists":
Message.send("WEB_ALREADY", player);
break;
case "email_exists":
Message.send("WEB_ALREADY_EMAIL", player);
// SWException.log("Bungee", "Duplicate E-Mail", player.getName() + " " + args[0]);
break;
case "invalid_email":
Message.send("WEB_NOT_EMAIL", player);
break;
case "email_updated":
Message.send("WEB_EMAIL_REFRESH", player);
break;
default:
Message.send("WEB_INTERNAL_ERROR", player);
SWException.log("Bungee", "Unknown Wordpress User Creation Error", errorLine);
}
error = true;
}
if(error)
return;
Message.send("WEB_EMAIL_SEND", player);
} catch (IOException e) {
Message.send("WEB_INTERNAL_ERROR", player);
throw new SecurityException("Could not create webaccount", e);
}
}
public static void changeUsername(String oldUsername, String newUsername){
ProcessBuilder pb = new ProcessBuilder("php", "/var/www/changename.php", oldUsername, newUsername);
try {
pb.start();
} catch (IOException e) {
throw new SecurityException("Could not change username", e);
}
}
}

Datei anzeigen

@ -1,113 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class WhoisCommand extends BasicCommand {
public WhoisCommand(){
super("whois", "bungeecore.teamchat");
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length == 0){
Message.send("WHOIS_USAGE", player);
return;
}
SteamwarUser user = SteamwarUser.get(args[0]);
if(user == null){
try {
int id = Integer.parseInt(args[0]);
user = SteamwarUser.get(id);
}catch (NumberFormatException ignored) {}
}
if (user == null) {
try {
long id = Long.parseLong(args[0]);
user = SteamwarUser.get(id);
} catch (NumberFormatException ignored) {
// Ignored
}
}
if(user == null) {
Message.send("UNKNOWN_PLAYER", player);
return;
}
boolean all = false;
if(args.length > 1 && args[1].startsWith("-")) {
all = args[1].contains("a");
}
sendUserinfo(player, user, all);
}
private static void sendUserinfo(ProxiedPlayer player, SteamwarUser user, boolean all) {
Message.send("WHOIS_USERNAME", player, user.getUserName());
Message.send("WHOIS_UUID", player, Message.parse("WHOIS_UUID_HOVER", player), new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, user.getUuid().toString()), user.getUuid().toString());
Message.send("WHOIS_ID", player, user.getId());
if (user.getDiscordId() != null) {
Message.send("WHOIS_DISCORD_ID", player, user.getDiscordId());
}
Timestamp firstJoin = user.getFirstjoin();
if(firstJoin == null)
Message.send("WHOIS_JOINED_FIRST", player, "0000-00-00 00:00:00");
else
Message.send("WHOIS_JOINED_FIRST", player, firstJoin.toString());
Message.send("WHOIS_HOURS_PLAYED", player, new DecimalFormat("###.##").format(user.getOnlinetime() / (double) 3600));
Team team = Team.get(user.getTeam());
Message.send("WHOIS_TEAM", player, Message.parse("WHOIS_TEAM_HOVER", player, team.getTeamName()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + team.getTeamKuerzel()), team.getTeamColor(), team.getTeamKuerzel(), team.getTeamName());
Message.send("WHOIS_PUNISHMENTS", player);
List<Punishment> punishmentList = Punishment.getAllPunishmentsOfPlayer(user.getId());
Set<Punishment.PunishmentType> found = new HashSet<>();
boolean isPunished = false;
for (Punishment punishment : punishmentList) {
if (!all && !punishment.getType().isMulti() && !found.add(punishment.getType())) {
continue;
}
Message.sendPrefixless("WHOIS_PUNISHMENT", player, SteamwarUser.get(punishment.getPunisher()).getUserName(), punishment.getType().name(), punishment.getBantime(punishment.getStartTime(), false), punishment.getBantime(punishment.getEndTime(), punishment.isPerma()), punishment.getReason());
isPunished = true;
}
if (!isPunished) {
Message.send(all ? "WHOIS_NO_ALL_PUNISHMENT" : "WHOIS_NO_PUNISHMENT", player);
}
}
}

Datei anzeigen

@ -1,47 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.connection.Server;
import java.io.ByteArrayOutputStream;
public abstract class BungeePacket {
public void send(Server server) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeByte(getId());
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
writeVars(out);
out.writeUTF(outputStream.toByteArray().toString());
server.sendData("sw:bridge", out.toByteArray());
}
public void send(ProxiedPlayer player) {
send(player.getServer());
}
public abstract int getId();
public abstract void writeVars(ByteArrayDataOutput byteArrayDataOutput);
}

Datei anzeigen

@ -1,43 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms;
public class PacketIdManager {
//0x0(X) Standalone Packets
public static final byte PING_PACKET = 0x01;
public static final byte TABLIST_NAME = 0x02;
public static final byte PREPARE_SCHEM = 0x03;
public static final byte BAUMEMBER_UPDATE = 0x04;
public static final byte EXECUTE_COMMAND = 0x05;
public static final byte LOCALE_INVALIDATION = 0x06;
//0x1(X) Bungee Inventory
public static final byte INVENTORY_PACKET = 0x10;
public static final byte INVENTORY_CALLBACK_PACKET = 0x11;
public static final byte INVENTORY_CLOSE_PACKET = 0x12;
//0x2(X) Server Information System
public static final byte I_AM_A_LOBBY = 0x20;
public static final byte FIGHT_INFO = 0x21;
public static final byte FIGHT_ENDS = 0x22;
public static final byte STARTING_SERVER = 0x23;
}

Datei anzeigen

@ -1,66 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.comms.handlers.*;
import de.steamwar.bungeecore.listeners.BasicListener;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.Server;
import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.event.EventHandler;
import java.util.HashMap;
import java.util.Map;
public class SpigotReceiver extends BasicListener {
private static final Map<Byte, SpigotHandler> handlerMap = new HashMap<>();
@EventHandler
public void onPluginMessage(PluginMessageEvent event) {
if(!event.getTag().equalsIgnoreCase("sw:bridge"))
return;
event.setCancelled(true);
if(!(event.getSender() instanceof Server))
return;
ByteArrayDataInput in = ByteStreams.newDataInput(event.getData());
Byte handler = in.readByte();
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> handlerMap.get(handler).handle(in, ((Server) event.getSender()).getInfo()));
}
public static void registerHandler(Byte id, SpigotHandler handler) {
handlerMap.put(id, handler);
}
static {
registerHandler(PacketIdManager.INVENTORY_CALLBACK_PACKET, new InventoryCallbackHandler());
registerHandler(PacketIdManager.TABLIST_NAME, (in, info) -> {});
registerHandler(PacketIdManager.PREPARE_SCHEM, new PrepareSchemHandler());
registerHandler(PacketIdManager.I_AM_A_LOBBY, new ImALobbyHandler());
registerHandler(PacketIdManager.FIGHT_INFO, new FightInfoHandler());
registerHandler(PacketIdManager.EXECUTE_COMMAND, new ExecuteCommandHandler());
registerHandler(PacketIdManager.FIGHT_ENDS, new FightEndsHandler());
}
}

Datei anzeigen

@ -1,159 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.handlers;
import com.google.common.io.ByteArrayDataInput;
import de.steamwar.bungeecore.ArenaMode;
import de.steamwar.bungeecore.comms.SpigotHandler;
import de.steamwar.bungeecore.comms.packets.FightEndsPacket;
import de.steamwar.bungeecore.sql.*;
import lombok.RequiredArgsConstructor;
import net.md_5.bungee.api.config.ServerInfo;
import java.util.*;
import java.util.stream.Collectors;
public class FightEndsHandler implements SpigotHandler {
private Map<String, LinkedList<Game>> gameModeGames = new HashMap<>();
private int K = 20;
private long defaultFightRange = 1000 /* Milliseconds */ * 60 /* Seconds */ * 15L /* Minutes */;
private Map<String, Long> fightRanges = new HashMap<>();
private long defaultFightCount = 1;
private Map<String, Long> fightCounts = new HashMap<>();
{
fightRanges.put("miniwargear", 1000 /* Milliseconds */ * 60 /* Seconds */ * 30L /* Minutes */);
fightCounts.put("miniwargear", 3L);
}
@Override
public void handle(ByteArrayDataInput in, ServerInfo info) {
FightEndsPacket fightEndsPacket = new FightEndsPacket(in);
if (!ArenaMode.getBySchemType(SchematicType.fromDB(fightEndsPacket.getGameMode())).isRanked()) {
return;
}
int bluePlayerSize = fightEndsPacket.getBluePlayers().size();
int redPlayerSize = fightEndsPacket.getRedPlayers().size();
double playerRatio = bluePlayerSize > redPlayerSize ? (double) redPlayerSize / bluePlayerSize : (double) bluePlayerSize / redPlayerSize;
if (playerRatio < 0.6) {
return;
}
boolean bluePublic = SchematicNode.getSchematicNode(fightEndsPacket.getBlueSchem()).getOwner() == 0;
boolean redPublic = SchematicNode.getSchematicNode(fightEndsPacket.getRedSchem()).getOwner() == 0;
if (bluePublic ^ redPublic) {
return;
}
double blueResult;
if (fightEndsPacket.getWin() == 0) {
blueResult = 0.5;
} else if (fightEndsPacket.getWin() == 1) {
blueResult = 1;
} else {
blueResult = 0;
}
// Die nächsten Zeilen filtern ein Fight innerhalb eines Teams nicht gewertet wird, bzw auch wenn nur Teile beider Teams im
// gleichen Team sind dieser ungewertet ist.
Set<Integer> teamsIds = fightEndsPacket.getBluePlayers().stream().map(SteamwarUser::get).map(SteamwarUser::getTeam).collect(Collectors.toSet());
for (int redPlayer : fightEndsPacket.getRedPlayers()) {
if (teamsIds.contains(SteamwarUser.get(redPlayer).getTeam())) {
return;
}
}
try {
if (teamComboExistedAlready(fightEndsPacket.getBluePlayers(), fightEndsPacket.getRedPlayers(), fightEndsPacket.getGameMode())) {
return;
}
} finally {
gameModeGames.computeIfAbsent(fightEndsPacket.getGameMode(), s -> new LinkedList<>()).add(new Game(fightEndsPacket.getBluePlayers(), fightEndsPacket.getRedPlayers()));
}
int blueSchemElo = SchemElo.getElo(fightEndsPacket.getBlueSchem());
int redSchemElo = SchemElo.getElo(fightEndsPacket.getRedSchem());
int blueTeamElo = fightEndsPacket.getBluePlayers().stream().mapToInt(player -> UserElo.getEloOrDefault(player, fightEndsPacket.getGameMode())).sum();
int redTeamElo = fightEndsPacket.getRedPlayers().stream().mapToInt(player -> UserElo.getEloOrDefault(player, fightEndsPacket.getGameMode())).sum();
calculateEloOfTeam(fightEndsPacket.getBlueSchem(), blueSchemElo, redSchemElo, blueTeamElo, redTeamElo, blueResult, fightEndsPacket.getBluePlayers(), fightEndsPacket.getGameMode(), bluePublic || redPublic);
calculateEloOfTeam(fightEndsPacket.getRedSchem(), redSchemElo, blueSchemElo, redTeamElo, blueTeamElo, 1 - blueResult, fightEndsPacket.getRedPlayers(), fightEndsPacket.getGameMode(), bluePublic || redPublic);
}
private void calculateEloOfTeam(int schemId, int eloSchemOwn, int eloSchemEnemy, int eloTeamOwn, int eloTeamEnemy, double result, List<Integer> players, String gameMode, boolean noPlayerRank) {
double winSchemExpectation = calsWinExpectation(eloSchemOwn, eloSchemEnemy);
SchemElo.setElo(schemId, (int) Math.round(eloSchemOwn + K * (result - winSchemExpectation)));
if (noPlayerRank) return;
double winTeamExpectation = calsWinExpectation(eloTeamOwn, eloTeamEnemy);
for (int player : players) {
int playerElo = UserElo.getEloOrDefault(player, gameMode);
int fights = UserElo.getFightsOfSeason(player, gameMode);
UserElo.setElo(player, gameMode, (int) Math.round(playerElo + getK(fights) * (result - winTeamExpectation)));
}
}
private double calsWinExpectation(int eloOwn, int eloEnemy) {
return 1 / (1 + Math.pow(10, (eloEnemy - eloOwn) / 600f));
}
private double getK(int fights) {
return K * Math.max(1.3 - (fights / 200.0), 0.8);
}
private boolean teamComboExistedAlready(List<Integer> bluePlayers, List<Integer> redPlayers, String gameMode) {
if (!gameModeGames.containsKey(gameMode)) {
return false;
}
LinkedList<Game> games = gameModeGames.get(gameMode);
long lifetime = fightRanges.getOrDefault(gameMode, defaultFightRange);
while (!games.isEmpty()) {
Game game = games.getFirst();
if (game.livedMillis() > lifetime) {
games.removeFirst();
} else {
break;
}
}
return games.stream().filter(game -> game.isSame(bluePlayers, redPlayers)).count() > fightCounts.getOrDefault(gameMode, defaultFightCount);
}
@RequiredArgsConstructor
private static class Game {
private long time = System.currentTimeMillis();
private final List<Integer> bluePlayers;
private final List<Integer> redPlayers;
public long livedMillis() {
return System.currentTimeMillis() - time;
}
public boolean isSame(List<Integer> bluePlayers, List<Integer> redPlayers) {
return bluePlayers.containsAll(this.bluePlayers) && redPlayers.containsAll(this.redPlayers);
}
}
}

Datei anzeigen

@ -1,64 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.handlers;
import com.google.common.io.ByteArrayDataInput;
import de.steamwar.bungeecore.comms.SpigotHandler;
import de.steamwar.bungeecore.comms.packets.FightInfoPacket;
import de.steamwar.bungeecore.listeners.TablistManager;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
public class FightInfoHandler implements SpigotHandler {
private static final Set<ServerInfo> lobbys = new HashSet<>();
public static void addLobby(ServerInfo lobby) {
lobbys.add(lobby);
}
public static boolean onLobby(ProxiedPlayer player) {
return lobbys.contains(player.getServer().getInfo());
}
@Override
public void handle(ByteArrayDataInput in, ServerInfo info) {
FightInfoPacket packet = new FightInfoPacket(in);
packet.setServerName(info.getName());
TablistManager.newFightInfo(info, packet);
Iterator<ServerInfo> lobbyIt = lobbys.iterator();
while(lobbyIt.hasNext()) {
ServerInfo lobby = lobbyIt.next();
Iterator<ProxiedPlayer> it = lobby.getPlayers().iterator();
if(!it.hasNext()){
lobbyIt.remove();
continue;
}
packet.send(it.next());
}
}
}

Datei anzeigen

@ -1,36 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets;
import com.google.common.io.ByteArrayDataOutput;
import de.steamwar.bungeecore.comms.BungeePacket;
import de.steamwar.bungeecore.comms.PacketIdManager;
public class BaumemberUpdatePacket extends BungeePacket {
@Override
public int getId() {
return PacketIdManager.BAUMEMBER_UPDATE;
}
@Override
public void writeVars(ByteArrayDataOutput byteArrayDataOutput) {
// empty
}
}

Datei anzeigen

@ -1,80 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput;
import de.steamwar.bungeecore.comms.BungeePacket;
import de.steamwar.bungeecore.comms.PacketIdManager;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
@AllArgsConstructor
@Getter
public class FightEndsPacket extends BungeePacket {
private byte win;
private int blueSchem;
private int redSchem;
private List<Integer> bluePlayers;
private List<Integer> redPlayers;
private String gameMode;
public FightEndsPacket(ByteArrayDataInput byteArrayDataInput) {
win = byteArrayDataInput.readByte();
blueSchem = byteArrayDataInput.readInt();
redSchem = byteArrayDataInput.readInt();
int blueSize = byteArrayDataInput.readInt();
bluePlayers = new ArrayList<>(blueSize);
for (int i = 0; i < blueSize; i++) {
bluePlayers.add(byteArrayDataInput.readInt());
}
int redSize = byteArrayDataInput.readInt();
redPlayers = new ArrayList<>(redSize);
for (int i = 0; i < redSize; i++) {
redPlayers.add(byteArrayDataInput.readInt());
}
gameMode = byteArrayDataInput.readUTF();
}
@Override
public int getId() {
return PacketIdManager.FIGHT_ENDS;
}
@Override
public void writeVars(ByteArrayDataOutput byteArrayDataOutput) {
byteArrayDataOutput.writeByte(win);
byteArrayDataOutput.writeInt(blueSchem);
byteArrayDataOutput.writeInt(redSchem);
byteArrayDataOutput.writeInt(bluePlayers.size());
for (int i : bluePlayers) {
byteArrayDataOutput.writeInt(i);
}
byteArrayDataOutput.writeInt(redPlayers.size());
for (int i : redPlayers) {
byteArrayDataOutput.writeInt(i);
}
byteArrayDataOutput.writeUTF(gameMode);
}
}

Datei anzeigen

@ -1,183 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput;
import de.steamwar.bungeecore.comms.BungeePacket;
import de.steamwar.bungeecore.comms.PacketIdManager;
import java.util.ArrayList;
import java.util.List;
public class FightInfoPacket extends BungeePacket {
private String serverName; // Name of the Server
private final String gameMode; // GameMode aka Schematictype (if known, else "")
private final String arena; // Name of the arena
private final String blueName; // Name of the blue team, expected to begin with "§a" colorcode
private final String redName; // Name of the red team, expected to begin with "§a" colorcode
private final String fightState; // Fight state (technical term) (if known, else "")
private final int countdown; // Countdown state in seconds (if known, else 0)
private final int blueLeader; // SWUserID of the blue team leader (if known, else 0)
private final int redLeader; // SWUserID of the red team leader (if known, else 0)
private final int blueSchem; // Blue SchemID (if known, else 0)
private final int redSchem; // Red SchemID (if known, else 0)
private final List<Integer> bluePlayers; // List of Blue SWUserIDs
private final List<Integer> redPlayers; // List of Red SWUserIDs
private final List<Integer> spectators; // List of Spectator SWUserIDs
public FightInfoPacket(String serverName, String gameMode, String arena, String blueName, String redName, String fightState, int countdown, int blueLeader, int redLeader, int blueSchem, int redSchem, List<Integer> bluePlayers, List<Integer> redPlayers, List<Integer> spectators) {
this.serverName = serverName;
this.gameMode = gameMode;
this.arena = arena;
this.blueName = blueName;
this.redName = redName;
this.fightState = fightState;
this.countdown = countdown;
this.blueLeader = blueLeader;
this.redLeader = redLeader;
this.blueSchem = blueSchem;
this.redSchem = redSchem;
this.bluePlayers = bluePlayers;
this.redPlayers = redPlayers;
this.spectators = spectators;
}
public FightInfoPacket(ByteArrayDataInput in) {
this.serverName = in.readUTF();
this.gameMode = in.readUTF();
this.arena = in.readUTF();
this.blueName = in.readUTF();
this.redName = in.readUTF();
this.fightState = in.readUTF();
this.countdown = in.readInt();
this.blueLeader = in.readInt();
this.redLeader = in.readInt();
this.blueSchem = in.readInt();
this.redSchem = in.readInt();
this.bluePlayers = readPlayerList(in);
this.redPlayers = readPlayerList(in);
this.spectators = readPlayerList(in);
}
@Override
public int getId() {
return PacketIdManager.FIGHT_INFO;
}
@Override
public void writeVars(ByteArrayDataOutput out) {
out.writeUTF(serverName);
out.writeUTF(gameMode);
out.writeUTF(arena);
out.writeUTF(blueName);
out.writeUTF(redName);
out.writeUTF(fightState);
out.writeInt(countdown);
out.writeInt(blueLeader);
out.writeInt(redLeader);
out.writeInt(blueSchem);
out.writeInt(redSchem);
writePlayerList(out, bluePlayers);
writePlayerList(out, redPlayers);
writePlayerList(out, spectators);
}
public String getServerName() {
return serverName;
}
public void setServerName(String serverName) {
this.serverName = serverName;
}
public String getGameMode() {
return gameMode;
}
public String getArena() {
return arena;
}
public String getBlueName() {
return blueName;
}
public String getRedName() {
return redName;
}
public String getFightState() {
return fightState;
}
public int getCountdown() {
return countdown;
}
public int getBlueLeader() {
return blueLeader;
}
public int getRedLeader() {
return redLeader;
}
public int getBlueSchem() {
return blueSchem;
}
public int getRedSchem() {
return redSchem;
}
public List<Integer> getBluePlayers() {
return bluePlayers;
}
public List<Integer> getRedPlayers() {
return redPlayers;
}
public List<Integer> getSpectators() {
return spectators;
}
public int playerSize(){
return bluePlayers.size() + redPlayers.size() + spectators.size();
}
private static List<Integer> readPlayerList(ByteArrayDataInput in) {
int length = in.readInt();
List<Integer> players = new ArrayList<>(length);
for(int i = 0; i < length; i++) {
players.add(in.readInt());
}
return players;
}
private void writePlayerList(ByteArrayDataOutput out, List<Integer> players) {
out.writeInt(players.size());
for(Integer player : players) {
out.writeInt(player);
}
}
}

Datei anzeigen

@ -1,80 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets;
import com.google.common.io.ByteArrayDataOutput;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import de.steamwar.bungeecore.comms.PacketIdManager;
import de.steamwar.bungeecore.inventory.SWInventory;
import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.comms.BungeePacket;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.HashMap;
import java.util.Map;
public class InventoryPacket extends BungeePacket {
final String title;
final int player;
final int size;
final Map<Integer, SWItem> items;
public InventoryPacket(int size, String title, ProxiedPlayer player) {
items = new HashMap<>();
this.title = title;
this.size = size;
this.player = SteamwarUser.get(player).getId();
}
public InventoryPacket(SWInventory inventory) {
items = inventory.getItems();
this.title = inventory.getTitle();
this.size = inventory.getSize();
this.player = SteamwarUser.get(inventory.getPlayer()).getId();
}
@Override
public int getId() {
return PacketIdManager.INVENTORY_PACKET;
}
@Override
public void writeVars(ByteArrayDataOutput byteArrayDataOutput) {
JsonObject object = new JsonObject();
object.addProperty("id", player);
object.addProperty("title", title);
object.addProperty("size", size);
object.addProperty("itemcount", items.size());
JsonArray array = new JsonArray();
for (int i = 0; i < size; i++) {
if(items.get(i) != null)
array.add(items.get(i).writeToString(i));
}
object.add("items", array);
byteArrayDataOutput.writeUTF(object.toString());
}
public void setItem(int index, SWItem item) {
items.put(index, item);
}
}

Datei anzeigen

@ -1,43 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.comms.packets;
import com.google.common.io.ByteArrayDataOutput;
import de.steamwar.bungeecore.comms.BungeePacket;
import de.steamwar.bungeecore.comms.PacketIdManager;
public class PingPacket extends BungeePacket {
final int id;
@Override
public int getId() {
return PacketIdManager.PING_PACKET;
}
public PingPacket(int id) {
this.id = id;
}
@Override
public void writeVars(ByteArrayDataOutput byteArrayDataOutput) {
byteArrayDataOutput.writeInt(id);
}
}

Datei anzeigen

@ -1,25 +0,0 @@
package de.steamwar.bungeecore.comms.packets;
import com.google.common.io.ByteArrayDataOutput;
import de.steamwar.bungeecore.comms.BungeePacket;
import de.steamwar.bungeecore.comms.PacketIdManager;
import de.steamwar.bungeecore.sql.SteamwarUser;
public class StartingServerPacket extends BungeePacket {
private final int user;
public StartingServerPacket(SteamwarUser user) {
this.user = user.getId();
}
@Override
public int getId() {
return PacketIdManager.STARTING_SERVER;
}
@Override
public void writeVars(ByteArrayDataOutput out) {
out.writeInt(user);
}
}

Datei anzeigen

@ -1,150 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.inventory;
import de.steamwar.bungeecore.comms.handlers.InventoryCallbackHandler;
import de.steamwar.bungeecore.comms.packets.CloseInventoryPacket;
import de.steamwar.bungeecore.comms.packets.InventoryPacket;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
public class SWInventory {
private final Map<Integer, SWItem> itemMap;
private InvCallback close;
private ProxiedPlayer player;
private int size;
private String title;
private boolean next;
private final AtomicBoolean processingClick = new AtomicBoolean();
public SWInventory(ProxiedPlayer proxiedPlayer, int size, String title) {
itemMap = new HashMap<>();
InventoryCallbackHandler.inventoryHashMap.put(SteamwarUser.get(proxiedPlayer).getId(), this);
this.player = proxiedPlayer;
this.size = size;
this.title = title;
next = false;
}
public void addItem(int pos, SWItem item, InvCallback callback) {
addItem(pos, item, new ArrayList<>(), callback);
}
public void addItem(int pos, SWItem item, List<String> lore, InvCallback callback) {
item.setCallback(callback);
item.setLore(lore);
itemMap.put(pos, item);
}
public void addItem(int pos, SWItem item) {
itemMap.put(pos, item);
}
public void addItem(int pos, SWItem item, String name, InvCallback callback) {
item.setName(name);
item.setCallback(callback);
itemMap.put(pos, item);
}
public void removeItem(int position) {
itemMap.remove(position);
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public void setTitle(String title) {
this.title = title;
}
public void setCallback(int pos, InvCallback callback) {
itemMap.get(pos).setCallback(callback);
}
public void setNext(boolean next) {
this.next = next;
}
public boolean isNext() {
return next;
}
public Map<Integer, SWItem> getItems() {
return itemMap;
}
public void handleCallback(InvCallback.ClickType type, int pos) {
if(processingClick.compareAndSet(false, true)) {
itemMap.get(pos).getCallback().clicked(type);
processingClick.set(false);
}
}
public void handleClose() {
if(processingClick.compareAndSet(false, true)) {
InventoryCallbackHandler.inventoryHashMap.remove(SteamwarUser.get(player).getId(), this);
if(close != null)
close.clicked(null);
processingClick.set(false);
}
}
public void open() {
InventoryPacket inv = new InventoryPacket(this);
inv.send(player);
}
public void close() {
close(player);
}
public static void close(ProxiedPlayer player) {
new CloseInventoryPacket(SteamwarUser.get(player).getId()).send(player);
}
public void setClose(InvCallback close) {
this.close = close;
}
public ProxiedPlayer getPlayer() {
return player;
}
public void setPlayer(ProxiedPlayer player) {
this.player = player;
}
public String getTitle() {
return title;
}
}

Datei anzeigen

@ -1,173 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.inventory;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.List;
public class SWItem {
private String material, title, skullOwner;
private boolean enchanted, hideAttributes;
private List<String> lore;
private InvCallback callback;
private int color;
public SWItem(String material, String title) {
this.material = material.toUpperCase();
lore = new ArrayList<>();
this.title = title;
color = 0;
}
public SWItem(String title, int color) {
this.material = "DYE";
lore = new ArrayList<>();
this.title = title;
this.color = color;
}
public static SWItem getSkull(String skullOwner) {
SWItem item = new SWItem("SKULL", skullOwner);
item.setSkullOwner(skullOwner);
return item;
}
public void setCallback(InvCallback callback) {
this.callback = callback;
}
public void setColor(int color) {
this.color = color;
}
public InvCallback getCallback() {
return callback;
}
public String getMaterial() {
return material;
}
public void setMaterial(String material) {
this.material = material.toUpperCase();
}
public String getSkullOwner() {
return skullOwner;
}
public void setSkullOwner(String skullOwner) {
this.skullOwner = skullOwner;
}
public boolean isEnchanted() {
return enchanted;
}
public void setEnchanted(boolean enchanted) {
this.enchanted = enchanted;
}
public boolean isHideAttributes() {
return hideAttributes;
}
public void setHideAttributes(boolean hideAttributes) {
this.hideAttributes = hideAttributes;
}
public SWItem setName(String name) {
title = name;
return this;
}
public String getTitle() {
return title;
}
public void addLore(String lore) {
this.lore.add(lore);
}
public JsonObject writeToString(int position) {
JsonObject object = new JsonObject();
object.addProperty("material", material);
object.addProperty("position", position);
object.addProperty("title", title);
if(skullOwner != null)
object.addProperty("skullOwner", skullOwner);
if(enchanted)
object.addProperty("enchanted", true);
if(hideAttributes)
object.addProperty("hideAttributes", true);
if(color != 0)
object.addProperty("color", color);
if(lore != null) {
JsonArray array = new JsonArray();
for (String lores:
lore) {
array.add(lores);
}
object.add("lore", array);
}
return object;
}
@Override
public boolean equals(Object o) {
if(!(o instanceof SWItem))
return false;
SWItem item = (SWItem) o;
if(item.enchanted != enchanted)
return false;
if(item.hideAttributes != hideAttributes)
return false;
if(!item.material.equals(material))
return false;
if(!item.lore.equals(lore))
return false;
if(!item.skullOwner.equals(skullOwner))
return false;
return true;
}
public void setLore(List<String> lore) {
this.lore = lore;
}
public SWItem clone() {
SWItem item;
if(color != 0) {
item = new SWItem(title, color);
}else {
item = new SWItem(material, title);
}
item.setLore(lore);
item.setCallback(callback);
item.setEnchanted(enchanted);
item.setHideAttributes(hideAttributes);
return item;
}
}

Datei anzeigen

@ -1,121 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.inventory;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.*;
public class SWListInv<T> extends SWInventory {
private ListCallback<T> callback;
private List<SWListEntry<T>> elements;
private int page;
public SWListInv(ProxiedPlayer p, String t, List<SWListEntry<T>> l, ListCallback<T> c){
super(p, (l.size()>45) ? 54 : (l.size() + 9-l.size()%9), t);
callback = c;
elements = l;
page = 0;
}
@Override
public void open(){
if(elements.size() > 54){
if(page != 0)
addItem(45, new SWItem("§eSeite zurück", 10), (InvCallback.ClickType click) -> {
page--;
open();
});
else
addItem(45, new SWItem("§7Seite zurück", 8), (InvCallback.ClickType click) -> {});
if(page < elements.size()/45)
addItem(53, new SWItem("§eSeite vor", 10), "§eSeite vor", (InvCallback.ClickType click) -> {
page++;
open();
});
else
addItem(53, new SWItem("§eSeite vor", 8), (InvCallback.ClickType click) -> {});
}
int ipageLimit = elements.size() - page*45;
if(ipageLimit > 45 && elements.size() > 54){
ipageLimit = 45;
}
int i = page*45;
for(int ipage=0; ipage < ipageLimit; ipage++ ){
SWItem e = elements.get(i).getItem();
final int pos = i;
addItem(ipage, e);
setCallback(ipage, (InvCallback.ClickType click) -> callback.clicked(click, elements.get(pos).getObject()));
i++;
}
super.open();
}
public void setCallback(ListCallback<T> c){
callback = c;
}
public interface ListCallback<T>{
void clicked(InvCallback.ClickType click, T element);
}
public static List<SWListEntry<UUID>> createPlayerList(UUID without){
List<SWListEntry<UUID>> onlinePlayers = new ArrayList<>();
for(ProxiedPlayer player : BungeeCord.getInstance().getPlayer(without).getServer().getInfo().getPlayers()){
if(without != null && player.getUniqueId().equals(without))
continue;
onlinePlayers.add(new SWListEntry<>(SWItem.getSkull(player.getName()), player.getUniqueId()));
}
return onlinePlayers;
}
public static List<SWListEntry<UUID>> createGlobalPlayerList(UUID without){
List<SWListEntry<UUID>> onlinePlayers = new ArrayList<>();
for(ProxiedPlayer player : BungeeCord.getInstance().getPlayers()){
if(without != null && player.getUniqueId().equals(without))
continue;
onlinePlayers.add(new SWListEntry<>(SWItem.getSkull(player.getName()), player.getUniqueId()));
}
return onlinePlayers;
}
public static class SWListEntry<T>{
final SWItem item;
final T object;
public SWListEntry(SWItem item, T object){
this.item = item;
this.object = object;
}
public SWItem getItem(){
return item;
}
public T getObject(){
return object;
}
}
}

Datei anzeigen

@ -1,51 +0,0 @@
package de.steamwar.bungeecore.inventory;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.List;
import java.util.function.Function;
public class SWStreamInv<T> extends SWInventory {
private final SWListInv.ListCallback<T> callback;
private final Function<Integer, List<SWListInv.SWListEntry<T>>> constructor;
private int page;
public SWStreamInv(ProxiedPlayer proxiedPlayer, String title, SWListInv.ListCallback<T> callback, Function<Integer, List<SWListInv.SWListEntry<T>>> constructor) {
super(proxiedPlayer, 54, title);
this.callback = callback;
this.constructor = constructor;
page = 0;
}
@Override
public void open(){
List<SWListInv.SWListEntry<T>> entries = constructor.apply(page);
if(page != 0)
addItem(45, new SWItem("§eSeite zurück", 10), (InvCallback.ClickType click) -> {
page--;
open();
});
else
addItem(45, new SWItem("§7Seite zurück", 8), (InvCallback.ClickType click) -> {});
if(entries.size() == 45)
addItem(53, new SWItem("§eSeite vor", 10), (InvCallback.ClickType click) -> {
page++;
open();
});
else
addItem(53, new SWItem("§7Seite vor", 8), (InvCallback.ClickType click) -> {});
for(int i = 0; i < entries.size(); i++) {
SWListInv.SWListEntry<T> item = entries.get(i);
addItem(i, item.getItem());
setCallback(i, (InvCallback.ClickType click) -> {
close();
callback.clicked(click, item.getObject());
});
}
super.open();
}
}

Datei anzeigen

@ -1,101 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.listeners.mods.Forge;
import de.steamwar.bungeecore.sql.BannedUserIPs;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.LoginEvent;
import net.md_5.bungee.event.EventHandler;
import java.sql.Timestamp;
import java.time.format.DateTimeFormatter;
import java.util.List;
public class BanListener extends BasicListener {
@EventHandler
public void onLogin(LoginEvent event) {
event.registerIntent(BungeeCore.get());
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
SteamwarUser user = SteamwarUser.getOrCreate(event.getConnection());
if (user.isPunished(Punishment.PunishmentType.Ban)) {
user.updateBanIP(event.getConnection().getAddress().getAddress().getHostAddress());
event.setCancelled(true);
ChatSender.of(event).system(user.punishmentMessage(Punishment.PunishmentType.Ban));
return;
}
List<BannedUserIPs> ips = BannedUserIPs.get(event.getConnection().getAddress().getAddress().getHostAddress());
if(!ips.isEmpty()){
Timestamp highestBan = ips.get(0).getTimestamp();
boolean perma = false;
for(BannedUserIPs banned : ips) {
SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID());
if (bannedUser.isPunished(Punishment.PunishmentType.Ban)) {
Punishment ban = bannedUser.getPunishment(Punishment.PunishmentType.Ban);
if(ban.isPerma()) {
perma = true;
break;
}
if(ban.getEndTime().after(highestBan))
highestBan = ban.getEndTime();
}
}
ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ban " + user.getUserName() + " "
+ (perma?"perma":highestBan.toLocalDateTime().format(DateTimeFormatter.ofPattern("dd.MM.yyyy_HH:mm")))
+ " Bannumgehung");
for (ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){
if ((target.hasPermission("bungeecore.teamchat"))
&& (target.getChatMode() == ProxiedPlayer.ChatMode.COMMANDS_ONLY
|| target.getChatMode() == ProxiedPlayer.ChatMode.SHOWN)){
StringBuilder potentialBan = new StringBuilder();
potentialBan.append(Message.parsePrefixed("BAN_AVOIDING_ALERT", target, user.getUserName()));
for(BannedUserIPs banned : ips) {
SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID());
potentialBan.append(Message.parse("BAN_AVOIDING_LIST", target, bannedUser.getUserName(),
banned.getTimestamp().toLocalDateTime().format(DateTimeFormatter.ofPattern(Message.parse("TIMEFORMAT", target)))));
}
TextComponent msg = new TextComponent(potentialBan.toString());
msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Message.parse("BAN_AVOIDING_BAN_HOVER", target)).create()));
msg.setClickEvent(clickEvent);
target.sendMessage(msg);
}
}
}
Forge.onServerConnected(event);
});
}
}

Datei anzeigen

@ -1,71 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.listeners;
import de.steamwar.messages.ChatSender;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.protocol.DefinedPacket;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
public class BrandListener extends BasicListener {
private static boolean isLocalHost(InetAddress addr) {
if (addr.isAnyLocalAddress() || addr.isLoopbackAddress()) {
return true;
}
try {
return NetworkInterface.getByInetAddress(addr) != null;
} catch (SocketException e) {
return false;
}
}
@EventHandler
public void onServerSwitch(PluginMessageEvent event) {
if(!event.getTag().equals("minecraft:brand") && !event.getTag().equals("MC|Brand")) {
return;
}
if (isLocalHost(event.getReceiver().getAddress().getAddress())) {
return;
}
if (!(event.getReceiver() instanceof ProxiedPlayer)) {
return;
}
event.setCancelled(true);
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
String brandString = ChatSender.of(player).parseToLegacy("STEAMWAR_BRAND", ProxyServer.getInstance().getName(), player.getServer().getInfo().getName(), new String(event.getData(), 1, event.getData().length - 1));
ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer();
DefinedPacket.writeString(brandString, brand);
player.sendData(event.getTag(), DefinedPacket.toArray(brand));
brand.release();
}
}

Datei anzeigen

@ -1,260 +0,0 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2022 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
import de.steamwar.bungeecore.comms.packets.PingPacket;
import de.steamwar.bungeecore.sql.*;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.*;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.ChatEvent;
import net.md_5.bungee.api.event.TabCompleteEvent;
import net.md_5.bungee.api.event.TabCompleteResponseEvent;
import net.md_5.bungee.api.scheduler.TaskScheduler;
import net.md_5.bungee.event.EventHandler;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class ChatListener extends BasicListener {
private static final Set<Integer> coloredTeams = new HashSet<>();
static {
coloredTeams.add(12);
coloredTeams.add(54);
coloredTeams.add(285);
}
@EventHandler
public void onChatEvent(ChatEvent e) {
if(!(e.getSender() instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) e.getSender();
String message = e.getMessage();
if (message.contains("jndi:ldap")) {
e.setCancelled(true);
SteamwarUser.get(player).punishPerma(Punishment.PunishmentType.Ban, "Versuchte Exploit-Ausnutzung", 0);
return;
}
message = sanitize7(message);
if (message.startsWith("/")) {
if(filteredCommand((CommandSender) e.getSender(), message))
e.setCancelled(true);
} else {
e.setCancelled(true);
Subserver subserver = Subserver.getSubserver(player);
if(subserver != null && subserver.getType() == Servertype.ARENA && subserver.getServer() == player.getServer().getInfo()) {
localChat(player, message);
} else if (message.startsWith("+")) {
localChat(player, message.substring(1));
} else {
sendChat(ChatSender.of(player), ChatSender.globalReceivers(), "CHAT_GLOBAL", null, message);
}
}
}
public static void sendChat(ChatSender sender, Stream<ChatSender> receivers, String format, ChatSender msgReceiver, String message) {
String finalMessage = modifyFilter(sender, message);
if(finalMessage == null)
return;
SteamwarUser user = sender.user();
AtomicBoolean noReceiver = new AtomicBoolean(true);
receivers.filter(ChatSender::chatShown).forEach(player -> {
if(sender.user().getId() != player.user().getId())
noReceiver.set(false);
chatToReciever(player, msgReceiver, user, format, finalMessage);
});
chatToReciever(ChatSender.console(), msgReceiver, user, format, finalMessage);
if(format.equals("CHAT_GLOBAL")) {
if (SteamwarDiscordBot.instance() != null)
chatToReciever(ChatSender.discordChannel(SteamwarDiscordBot.instance().getIngameChatListener()), msgReceiver, user, format, finalMessage);
} else if (format.equals("CHAT_SERVERTEAM")) {
if (SteamwarDiscordBot.instance() != null)
chatToReciever(ChatSender.discordChannel(SteamwarDiscordBot.instance().getServerTeamChatListener()), msgReceiver, user, format, finalMessage);
} else if (noReceiver.get()) {
sender.system("CHAT_NO_RECEIVER");
}
}
public static void localChat(ProxiedPlayer player, String message) {
ChatSender sender = ChatSender.of(player);
if(message.length() == 0){
sender.system("CHAT_BC_USAGE");
return;
}
message = sanitize7(message);
if(ChatListener.filteredCommand(player, message))
return;
if(!message.startsWith("/")) {
message = modifyFilter(sender, message);
if(message == null)
return;
}
player.chat(message);
}
private static String modifyFilter(ChatSender sender, String message) {
if(!sender.chatShown()) {
sender.system("CHAT_RECEIVE");
return null;
}
SteamwarUser user = sender.user();
UserGroup group = user.getUserGroup();
if(!group.isTeamGroup() && (message.contains("http:") || message.contains("https:") || message.contains("www."))){
sender.system("CHAT_NO_LINKS");
return null;
}
if (user.isPunishedWithMessage(sender, Punishment.PunishmentType.Mute))
return null;
if(group != UserGroup.Member || coloredTeams.contains(user.getTeam()))
message = ChatColor.translateAlternateColorCodes('&', message);
if (message.contains("LIXFEL"))
specialAlert(sender, "Lixfel", "CHAT_LIXFEL_", 3, 6, 11, 12, 15);
if (message.contains("YOYONOW"))
specialAlert(sender, "YoyoNow", "CHAT_YOYONOW_", 3, 6, 11, 12);
return message;
}
private static void chatToReciever(ChatSender receiver, ChatSender msgReceiver, SteamwarUser sender, String format, String message) {
UserGroup group = sender.getUserGroup();
receiver.chat(new Message(format,
sender,
msgReceiver == null ? receiver : msgReceiver,
highlightMentions(message, group.getChatColorCode(), receiver),
sender.getTeam() == 0 ? "" : "§" + Team.get(sender.getTeam()).getTeamColor() + Team.get(sender.getTeam()).getTeamKuerzel() + " ",
UserElo.getEmblem(sender),
group.getColorCode(),
group.getChatPrefix().length() == 0 ? "§f" : group.getChatPrefix() + " ",
group.getChatColorCode()));
}
private static String sanitize7(String message) {
String begin = message.split(" ", 2)[0];
if(begin.startsWith("7") && begin.substring(1).matches("[A-Za-z]+")){
message = "/" + message.substring(1);
}else if((begin.startsWith("77") || begin.startsWith("7/") || begin.startsWith("/7")) && begin.substring(2).matches("[A-Za-z]+")){
message = "//" + message.substring(2);
}
return message;
}
private static boolean filteredCommand(CommandSender sender, String message) {
String command = message.split(" ", 2)[0];
if(command.startsWith("/") && command.contains(":")) {
Message.send("UNKNOWN_COMMAND", sender);
return true;
}
return false;
}
private static void specialAlert(ChatSender sender, String name, String baseMessage, int... delay) {
sender.system("CHAT_LIXFEL_ACTION_BAR");
TaskScheduler scheduler = ProxyServer.getInstance().getScheduler();
for(int i = 0; i < delay.length; i++) {
int finalI = i;
scheduler.schedule(BungeeCore.get(), () -> sender.prefixless("CHAT_MSG", name, sender.user(), new Message(baseMessage + (finalI+1))), delay[i], TimeUnit.SECONDS);
}
}
private static String highlightMentions(String message, String returnColor, ChatSender player) {
if(!message.contains("@"))
return message;
String mark = "@" + player.user().getUserName();
return Arrays.stream(message.split(" ")).map(cur -> {
if(cur.equalsIgnoreCase(mark)) {
new PingPacket(player.user().getId()).send(player.user().getPlayer());
return "§e" + cur + returnColor;
}
return cur;
}).collect(Collectors.joining(" "));
}
@EventHandler
public void onTabCompleteEvent(TabCompleteEvent e){
List<String> suggestions = e.getSuggestions();
String [] cursor = e.getCursor().split(" ");
String last;
if(cursor.length != 0)
last = cursor[cursor.length - 1];
else
last = "";
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
String name = player.getName();
if (last.isEmpty() || name.startsWith(last)) {
suggestions.add(name);
}
}
if(last.startsWith("@")) {
String plrName = last.replace("@", "");
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
String name = player.getName();
if ((plrName.isEmpty() || name.startsWith(plrName)) && !plrName.equalsIgnoreCase(name)) {
suggestions.add("@" + name);
}
}
}
if(e.getSender() instanceof ProxiedPlayer && cursor.length == 1 && cursor[0].startsWith("/")){
ProxiedPlayer player = (ProxiedPlayer) e.getSender();
for(String cmd : BungeeCore.commands.keySet()){
if(cmd.startsWith(cursor[0]) && player.hasPermission(BungeeCore.commands.get(cmd))){
suggestions.add(cmd);
}
}
}
}
@EventHandler
public void onTabCompleteResponseEvent(TabCompleteResponseEvent e){
List<String> suggestions = e.getSuggestions();
int i = 0;
while (i < suggestions.size()) {
String suggestion = suggestions.get(i);
if(suggestion.startsWith("/") && suggestion.contains(":"))
suggestions.remove(i);
else
i++;
}
}
}

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen