For now, the game manager does not give us a way to link quests/objectives to players, so we will need to do it manually. The entire process involves MySQL queries.
# Getting into MySQL
If you are doing this with a local database, do the following steps:
1. Open Docker
2. Click the three dots to the right of the frpg_mysql container
3. Click `Open in terminal`.
4. Run this command: `mysql`
If you are doing this on the production server, do the following steps:
1. SSH into the server. there is a guide for this [here.](Connecting With SSH)
2. Run this command: `docker exec -it frpg_mysql mysql`
# Linking steps
Open up a separate notepad. This will help you keep track of some values. As we go through, we will be collecting several values, so that when we make our change, we can easily input those values without having to go back and look for them again.
1. Run this command: `use frpg;`
Now, let's look for these values. For each value, run the associated query, and look for the respective column.
1. playerID:
- Query is `select * from PlayerLogins;`
- Look for playerID in the first column. playerName, the second column, should help you identify the correct user.
- Write the playerID down in your notepad.
2. questID and objectiveID:
- Query is `select * from Objectives\G`
- Look for objectiveID in the first column. objectiveDescription, the second column, should help you identify the correct objective.
- You will also find the questID here, in the third column.
- Write the objectiveID and questID down in your notepad.
Now, we'll need to add a row (per player) to 2 tables: `QuestStates` and `ObjectiveStates`. This is where the quests and objectives are linked to the player.
1. For QuestStates:
- Run this command: `select * from QuestStates;`
- Take note of the column names. They should be playerID, questID, questState, and needingNotification.
- Run this command: `insert into QuestStates(playerID,questID,questState,needingNotification) values(PID,QID,1,0);`
- Be sure to replace playerID and questID with the values you wrote down.
- replace PID with playerID
- replace QID with questID
<br>
2. For ObjectiveStates:
- Run this command: `select * from ObjectiveStates;`
- Take note of the column names. They should be objectiveID, questID, playerID, objectiveState, and needingNotification.
- Run this command: `insert into QuestStates(objectiveID,questID,playerID,objectiveState,needingNotification) values(OID,QID,PID,1,0);`
- Be sure to replace OID, QID, and PID with the values you wrote down.
- replace OID with objectiveID
- replace QID with questID
- replace PID with playerID
The quest and objective should now be linked to the player. To test, login to the mobile app and see if the objective is there!