From b329877c566f5687242d668faf437f3d2660492f Mon Sep 17 00:00:00 2001 From: Marwolf Date: Thu, 9 Aug 2018 16:41:16 -0400 Subject: [PATCH] Generates dat files at launch based on database, moves to local cache Ensures devs are using the cache associated with the repo, not what the game launcher last gave them. --- Start_Single_Player_Game_Linux_Mac.sh | 28 ++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Start_Single_Player_Game_Linux_Mac.sh b/Start_Single_Player_Game_Linux_Mac.sh index 8621d9e..a672cb8 100755 --- a/Start_Single_Player_Game_Linux_Mac.sh +++ b/Start_Single_Player_Game_Linux_Mac.sh @@ -25,7 +25,33 @@ sudo ant -f Game/server/build.xml compile echo "" echo "" -# Rune the game client in a new window +#Create game cache +echo "Removing old then extracting a fresh client cache to your home folder." +echo "" +sudo rm -rf ~/OpenRSC +mkdir ~/OpenRSC +unzip -o Game/client/cache.zip -d ~/OpenRSC +echo "" +echo "" + +#Import fresh version of config database +echo "Importing a fresh openrsc_config.sql database." +echo "" +sudo docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"root" -p"root" < Game/Databases/openrsc_config.sql 2>/dev/null +echo "" +echo "" + +#Generate updated cache files, copies them to cache folder overwriting existing +echo "Generating cache .dat files from current config database and copying to client cache in your home folder." +echo "" +sudo ant -f Game/server/build.xml npcs items objects > /dev/null +yes | cp -rf Game/server/npcs.dat ~/OpenRSC/npcs.dat +yes | cp -rf Game/server/objects.dat ~/OpenRSC/objects.dat +yes | cp -rf Game/server/items.dat ~/OpenRSC/items.dat +echo "" +echo "" + +# Run the game client in a new window echo "Launching the game client." echo "" ant -f Game/client/build.xml runclient &