Testing Changes - koreanpanda345/Pokemon-Showdown-Server-Guide GitHub Wiki
To test changes, we need to run both the client and the server. But before we do that, we need to execute the build tools. Check my notes on Using Build Tools to learn about that.
Executing on windows is different from executing on linux. I don't know what the process is for Mac, but I think its similar to Linux.
Pre-Requisites
- Node Js Version 10.x or greater.
Running on Windows.
In order to run both, you have to run two consoles, one for the client, one for the server.
It does not matter what Console you use, you can use Command Prompt, or Powershell, they both work the same.
- Open one console in the client folder.
- type in
npx http-server. - Open another console in the server folder.
- type in
node pokemon-showdown
There you go. You successfully run both the client, and the server.
Running on Mac/ Linux
In Linux, you can run multiple process in one console.
- open a console in the client folder.
- type in
npx http-server &. The & means that it will run in the background process. - type in
cd data/pokemon-showdown. This will take you to the server folder. - type in
node pokemon-showdown
You successfully run both the client, and the server.
To stop the process, do the following:
- In the console type in
ctrl + c, if it askes if you want to Terminate the Process, type iny. - Type in
sudo pkill node. you might need to enter you password to use sudo. This will stop the client process.
Testing Changes
To Test our changes, we need to open a web browser. It doesn't matter what web browser, just has to be one that showdown can be run on. I am using chrome to do my tests.
What we are going to do is enter into the testclient.html. however we are going to connect it to our server through the url.
When you are entering the testclient.html for the first time, you will be prompted witha popup. This popup is most likely talking about the testclient-key.js file. This file is needed to enter the testclient.html, without having to deal with the box all the time.
To Do this, access your cookies. (I will be using google chrome, as that is what most people will be using.) If you don't know how to do this on chrome, then click on the i in the circle, then click on cookies. Once you are in the cookies, look for play.pokemonshowdown.com. click on that, then look for something labeled sid. Once you find it, copy the content of it, then make a new file in the client/config folder, called testclient-key.js.
inside this folder you will need to paste what you copied as a value for a variable called TESTCLIENT_KEY. This will be used to login you into the testclient.html.
type in: http://localhost:8080/testclient.html?~~localhost:8000
this will take you to pokemon showdown, but on your client, that is connected to the server side. You can now check to see if your changes worked or not.