From 84f30d387db1e7ff9a117b35fe498e0b90f482fc Mon Sep 17 00:00:00 2001 From: Muhammad Eko Prasetyo Date: Mon, 2 May 2022 19:40:46 +0700 Subject: [PATCH] change readme --- .../7.2/executionHistory/executionHistory.bin | Bin 79473 -> 79473 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/7.2/fileHashes/fileHashes.bin | Bin 20297 -> 21947 bytes .gradle/7.2/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../7.2/fileHashes/resourceHashesCache.bin | Bin 20061 -> 20333 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .gradle/buildOutputCleanup/outputFiles.bin | Bin 18947 -> 19469 bytes .gradle/checksums/checksums.lock | Bin 17 -> 17 bytes .gradle/checksums/md5-checksums.bin | Bin 19247 -> 20147 bytes .gradle/checksums/sha1-checksums.bin | Bin 20333 -> 22439 bytes README.md | 9 +- gradlew | 269 +++++++++++------- 12 files changed, 163 insertions(+), 115 deletions(-) diff --git a/.gradle/7.2/executionHistory/executionHistory.bin b/.gradle/7.2/executionHistory/executionHistory.bin index 59e19fa8375b5445f1acd484c5cab6404d8a9ef6..2eb550e1c1bd1f0a575b95d044d01c10f30d7174 100644 GIT binary patch delta 4329 zcmb_fdsI_r62Bh_iVe0m2<8G3$Sx155&{?$j@9z2RD&Ra>e?XQgeU=$KoZCiSAi83 z6e0L|yzF8{#G+PKiShjc6^pACq1CPK`dFyiZL7Fgu%*Yx-kYFc$c_8Q=A1mv%>3pz zlW*pmxqT0reGi!i*YRT!^K0=K1Yx{e9W)OpjLLQnn|Wfp%cn2>8n;-~@lh}i^FakN z&qWU78@F48X|6C0n*#ETB{dwQp`24~C=!Gr2>TT2%AI=Gs`S~}1+qe=RwLEulsc(4 zG*79RrYzJdEFO?>Q}|*CIL4SrNvc+^(Msa7)sk4XEMF;C>9p`uiHAFII8CpG-jbVpS%yF=l?w#Y(1N&|#v7)&2RB>E#dVFF++$$_)z^EL81!pLp3Lj2jh0 z?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Jt;P?*`(ET* z6l&KQt{$Hfv~WK{%FQaI=<~NKR@uGfz7=WAlcQFCZdxDLkVP7i@rQV;vA4G^tf<&U z*lLi&QS-ZdTV~WR4By<(_4*DiByuQl*uTeJO7(tdvqET5F7k*UaAgTl__y~^-WGs!tt=_ zvMXik!yAjJ5Qo~PSCWvLy3nhBZngRHP|VZoqtzP?I^4Z=12EaRe41UT2iVItL!A(+ z1E@|n+e|>jKoK^27`$yNIhu1_X|Oid9=sjG9Zp0F&j`@naY41o z=Ld^g2QRi5;m_5kqTow{8{5INkfpw7KDcG}{xg?IC~-A_q_`2P^VOP$!DS0@dN#F*l7(#(w9J!hOIt?}_wq!JAy zVN>aVw@rrA delta 105 zcmdnJn(^d3#tkMCj4G3BB_t-_m8h7UD`_x!D-i#cl$abVWiWXu5Wkg@m@F%8FgX>7 z*GfxF{tCpZG6s`dWfCU;m64dND{C;BRjz{PKNK)9Fc)rA{2{*4V1>wLM-L8m08pzb AegFUf diff --git a/.gradle/7.2/fileHashes/fileHashes.lock b/.gradle/7.2/fileHashes/fileHashes.lock index 59472b583346cc3f3d558bfb6f0822f6a250e186..0be7bf9e578262027ca6260fcb6cb24fbdc5f66d 100644 GIT binary patch literal 17 VcmZQx^Tz2jgWH{E1~6dK0suKK1fl={ literal 17 VcmZQx^Tz2jgWH{E1~6cJ4*)sw1!e#M diff --git a/.gradle/7.2/fileHashes/resourceHashesCache.bin b/.gradle/7.2/fileHashes/resourceHashesCache.bin index ad5a03d9c692c318dd61f41db0eb808a21c1e339..db1931f533b2ba5c0a2a1b7461059cdcad699baa 100644 GIT binary patch delta 467 zcmcaRhw<$^#tkMCjAoNfB@#5cuSslOYZzL@00w?f|3ksV^93w|4reT&;)f^qN+@W| zGuo`T?Y2ZUM9^Oorg(|C*UgI^R-2%TV<#__2oPA+B)8++uB|hmioG|#mC#@mcz(Qj zcXj%-b5K$C&Ad_$i~`1;Yu5bL3OWcipnkHe^bCQx0CmRo&B~LZf(s{KmEOg~s<=_{ zhxkT=A3~cQJ!IIDjDfO}Kr9Ht0z9nMKKsiR*Z6*%owUOvRu3pBhpM7)zSA@91G(LA zMT^58ZTcjDslx9xPgSVP6=ChvFW%kd&yG)C=p|ggv?p6iE9vE>vI9nIwzqD_)Do+zl!&Fz(*%XZ|j)YAp8 c5h`Th9=y=`KRESkmV2JW(W^I~tAUgN0N<*S<^TWy delta 57 zcmV-90LK6Ao&nvQ0kAX}0WOm@7+{md7#Ncc8A!8j86W|(r5ZQ^ll2>rlbsy00t8{P PA@~=uFt`)5K}Z}1UcwZE diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index dfc7a6e5b6cea2ff1edcf314de252c046aa4885c..6b891882b9ac2e29c03a97423da27c82a32f2468 100644 GIT binary patch literal 17 VcmZR67&qfZ+-7G^1~6c>1pqfS1YQ6D literal 17 VcmZR67&qfZ+-7G^1~6b`1^_nu1S9|e diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index 00508f6f22b6e742494d2db35dad10bd48220d54..80438fb1b3064cebf26bf11ce1267cb55032fc66 100644 GIT binary patch delta 717 zcmZpk!q_{5af68jquFFr2?K#rf00Xb3lVc?U1ZM9&n15F(TnHlQ{c`eB zi2#i){%x`0TPprS1&{uRf^Aa0Ub-J&1Vc?YIr*)Gg2s-lXkOzz*$z;}*)YXB?|l;0 zInS#HRXlkztE7d%ZK2+1-?tZFCYw$+1q%L_wWPeCVPnCE4^Z{YFmZ0FM?z~?=9EIky5ZiA%RUT7DU}=sdTs74@P=wv zhZ*Zv&RslF^VmwL_*71x7Pq_V{ z;@jcked*I8BuY42p%VWmt4dio#0baDa1YX+1vOm|raJCI^L|a?IpR=pWte!;X^!># zzI>O58WKA>R7ydhG_G_;>W;!KP{p;AbEUMHSQR%a{t(}2@Iz>`qsJk}$+n)nll?q$ SCg*v20BIp0_LzLn<2?ZQAu)Ua delta 79 zcmeC3!Pq>7af68jqvT{$34_VC5+0N90&%FM#N@e>29uuxv96TCWK(INoHS5QT4Hjm fjKSo;G7^(@WtEtiGB+yz5Z`F9L3FdD$00@lFu@x| diff --git a/.gradle/checksums/checksums.lock b/.gradle/checksums/checksums.lock index b140318b93cef97fe61c7e08cd1e77f21773c2c4..5aa18aefbfbb4ac0e54e4da6f1b634879457d482 100644 GIT binary patch literal 17 UcmZR+x9V=p7w6q)7$Beu07fAN{Qv*} literal 17 UcmZR+x9V=p7w6q)7$CqF07c{lzyJUM diff --git a/.gradle/checksums/md5-checksums.bin b/.gradle/checksums/md5-checksums.bin index 4f722da690cb7ef7ddc72c0e671b07d2f759765d..8300a21dcdce79ec68f8e5c1495bc05ef4656aab 100644 GIT binary patch delta 835 zcmZ2KjdAl_#tkMCjEa*@B@F84-CXaw&GVfE0~q)<{)d7UvUbj*79W2>#C>ZY*3-@tsG9A1c^8xl|%RbgaM9-54V1+YYnKD|Yqj17VSGpyJ9f zalffAeiRjH!h8`u*%xSXc`Arr42%sRNr(yTK0sOz;zOSx}a zi>`jWxO1Y^)>Dg?Y=r1I)d7?Q0->#wFMFtg%)d1GuZL8^l>3>%#(rA1e&*ZGdPw@e!yJ2)x-Qn|p#hab^DG zL{B{+<8uDw$zaB%#K}j&jEhc_zk?YUEGBDufz(_RnH&vfTvwjl3ufFfoxC5+xXCj4 UqnDmQbHpuB7y<$39w4Cy00D+K0RR91 delta 63 zcmdlymvQ|x#tkMCjQo>LB@8C3N=i%)mGqc=7D)dE(y>w!lY4>qEfC8}TQMc|uQ5ir4 zb?jTfTCahsh!sc$JODXbM-*u}JOE{&)`D?J1=@I^knZlc>mTwDJF~Oz_uJ=r-f!Oh zW=+SjGv!#tG8_v53GN+`l{;>}w$1xn7IkUoTIee~<+AAPzS+)*Yj|(?@Yu7YqU~2{ z{c~803uAKEVd;5-><7Bk|4fuB0(x1RPwJi^TI!v1to<(WPM9n#3~!}%QhIk`zE z=$ua>6%P+6URD~fPYCirFnR?eK7D^S>znI^T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.md @@ -3,19 +3,18 @@ Grasscutter Authentication System ### Usage : - Place jar inside plugins folder of Grasscutter. - To change hash algorithm change `Hash` in config.json inside plugins/GCAuth (Only Bcrypt and Scrypt is supported) -- To enable/disable plugin change `Enable` config.json inside plugins/GCAuth (enabled by default) - All payload must be send with `application/json` and Compact JSON format ( without unnecessary spaces ) - Auth endpoint is: - - Check auth status : `/grasscutter/auth_status` (GET) - - Register: `/grasscutter/register` (POST) + - Authentication Checking : `/authentication/type` (GET) , it'll return `me.exzork.gcauth.handler.GCAuthAuthenticationHandler` if GCAuth is loaded and enabled. + - Register: `/authentication/register` (POST) ``` {"username":"username","password":"password","password_confirmation":"password_confirmation"} ``` - - Login: `/grasscutter/login` (POST) + - Login: `/authentication/login` (POST) ``` {"username":"username","password":"password"} ``` - - Change password: `/grasscutter/change_password` (POST) + - Change password: `/authentication/change_password` (POST) ``` {"username":"username","new_password":"new_password","new_password_confirmation":"new_password_confirmation","old_password":"old_password"} ``` diff --git a/gradlew b/gradlew index 744e882..c53aefa 100644 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MSYS* | MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@"