Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin panel upgrade server updates #54

Merged
merged 14 commits into from
Oct 17, 2024

Conversation

Opaque02
Copy link
Contributor

@Opaque02 Opaque02 commented Sep 22, 2024

What is this?

This is an update to the admin panel, and is the server code for this pokerogue PR.

What this do?

This PR add the functionality for the server to a) check if a username exists, b) link/unlink google accounts from usernames, and unlink discord accounts from usernames and c) return an admin search object for the admin panel that consists of a username, discord ID, google ID and last logged in date.

How to test the changes:

You need to set up your own server and pull this PR. Any questions with that, ask me in discord, or ask Walker, though we have this thread in discord that we used to get things set up - it's a lot of info but it should have a lot of troubleshooting steps that we did to get it working.

Once your server is set up, make sure you also have access to the DB. I'm using MySQLWorkbench to let me see the db, but you can use anything as long as it can connect to a maria DB instance.

Once everything is set up, in your server, you'll need to change the some files. If you would like to see any of these in action, you can check some previous commits to see what I used to have for my testing, since I committed my testing changes:

First there's a file called beta.env in the main project folder that looks like this:

VITE_BYPASS_LOGIN=0
VITE_BYPASS_TUTORIAL=0
VITE_SERVER_URL=http://{serverIP}:8001
VITE_DISCORD_CLIENT_ID=1248062921129459756
VITE_GOOGLE_CLIENT_ID=955345393540-2k6lfftf0fdnb0krqmpthjnqavfvvf73.apps.googleusercontent.com
VITE_I18N_DEBUG=1
debug=true
dbaddr=db
dbuser=pokerogue
dbpass=pokerogue
dbname=pokeroguedb 
gameurl=http://{devMachineIP}:8000 
callbackurl=http://{serverIP}:8001

Here I've used {serverIP} in a few places and {devMachineIP} for the gameurl - for me, my server machine and my dev machine are two different machines, so my gameurl is a different IP compared to my server IP. However, if this is not the case, you should be able to use your dev machine's IP for all cases of devMachineIP and serverIP instead.

Next, in your docker-compose.Example.yml, under services->server add the following code:

env_file:
      - beta.env
    image: rogueserver:latest

This makes the game use your beta.env file from above, and also makes sure to pull the edited version of rogueserver instead of master branch. Finally, add the following to services->db:

ports:
      - "3306:3306"

This makes sure the DB is using the right port.

To run it, open a cmd at the location of your rogueserver folder and run this code:

docker build ./ -t rogueserver

This will build the server using the code provided. Once that's done, use this code to set everything up using the docker-compose file we updated before:

docker-compose -f docker-compose.Example.yml up -d

Hopefully if you go to run it, all 3 parts will be good, and going into the server to see the logs will show you the daily seed (see below):

image
image

@Opaque02 Opaque02 changed the title Changes for testing Admin panel unlinking server updates Sep 25, 2024
docker-compose.Example.yml Outdated Show resolved Hide resolved
@Opaque02 Opaque02 changed the title Admin panel unlinking server updates Admin panel upgrade server updates Sep 29, 2024
@Opaque02 Opaque02 marked this pull request as ready for review October 15, 2024 06:05
@patapancakes patapancakes merged commit 4304969 into pagefaultgames:master Oct 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants