This commit is contained in:
2025-12-10 22:51:23 +01:00
parent 4a4474873e
commit 4fc92cba82
5 changed files with 58 additions and 59 deletions

3
.gitignore vendored
View File

@@ -9,3 +9,6 @@ target
*.iml
*~
pairgoth.db
ratings
pairgoth
pairgoth.tar.gz

View File

@@ -1,3 +1,5 @@
# This is largely a mirror of the original, adapted for the Slovenian Go Association.
# Pairgoth
Welcome to Pairgoth, your Go Pairing Engine!

23
build.sh Executable file
View File

@@ -0,0 +1,23 @@
mkdir pairgoth
cp application/target/pairgoth-engine.jar pairgoth/
echo "#!/bin/bash" > pairgoth/run.sh
echo "./jdk-11.0.28+6-jre/bin/java -jar pairgoth-engine.jar" >> pairgoth/run.sh
echo "#!/bin/bash" > pairgoth/get_java.sh
echo "wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.28%2B6/OpenJDK11U-jre_x64_linux_hotspot_11.0.28_6.tar.gz" >> pairgoth/get_java.sh
echo "tar -xzf OpenJDK11U-jre_x64_linux_hotspot_11.0.28_6.tar.gz" >> pairgoth/get_java.sh
chmod +x pairgoth/run.sh
chmod +x pairgoth/get_java.sh
echo "" > pairgoth/pairgoth.properties
echo "webapp.env = prod" >> pairgoth/pairgoth.properties
echo "webapp.url = http://localhost:8080" >> pairgoth/pairgoth.properties
echo "auth = none" >> pairgoth/pairgoth.properties
echo "logger.level = info" >> pairgoth/pairgoth.properties
echo "rating.ffg.enable = false" >> pairgoth/pairgoth.properties
echo "webapp.protocol = http" >> pairgoth/pairgoth.properties
tar -czvf pairgoth.tar.gz pairgoth/

View File

@@ -0,0 +1 @@
{"id":4,"type":"INDIVIDUAL","name":"Template","shortName":"20251111-Template","startDate":"2025-11-11","endDate":"2025-11-11","director":"","country":"si","location":"Template","online":false,"komi":6.5,"rules":"JAPANESE","gobanSize":19,"timeSystem":{"type":"CANADIAN","mainTime":2400,"byoyomi":300,"stones":15},"rounds":5,"pairing":{"type":"MAC_MAHON","base":{"nx1":0.5,"dupWeight":5.0E14,"random":0.0,"deterministic":true,"colorBalanceWeight":1000000.0},"main":{"catWeight":2.0E13,"scoreWeight":1.0E11,"upDownWeight":1.0E8,"upDownCompensate":true,"upDownLowerMode":"MIDDLE","upDownUpperMode":"MIDDLE","maximizeSeeding":5000000.0,"firstSeedLastRound":2,"firstSeed":"SPLIT_AND_RANDOM","secondSeed":"SPLIT_AND_FOLD","firstSeedAddCrit":"RATING","secondSeedAddCrit":"NONE","mmsValueAbsent":0.5,"roundDownScore":true,"sosValueAbsentUseBase":true},"secondary":{"barThreshold":true,"rankThreshold":0,"winsThreshold":true,"secWeight":1.0E11},"geo":{"weight":1.0E11,"mmsDiffCountry":1,"mmsDiffClubGroup":3,"mmsDiffClub":3},"handicap":{"weight":0.0,"useMMS":false,"threshold":8,"correction":2,"ceiling":9},"placement":["MMS","SOSM","SOSOSM"],"mmFloor":-20,"mmBar":0},"players":[],"games":[[]]}

View File

@@ -28,70 +28,40 @@
#stop
#end
#set($games = $utils.removeBye($roundPairing.games))
#set($pages = ($games.size() + 3) / 4)
#set($items = $pages * 4)
#foreach($i in [1..$items])
#set($j = ($i - 1) / 4 + (($i - 1) % 4) * $pages)
#if($j < $games.size())
#set($game = $games[$j])
#set($white = $pmap[$game.w])
#set($black = $pmap[$game.b])
#else
#set($game = { 't': 'xxx', 'h': 'xxx' })
#set($white = { 'name': 'xxx', 'firstname': 'xxx', 'rank': -99, 'country': 'XX', 'club': 'xxx' })
#set($black = { 'name': 'xxx', 'firstname': 'xxx', 'rank': -99, 'country': 'XX', 'club': 'xxx' })
#end
#if($foreach.index % 4 == 0)
<div class="page">
#end
<div class="page-item">
<div class="title">$tour.name</div>
<div class="subtitle"></div>
<div class="details">
<div>Table $game.t</div>
<table>
<tr>
<th>Table</th>
<th>Black</th>
<th>Rank</th>
<th>White</th>
<th>Rank</th>
<th>Handicap</th>
<th>Komi</th>
</tr>
#set($numOfPlay = $games.size() - 1)
#foreach($i in [0..$numOfPlay])
#set($game = $games[$i])
#set($white = $pmap[$game.w])
#set($black = $pmap[$game.b])
#set($komi = $tour.komi)
#if($game.h) #set($komi = $komi - $math.floor($komi)) #end
<div>Handicap $game.h &nbsp;&dash;&nbsp; Komi $komi</div>
<div>Round $round</div>
</div>
<div class="instructions">
Surround winner's name or ½-½
</div>
<div class="players">
#if($blackFirst)
<div class="black player">
<div class="color">Black</div>
<div class="name">$black.name $!black.firstname #rank($black.rank)<br/>#if($black.country)($black.country.toUpperCase()#if($black.club), $black.club#end)#end</div>
</div>
<div class="equal">½-½</div>
<div class="white player">
<div class="color">White</div>
<div class="name">$white.name $!white.firstname #rank($white.rank)<br/>#if($white.country)($white.country.toUpperCase()#if($white.club), $white.club#end)#end</div>
</div>
#else
<div class="white player">
<div class="color">White</div>
<div class="name">$white.name $!white.firstname #rank($white.rank)<br/>#if($white.country)($white.country.toUpperCase()#if($white.club), $white.club#end)#end</div>
</div>
<div class="equal">½-½</div>
<div class="black player">
<div class="color">Black</div>
<div class="name">$black.name $!black.firstname #rank($black.rank)<br/>#if($black.country)($black.country.toUpperCase()#if($black.club), $black.club#end)#end</div>
</div>
#set($table = $i + 1)
<tr>
<td>Table $table</td>
<td>$black.name $!black.firstname</td>
<td>#rank($black.rank)</td>
<td>$white.name $!white.firstname</td>
<td>#rank($white.rank)</td>
<td>$game.h</td>
<td>$komi</td>
</tr>
#end
</div>
<div class="signatures">
<div class="signature">Signature:</div>
<div class="equal">&nbsp;&nbsp;&nbsp;</div>
<div class="signature">Signature:</div>
</div>
</div>
#if($foreach.index % 4 == 3)
</div>
#end
#end
</table>
</div>
<script type="text/javascript">
onLoad(() => {