Skip to content

Instantly share code, notes, and snippets.

@beminee
Last active March 29, 2021 03:45
Show Gist options
  • Save beminee/e1670f449d82c96bac55107c9c37da00 to your computer and use it in GitHub Desktop.
Save beminee/e1670f449d82c96bac55107c9c37da00 to your computer and use it in GitHub Desktop.

Ubuntu 16.04 Installation:

Installing prerequisites

sudo su
apt-get update
apt-get install default-jdk

Downloading the source and getting it ready

git clone https://github.com/ajanata/PretendYoureXyzzy.git
cd PretendYoureXyzzy
mv "build.properties.example" "build.properties"

now you might want to edit build.properties a bit;

nano build.properties

on line 13; you might want to add your own IP adress in order to be able to reach admin.jsp.

pyx.admin_addrs=ADD.YOUR.IP.ADRESS,127.0.0.1,0:0:0:0:0:0:0:1

you need to uncomment line 61 to 63 and comment 65 to 68. Also change

hibernate.url=jdbc:postgresql://localhost/pyx to hibernate.url=jdbc:postgresql://localhost/cah

60 # for production use, use postgres
61 hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
62 hibernate.driver_class=org.postgresql.Driver
63 hibernate.url=jdbc:postgresql://localhost/cah
64
65 # for local use, you can also use sqlite
66 # hibernate.dialect=net.socialgamer.cah.hibernate.SqliteDialect
67 # hibernate.driver_class=org.sqlite.JDBC
68 # hibernate.url=jdbc:sqlite:pyx.sqlite

then you need to set your password on line 72

# these likely need specified even with sqlite, even though they don't matter
hibernate.username=pyx
hibernate.password=PASSWORDHERE

Setting up the Tomcat Server

apt-get install tomcat7 tomcat7-admin

once all the installations have finished you will need to stop the tomcat service

service tomcat7 stop

next, you have to edit users file in order to add yourself an administrator account

sudo nano /etc/tomcat7/tomcat-users.xml

there, you might see tomcat-users tag. You need to add the following line inside of that tag, obviously replacing username and password with something you are comfortable with.

<user username="admin" password="password" roles="manager-gui,admin-gui"/>

Setting up the PostgreSQL

now we need to install PostgreSQL for our database.

apt-get install postgresql

switch to postgres user

sudo -i -u postgres

Then run the following by order, don't forget to replace information (username and password in build.properties should match these ones)

createdb cah
psql template1
CREATE USER pyx WITH PASSWORD 'PASSWORDHERE';
GRANT ALL PRIVILEGES ON DATABASE "cah" to pyx;
\q
exit

now, you finally can import .sql file

psql -h localhost -d cah -U pyx -f cah_cards.sql

Building and running the source

you need to install Maven package in order to build the source code

apt-get install maven

after the installation is done, it's time to build and run it

mvn clean package war:war -Dmaven.buildNumber.doCheck=false -Dmaven.buildNumber.doUpdate=false

you will get a file called ZY.war inside of the target file.

at this point, you need to start tomcat service back up

service tomcat7 start

afterwards, you need to go to: http://localhost:8080/manager/html/

login with information you set when you were editing the tomcat-users.xml file.

Then deploy the ZY.war

last thing to do is restarting the tomcat service:

service tomcat7 restart

then all you have to do is, go:

tomcat: http://localhost:8080/ZY/game.jsp

@dheimerl
Copy link

the src/main/java/net/socialgamer/cah/data/GameOptions.java has this line
public static final int MAX_BLANK_CARD_LIMIT = 30;

Change that to what you want the limit to be for blank cards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment