diff --git a/.classpath b/.classpath
deleted file mode 100644
index 400804d..0000000
--- a/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml
new file mode 100644
index 0000000..08b114e
--- /dev/null
+++ b/.github/workflows/github-actions.yml
@@ -0,0 +1,22 @@
+name: Build and deploy
+on: [push]
+jobs:
+ Build-and-deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 11
+ uses: actions/setup-java@v2
+ with:
+ java-version: '11'
+ distribution: 'adopt'
+ - name: Build with Gradle
+ run: ./gradlew build
+ - name: Deploy jar to server
+ uses: garygrossgarten/github-action-scp@release
+ with:
+ local: PickupBot.jar
+ remote: /home/pug/PickupDiscord/PickupBot.jar
+ host: ${{ secrets.HOST }}
+ username: ${{ secrets.SSH_USER }}
+ password: ${{ secrets.SSH_PASSWORD }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 8d9372e..5613d62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
# Log file
*.log
+*.lck
# BlueJ files
*.ctxt
@@ -21,3 +22,18 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/bin/
+
+# config file
+*.json
+*.env
+
+# Gradle
+.gradle/
+gradle/
+
+#IntelliJ
+.idea/
+build/
+
+#Database
+*.db
diff --git a/.project b/.project
deleted file mode 100644
index 171c23f..0000000
--- a/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- PickupBotDiscord
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d17b672..0000000
--- a/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
deleted file mode 100644
index ec4b0c1..0000000
--- a/CHANGELOG.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-[20180606]
-- allow admin cmds from admin channel
-- added "warning" for first noshow
-- added multiqueue option (todo: help msgs)
-
-[20180603]
-- fixed player recognized as banned
-- added accuracy to timeToString
-- fixed inability to add while info is sent
-- used player status (online, idle, ...) as indicator for AFK check
-- allow players to change vote
-- added map to normal aftermath msg
-- created special aftermath msg for abandoned matches
-
-[20180528]
-- fixed several bugs regarding ban system (fml parsing :c)
-
-[20180523]
-- improved ban message
-- added !baninfo cmd
-
-[20180520]
-- added ban system (untested)
-- keep gameconfig when re-enabling gametype
-- threading match start
-
-[20180511]
-- show most voted map in bold
-- display [0/10] PLAYER removed.
-- ability to group !status msg for more than one gametype
-- reduce of spam on !map for more than one gametype
-- use avg elo when creating a new player
-- added afk check
-
-[20180428]
-- added win percentage to !elo
-- added !live
-- added !match
-
-
-SOON:
-!map
\ No newline at end of file
diff --git a/README.md b/README.md
index 2d36d82..3a556ba 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,73 @@
-# PickupDiscord
\ No newline at end of file
+[![urtpickup](https://i.imgur.com/f9DaZDT.png)](https://discord.gg/An8hxdM)
+
+# UrT-Pickup
+[![Discord](https://img.shields.io/discord/117622053061787657)](https://discord.gg/An8hxdM)
+
+
+## About
+This is a network of Urban Terror servers associating players through [Discord](https://discord.gg/An8hxdM) thanks to a simple java bot.
+
+From this discord server you can:
+- play competitive matchmaking in any team-based game type,
+- challenge other users in individual modes such as GunGame, LMS or KnockOut matches :resurgence:,
+- improve your skills with the SkeetShoot and AimTraining modes both with record tracking :resurgence:,
+- request a game server for a few hours for your personal use.
+
+
+## Commands
+
+### User Commands
+- !add
+- !remove
+- !maps displays the map list for each gametype.
+- !map
+- !status to get information on the queues.
+- !help
+- !surrender to abandon your match.
+- !live sends info on the live matches.
+- !pick <1/2>
+- !votes to get the current votes.
+- !register
+- !country See:`
+- !elo @DiscordUser|urtauth/>
+- !stats @DiscordUser|urtauth/>
+- !top10 displays the top 10 players
+- !topcountries ordered by average ELO
+- !topwin: players with the best win ratio
+- !topkdr: players with the best KDR
+- !match
+- !last @DiscordUser|urtauth/>
+
+
+### Admin Commands
+
+- !lock to prevent commands from PUBLIC channel.
+- !unlock
+- !reset
+- !reboot
+- !getdata
+- !enablemap
+- !disablemap
+- !rcon
+- !forceadd @DiscordUser|urtauth/>
+- !enablegametype
+- !disablegametype
+- !showgameconfig
+- !ban (duration=1y1M1w1d1h1m1s)
+- !unban
+- !baninfo @DiscordUser|urtauth/>
+- !showservers
+- !addserver
+- !enableserver
+- !disableserver
+- !updateserver
+- !showmatches displays the queues AND live matches
+- !unregister
+- !country
+- !addchannel <#name>
+- !removechannel <#name>
+- !addrole <@role>
+- !removerole <@role>
+
+
+[![love](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) [![java](https://forthebadge.com/images/badges/made-with-java.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/powered-by-black-magic.svg)](https://forthebadge.com)
diff --git a/TODO.txt b/TODO.txt
index b6a0303..5900198 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,4 +1,14 @@
TODO:
+URGENT:
+///
+- !ringer function
+- !game ID -> match details.
+\\\
+
+- gtv (needs !enablegtv/!disablegtv option)
+- !pro
+- Enhanced 2v2 with mate !2v2 @gost0r to play your 2v2 with him.
+
( ) rework match abort/cancel/end behaviour to be more consistent
( ) !showmatch starttime
@@ -84,13 +94,13 @@ approach:
Remaining issue: e.g.: TeamSize=4, 1x 3p, 2x 2p : solution: 2 2 vs 3 1 = algo: 3 vs 2 1 => break up 3rd team
-REPORT SYSTEM:
-!report auth leave/noshow/insult/troll
-to defend yourself: !excuse
-if 3 games a report
-msg to admins to review case !review
-!accept !decline
-suspended for 1d, 3d, 1w, 2w, 1m, 3m, perm
-show bans and time !banlist
-ability to ban ppl as admin !permban ? if temp bans wished: !ban <1d> ex.?
-end bans: !pardon
+//REPORT SYSTEM:
+//!report auth leave/noshow/insult/troll
+//to defend yourself: !excuse
+//if 3 games a report
+//msg to admins to review case !review
+//!accept !decline
+//suspended for 1d, 3d, 1w, 2w, 1m, 3m, perm
+//show bans and time !banlist
+//ability to ban ppl as admin !permban ? if temp bans wished: !ban <1d> ex.?
+//end bans: !pardon
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..9596b1a
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,44 @@
+plugins {
+ id 'java'
+}
+
+group 'org.example'
+version '1.0-SNAPSHOT'
+
+repositories {
+ mavenCentral()
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src']
+ }
+ }
+}
+
+dependencies {
+ implementation 'io.sentry:sentry:1.7.23'
+ implementation 'commons-io:commons-io:2.6'
+ implementation 'org.apache.commons:commons-lang3:3.10'
+ implementation 'javax.websocket:javax.websocket-api:1.1'
+ implementation 'org.json:json:20190722'
+ implementation 'org.xerial:sqlite-jdbc:3.8.11.2'
+ implementation 'org.glassfish.tyrus.bundles:tyrus-standalone-client:1.9'
+ implementation 'org.slf4j:slf4j-simple:1.7.9'
+ implementation 'io.github.cdimascio:dotenv-java:2.2.0'
+}
+
+jar {
+ duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+
+ manifest {
+ attributes 'Main-Class' : 'de.gost0r.pickupbot.PickupBotDiscordMain'
+ }
+ destinationDirectory.set(file("$rootDir/"))
+ archiveName 'PickupBot.jar'
+
+ from {
+ configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+}
diff --git a/cmds.txt b/cmds.txt
deleted file mode 100644
index 6705d3f..0000000
--- a/cmds.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-
-CMD PARMS LEVEL EXPLANATION
-!add authed -
-!remove - authed
-!maps - authed
-!map