diff --git a/MODULE.bazel b/MODULE.bazel index 2faf2be..a0b8258 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -24,6 +24,7 @@ maven.install( "com.velocitypowered:velocity-api:4.1.0-20260802.091736-8", "org.jdbi:jdbi3-core:3.53.0", "org.jdbi:jdbi3-postgres:3.53.0", + "org.postgresql:postgresql:42.7.12", "org.mongodb:bson:5.8.0", "io.nats:jnats:2.25.2", "de.kentoj.scrow:kencommandapi-core:0.36-SNAPSHOT", diff --git a/README.md b/README.md index c729b98..ae64511 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,29 @@ # TODO ## BUILD -- make sure it doesn't break when using postgres/nats (i only tested with dummies) +- make sure it doesn't break when using nats - lwk make sure velocity plugin works at runtime -- runServer target: - - start papermc server - - start PostgreSQL server - - maybe also have some map loaded +- make dev-server use $DOCKER and fallback to docker if podman is not available. - refactor BUILD files: MODULES.bazel -- debate use of third_party; deduplicate ## bukkit +- MAKE A MINIGAME FIRST - notification: Friend is now offline/online +- maybe lowk make kencommandapi's type's use Result instead of + exceptions so we can have cleaner error messages + - maybe ` -- `: `player not online -- kento2`, + `you can't add yourself as friend: kento2` -- this is weird again + - or similarly `illegal argument : `: `illegal argument kento2: + you can't add yourself`. this is good lwk + - or just completely leave it up to the type: `` but then + we'd get inconsistencies or uninformative error messages. + maybe the error messages also just get simpler. + `you can't add yourself as friend`, `player not online` at /msg, + but with more arguments is super confusing. + - or `: `: `player: not online` could work. but then we'd get + `player: you can't add yourself as friend` which is kinda weird maybe. + also these IDs can be confusing. +- make `/friend add` use argument requirement for self-check - /ignore command # Project diff --git a/core-bukkit/BUILD b/core-bukkit/BUILD index 30d2266..a06b311 100644 --- a/core-bukkit/BUILD +++ b/core-bukkit/BUILD @@ -19,7 +19,7 @@ java_library( ) java_binary( - name = "plugin_bin", + name = "_plugin", srcs = glob(["plugin/main/**/*.java"]), create_executable = False, resources = glob(["plugin/main/resources/**"]), @@ -30,12 +30,13 @@ java_binary( artifact("io.papermc.paper:paper-api"), artifact("io.nats:jnats"), artifact("net.kyori:adventure-key:5.2.0"), + artifact("org.postgresql:postgresql"), ], ) genrule( name = "plugin", - srcs = [":plugin_bin_deploy.jar"], + srcs = [":_plugin_deploy.jar"], outs = ["plugin.jar"], cmd = "cp $< $@", visibility = ["//visibility:public"], diff --git a/dev-server/minecraft.bzl b/dev-server/minecraft.bzl index 7d949d4..6bc545e 100644 --- a/dev-server/minecraft.bzl +++ b/dev-server/minecraft.bzl @@ -2,9 +2,8 @@ def _dev_server_impl(ctx): script = ctx.actions.declare_file(ctx.label.name + "_runner") content = """ #!/bin/sh -set -eux +set -eu -echo hi\n cp -f '%s' server.jar printf eula=true > eula.txt mkdir -p plugins @@ -13,7 +12,19 @@ for plugin in %s do cp -v \"$plugin\" plugins/ done -exec java -jar server.jar --nogui %s + +mkdir -p postgres-data +podman run \ + --rm \ + --name scrow-postgres-dev \ + -p 5432:5432 \ + -v ./postgres-data/:/data \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_HOST_AUTH_METHOD=trust \ + -d \ + docker.io/postgres:alpine || true +echo "Starting paper server in $PWD" +exec env HOST_POSTGRES='jdbc:postgresql://127.0.0.1:5432/postgres' java -jar server.jar --nogui %s """ % ( ctx.file.server_jar.short_path, " ".join([p.short_path for p in ctx.files.plugins]),