From 2019a80ee47255db188c9c8942363a0713fd16f2 Mon Sep 17 00:00:00 2001 From: Troy Frew Date: Mon, 27 Jun 2016 02:09:47 -0400 Subject: [PATCH] Initial project structure. More to come soon.. --- .gitignore | 1 + LICENSE.txt | 21 +++++++++++++++ README.md | 33 +++++++++++++++++++++++ applyPatches.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++ rebuildPatches.sh | 61 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 183 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100755 applyPatches.sh create mode 100755 rebuildPatches.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5fa4b3e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Travertine-Proxy diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..f129e01 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2015-2016 Waterfall Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..023086e --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# Travertine + +Travertine is Waterfall with additional protocols. Waterfall is a fork of the well-known [BungeeCord](https://github.com/SpigotMC/BungeeCord) server teleportation suite. + +Waterfall focuses on three main areas: + +* **Stability**: Waterfall aims to be stable. We will achieve this through making the code base testable and discouraging practices that lead to proxy lag. +* **Features**: Waterfall aims to include more features than canonical BungeeCord. +* **Scalability**: Waterfall should be able to handle a large number of concurrent players, given a reasonably modern CPU, memory, and good network connection. + +Travertine focuses on one main area: + +* **Additional Client Version Support**: Travertine aims to support client versions older then what is supported in upstream. This includes 1.7 support. Additionally Travertine may release Snapshot and PRE Client support patches as time permits. + +## Why fork Waterfall? + +Travertine has a goal of adding additional protocol versions. + +Travertine was forked because of the fact that Waterfall intends to only support protocol versions supported by upstream BungeeCord. + +Travertine will track upstream Waterfall and merge changes as needed. + +## Join us + +* Feel free to open a PR! We accept contributions. +* Join us on IRC (irc.esper.net #waterfall, [webchat](http://webchat.esper.net/?nick=&channels=waterfall)). +* Visit our forums on [Aquifer](https://aquifermc.org). + +Special Thanks To +----------------- +![YourKit-Logo](https://yourkit.com/images/yklogo.png) + +[YourKit](https://yourkit.com/), makers of the outstanding Java profiler, supports open source projects of all kinds with their full-featured [Java](https://yourkit.com/features/) and [.NET](https://yourkit.com/dotnet/features/) application profilers. We thank them for granting Waterfall an OSS license so that we can make our software the best it can be. diff --git a/applyPatches.sh b/applyPatches.sh new file mode 100755 index 0000000..0171df5 --- /dev/null +++ b/applyPatches.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +PS1="$" +basedir="$(cd "$1" && pwd -P)" +workdir="$basedir/work" +gpgsign="$(git config commit.gpgsign || echo "false")" +echo "Rebuilding Forked projects.... " + +function enableCommitSigningIfNeeded { + if [[ "$gpgsign" == "true" ]]; then + echo "Re-enabling GPG Signing" + # Yes, this has to be global + git config --global commit.gpgsign true + fi +} + +function applyPatch { + what=$1 + what_name=$(basename "$what") + target=$2 + branch=$3 + + cd "$basedir/$what" + git fetch + git branch -f upstream "$branch" >/dev/null + + cd "$basedir" + if [ ! -d "$basedir/$target" ]; then + git clone "$what" "$target" + fi + cd "$basedir/$target" + + echo "Resetting $target to $what_name..." + git remote rm upstream > /dev/null 2>&1 + git remote add upstream "$basedir/$what" >/dev/null 2>&1 + git checkout master 2>/dev/null || git checkout -b master + git fetch upstream >/dev/null 2>&1 + git reset --hard upstream/upstream + + echo " Applying patches to $target..." + + git am --abort >/dev/null 2>&1 + git am --3way --ignore-whitespace "$basedir/${what_name}-Patches/"*.patch + if [ "$?" != "0" ]; then + echo " Something did not apply cleanly to $target." + echo " Please review above details and finish the apply then" + echo " save the changes with rebuildPatches.sh" + enableCommitSigningIfNeeded + exit 1 + else + echo " Patches applied cleanly to $target" + fi +} + +# Disable GPG signing before AM, slows things down and doesn't play nicely. +# There is also zero rational or logical reason to do so for these sub-repo AMs. +# Calm down kids, it's re-enabled (if needed) immediately after, pass or fail. +if [[ "$gpgsign" == "true" ]]; then + echo "_Temporarily_ disabling GPG signing" + git config --global commit.gpgsign false +fi + + +# Apply patches +applyPatch Waterfall/Waterfall-Proxy Travertine-Proxy HEAD + +enableCommitSigningIfNeeded diff --git a/rebuildPatches.sh b/rebuildPatches.sh new file mode 100755 index 0000000..9535384 --- /dev/null +++ b/rebuildPatches.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +( +PS1="$" +basedir="$(cd "$1" && pwd -P)" +workdir="$basedir/work" +echo "Rebuilding patch files from current fork state..." +git config core.safecrlf false + +function cleanupPatches { + cd "$1" + for patch in *.patch; do + echo "$patch" + gitver=$(tail -n 2 "$patch" | grep -ve "^$" | tail -n 1) + diffs=$(git diff --staged "$patch" | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|.index)") + + testver=$(echo "$diffs" | tail -n 2 | grep -ve "^$" | tail -n 1 | grep "$gitver") + if [ "x$testver" != "x" ]; then + diffs=$(echo "$diffs" | sed 'N;$!P;$!D;$d') + fi + + if [ "x$diffs" == "x" ] ; then + git reset HEAD "$patch" >/dev/null + git checkout -- "$patch" >/dev/null + fi + done +} + +function savePatches { + what=$1 + what_name=$(basename "$what") + target=$2 + echo "Formatting patches for $what..." + + cd "$basedir/${what_name}-Patches/" + if [ -d "$basedir/$target/.git/rebase-apply" ]; then + # in middle of a rebase, be smarter + echo "REBASE DETECTED - PARTIAL SAVE" + last=$(cat "$basedir/$target/.git/rebase-apply/last") + next=$(cat "$basedir/$target/.git/rebase-apply/next") + for i in $(seq -f "%04g" 1 1 $last) + do + if [ $i -lt $next ]; then + rm ${i}-*.patch + fi + done + else + rm -rf *.patch + fi + + cd "$basedir/$target" + + git format-patch --no-stat -N -o "$basedir/${what_name}-Patches/" upstream/upstream >/dev/null + cd "$basedir" + git add -A "$basedir/${what_name}-Patches" + cleanupPatches "$basedir/${what_name}-Patches" + echo " Patches saved for $what to $what_name-Patches/" +} + +savePatches "Waterfall/Waterfall-Proxy" "Travertine-Proxy" +)