Skip to content

Commit

Permalink
Bungeecord testing and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed Jun 17, 2022
1 parent 8c005ba commit a5ca734
Show file tree
Hide file tree
Showing 11 changed files with 294 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ out/*

.vscode/*

test-server/
test-server-spigot/
test-server-bungee/
54 changes: 54 additions & 0 deletions dev-resources/bungeeconfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
server_connect_timeout: 5000
enforce_secure_profile: false
remote_ping_cache: -1
forge_support: false
player_limit: -1
permissions:
default:
- bungeecord.command.server
- bungeecord.command.list
admin:
- openaudiomc.*
- bungeecord.command.alert
- bungeecord.command.end
- bungeecord.command.ip
- bungeecord.command.reload
timeout: 30000
log_commands: false
network_compression_threshold: 256
online_mode: true
disabled_commands:
- disabledcommandhere
servers:
lobby:
motd: '&1Just another BungeeCord - Forced Host'
address: localhost:25566
restricted: false
listeners:
- query_port: 35644
motd: '&1Another Bungee server'
tab_list: GLOBAL_PING
query_enabled: false
proxy_protocol: false
forced_hosts:
pvp.md-5.net: pvp
ping_passthrough: false
priorities:
- lobby
bind_local_address: true
host: 0.0.0.0:25565
max_players: 1
tab_size: 60
force_default_server: false
ip_forward: true
remote_ping_timeout: 5000
prevent_proxy_connections: false
groups:
Mindgamesnl:
- admin
ToetMats:
- admin
connection_throttle: 4000
stats: 7ab03ab5-c6fa-4f0d-9803-b78e16049715
connection_throttle_limit: 3
log_pings: true
36 changes: 36 additions & 0 deletions dev-resources/server.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#Minecraft server properties
#Fri Jun 17 12:00:40 CEST 2022
view-distance=10
max-build-height=256
server-ip=
level-seed=
gamemode=0
server-port=25566
enable-command-block=false
allow-nether=true
enable-rcon=false
op-permission-level=4
enable-query=false
prevent-proxy-connections=false
generator-settings=
resource-pack=
player-idle-timeout=0
level-name=world
motd=A Minecraft Server
force-gamemode=false
hardcore=false
white-list=false
pvp=true
spawn-npcs=true
generate-structures=true
spawn-animals=true
snooper-enabled=true
difficulty=1
network-compression-threshold=256
level-type=DEFAULT
spawn-monsters=true
max-players=20
resource-pack-sha1=
online-mode=false
allow-flight=false
max-world-size=29999984
124 changes: 124 additions & 0 deletions dev-resources/spigot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# This is the main configuration file for Spigot.
# As you can see, there's tons to configure. Some options may impact gameplay, so use
# with caution, and make sure you know what each option does before configuring.
# For a reference for any variable inside this file, check out the Spigot wiki at
# http://www.spigotmc.org/wiki/spigot-configuration/
#
# If you need help with the configuration or have any questions related to Spigot,
# join us at the IRC or drop by our forums and leave a post.
#
# IRC: #spigot @ irc.spi.gt ( http://www.spigotmc.org/pages/irc/ )
# Forums: http://www.spigotmc.org/

config-version: 11
messages:
whitelist: You are not whitelisted on this server!
unknown-command: Unknown command. Type "/help" for help.
server-full: The server is full!
outdated-client: Outdated client! Please use {0}
outdated-server: Outdated server! I'm still on {0}
restart: Server is restarting
settings:
bungeecord: true
late-bind: false
timeout-time: 60
restart-on-crash: true
restart-script: ./start.sh
save-user-cache-on-stop-only: false
moved-wrongly-threshold: 0.0625
moved-too-quickly-multiplier: 10.0
int-cache-limit: 1024
user-cache-size: 1000
sample-count: 12
player-shuffle: 0
filter-creative-items: true
item-dirty-ticks: 20
netty-threads: 4
attribute:
maxHealth:
max: 2048.0
movementSpeed:
max: 2048.0
attackDamage:
max: 2048.0
debug: false
stats:
disable-saving: false
forced-stats: {}
commands:
tab-complete: 0
log: true
silent-commandblock-console: false
spam-exclusions:
- /skill
replace-commands:
- setblock
- summon
- testforblock
- tellraw
advancements:
disable-saving: false
disabled:
- minecraft:story/disabled
world-settings:
default:
verbose: true
merge-radius:
exp: 3.0
item: 2.5
ticks-per:
hopper-transfer: 8
hopper-check: 1
hopper-amount: 1
hunger:
jump-walk-exhaustion: 0.05
jump-sprint-exhaustion: 0.2
combat-exhaustion: 0.1
regen-exhaustion: 6.0
swim-multiplier: 0.01
sprint-multiplier: 0.1
other-multiplier: 0.0
arrow-despawn-rate: 1200
item-despawn-rate: 6000
view-distance: 10
wither-spawn-sound-radius: 0
nerf-spawner-mobs: false
hanging-tick-frequency: 100
growth:
cactus-modifier: 100
cane-modifier: 100
melon-modifier: 100
mushroom-modifier: 100
pumpkin-modifier: 100
sapling-modifier: 100
wheat-modifier: 100
netherwart-modifier: 100
vine-modifier: 100
cocoa-modifier: 100
entity-activation-range:
animals: 32
monsters: 32
misc: 16
tick-inactive-villagers: true
entity-tracking-range:
players: 48
animals: 48
monsters: 48
misc: 32
other: 64
random-light-updates: false
save-structure-info: true
dragon-death-sound-radius: 0
seed-village: 10387312
seed-feature: 14357617
seed-monument: 10387313
seed-slime: 987234911
max-tnt-per-tick: 100
max-tick-time:
tile: 50
entity: 50
squid-spawn-range:
min: 45.0
mob-spawn-range: 4
enable-zombie-pigmen-portal-spawns: true
zombie-aggressive-towards-villager: true
1 change: 1 addition & 0 deletions dev-resources/start-bungee.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java -Xms1G -Xmx1G -jar BungeeCord.jar
1 change: 1 addition & 0 deletions dev-resources/start-spigot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java -Xms3G -Xmx3G -jar spigot-1.12.2.jar nogui
2 changes: 1 addition & 1 deletion module-src/jutils/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
</plugins>
</build>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
</properties>
</project>

Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.craftmend.openaudiomc.generic.database;

import com.craftmend.openaudiomc.OpenAudioMc;
import com.craftmend.openaudiomc.generic.database.internal.DataStore;
import com.craftmend.openaudiomc.generic.database.internal.Repository;
import com.craftmend.openaudiomc.generic.environment.MagicValue;
import com.craftmend.openaudiomc.generic.logging.OpenAudioLogger;
import com.craftmend.openaudiomc.generic.modules.ModuleLoaderService;
import com.craftmend.openaudiomc.generic.platform.Platform;
import com.craftmend.openaudiomc.generic.service.Service;
import com.craftmend.openaudiomc.spigot.modules.regions.objects.TimedRegionProperties;
import com.craftmend.openaudiomc.spigot.modules.rules.adapter.RuleTestTypeAdapter;
Expand Down Expand Up @@ -52,8 +54,13 @@ public DatabaseService() {
tables.add(com.craftmend.openaudiomc.spigot.modules.regions.objects.RegionProperties.class);
tables.add(com.craftmend.openaudiomc.spigot.modules.speakers.objects.Speaker.class);
tables.add(com.craftmend.openaudiomc.spigot.modules.predictive.sorage.StoredWorldChunk.class);
tables.add(TimedRegionProperties.class);
tables.add(MediaRule.class);

if (OpenAudioMc.getInstance().getPlatform() == Platform.SPIGOT) {
log("Adding spigot tables");
tables.add(TimedRegionProperties.class);
tables.add(MediaRule.class);
}


for (Class<? extends DataStore> table : tables) {
getRepository(table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import com.craftmend.openaudiomc.spigot.modules.players.SpigotPlayerService;
import com.craftmend.storm.api.markers.Column;
import com.craftmend.storm.api.markers.Table;
import lombok.NoArgsConstructor;
import org.bukkit.Bukkit;

@NoArgsConstructor

@Table(name = "timed_region_properties")
public class TimedRegionProperties extends RegionProperties {

Expand All @@ -19,6 +18,10 @@ public class TimedRegionProperties extends RegionProperties {
private String regionId;
private Media media;

public TimedRegionProperties() {

}

public TimedRegionProperties(String source, int timeInSeconds, String regionId) {
this(source, timeInSeconds, regionId, 100, 1000, regionId);
}
Expand All @@ -32,7 +35,6 @@ public TimedRegionProperties(String source, int timeInSeconds, String regionId,
OpenAudioMcSpigot.getInstance().getRegionModule().removeRegion(this.regionId);
forceUpdateClients();
}, 20 * timeInSeconds);

forceUpdateClients();
}
}
Expand Down
54 changes: 54 additions & 0 deletions spawn-test-bungee.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
export JAVA_HOME=`/usr/libexec/java_home -v 11`
cwd=$(pwd)
mkdir -p test-server-bungee/spigot/plugins/
mkdir -p test-server-bungee/spigot/plugins/OpenAudioMc/
echo "Building new OpenAudioMc jar without unit tests.."

mvn clean install -Dmaven.test.skip=true

npm install -g pm2
pm2 stop all

rm test-server-bungee/spigot/plugins/OpenAudioMc-*
cp plugin/target/OpenAudioMc-* test-server-bungee/spigot/plugins/
cp dev-resources/bukkit.yml test-server-bungee/spigot/
cp dev-resources/spigot.yml test-server-bungee/spigot/
cp dev-resources/server.properties test-server-bungee/spigot/
cp dev-resources/ops.json test-server-bungee/spigot/
cp dev-resources/start-spigot.sh test-server-bungee/spigot/

cd test-server-bungee/spigot/
echo "Cleaning server..."
if [ ! -f ./spigot-1.12.2.jar ]; then
wget https://cdn.getbukkit.org/spigot/spigot-1.12.2.jar
echo "eula=true" > eula.txt
chmod +x spigot-1.12.2.jar
fi

echo "Starting server.."
chmod +x start-spigot.sh
pm2 start ./start-spigot.sh &&


# setup bungeecord
cd $cwd
echo "Going to $cwd"
sleep 2

mkdir -p $cwd/test-server-bungee/bungee/plugins/
cp $cwd/plugin/target/OpenAudioMc-* $cwd/test-server-bungee/bungee/plugins/
cp $cwd/dev-resources/bungeeconfig.yml $cwd/test-server-bungee/bungee/config.yml
cp $cwd/dev-resources/start-bungee.sh $cwd/test-server-bungee/bungee/
cd $cwd/test-server-bungee/bungee/
if [ ! -f ./BungeeCord.jar ]; then
wget https://ci.md-5.net/job/BungeeCord/lastSuccessfulBuild/artifact/bootstrap/target/BungeeCord.jar
echo "eula=true" > eula.txt
chmod +x BungeeCord.jar
fi
chmod +x start-bungee.sh
pm2 start ./start-bungee.sh


pm2 logs

pm2 stop all
14 changes: 7 additions & 7 deletions spawn-test-server.sh → spawn-test-spigot.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
export JAVA_HOME=`/usr/libexec/java_home -v 11`
mkdir -p test-server/plugins/
mkdir -p test-server/plugins/OpenAudioMc/
mkdir -p test-server-spigot/plugins/
mkdir -p test-server-spigot/plugins/OpenAudioMc/
echo "Building new OpenAudioMc jar without unit tests.."

mvn clean install -Dmaven.test.skip=true

rm test-server/plugins/OpenAudioMc-*
cp plugin/target/OpenAudioMc-* test-server/plugins/
cp dev-resources/bukkit.yml test-server/
cp dev-resources/ops.json test-server/
rm test-server-spigot/plugins/OpenAudioMc-*
cp plugin/target/OpenAudioMc-* test-server-spigot/plugins/
cp dev-resources/bukkit.yml test-server-spigot/
cp dev-resources/ops.json test-server-spigot/

cd test-server
cd test-server-spigot
echo "Cleaning server..."
if [ ! -f ./spigot-1.12.2.jar ]; then
wget https://cdn.getbukkit.org/spigot/spigot-1.12.2.jar
Expand Down

0 comments on commit a5ca734

Please sign in to comment.