Tutorial for Houdini-Asyncio and Dash

How to configure the server locally on Nginx/Windows
02.08.2020
by desbarmitar (PT) #5488

Important before you start
  • For the tutorial I will use the C:\CPPS folder as the root.
  • If any of these programs are already installed there may be conflicts. I recommend uninstalling it. I am not responsible for conflict errors that appear.

I Part - Downloads

Download Media Files

Legacy - AS2
Vanilla - AS3


Download Houdini

https://github.com/solero/houdini


Download Dash

https://github.com/solero/dash


Download and Install WinNMP

https://sourceforge.net/projects/wtnmp/files/
(20.05 )

Install WinNMP

  • Accept the agreement → Next
  • Folder C:\CPPS\WinNMP → Next
  • Components required: Redis, Last version PHP, Composer.phar and AcmePhp.phar → Next
  • Check the box Add \bin directory to your environmental Path → Next → Install
  • Uncheck the box Launch WinNMP → Finish

Download and Install Python

https://www.python.org/downloads/
(3.8.4)

Install Python

  • Customize installation → Next ->Next
  • Check the box Install for all users
  • Check the box Add Python to environment variables
  • Folder C:\CPPS\Python38 → Install → Close

Download and Install PostgreSQL

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
(12.3)

Install PostgreSQL

  • → Next → Folder C:\CPPS\PostgreSQL\12 → Next
  • Check all components boxes → Next
  • Folder C:\CPPS\PostgreSQL\12\data → Next
  • Password: password → Next … Installing
  • Uncheck the box Stack Builder → Finish

Download and Install Build Tools for Visual Studio 2019

https://visualstudio.microsoft.com/visual-cpp-build-tools/

Install Build Tools

  • → Continue
  • Select Workloads Tab
  • Check the box C++ buid tools → Install
  • Close

II Part - Configurations

Legacy Play Files
  • Extract from legacy-media-(...).zip the folder play to C:\CPPS
  • Rename the folder to old and move to the folder C:\CPPS\WinNMP\WWW
  • Open WinNMP program
  • In the tab Projects select Refresh Projects
  • In the tab Projects select Project Setup - Old (tools icon). Will open the project setup window
  • Check the box Enable Local Virtual Server and click on Edit Nginx Virtual Server

Find
listen 127.0.0.1:80;

Add below
listen *:80;

Find
server_name old.test;

Change to
server_name old.localhost;

Find
allow 127.0.0.1;
deny all;

Change
allow all;
##deny all;

Find and delete
location ~ .php$ {
try_files $uri =404;
include nginx.fastcgi.conf;
include nginx.redis.conf;
fastcgi_pass php_farm;
fastcgi_hide_header X-Powered-By;
}

Find
location / {
try_files $uri $uri/ =404;
}

Add below
location /create_account/create_account.php {
proxy_pass http://localhost:3000/create/legacy;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /create/activate {
proxy_pass http://localhost:3000/create/activate;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

  • Save and close
Legacy Media Files
  • Extract from legacy-media-(...).zip the folder media to C:\CPPS
  • Rename the folder to media1 and move to the folder C:\CPPS\WinNMP\WWW
  • Open WinNMP program
  • In the tab Projects select Refresh Projects
  • In the tab Projects select Project Setup - Media1 (tools icon). Will open the project setup window
  • Check the box Enable Local Virtual Server and click on Edit Nginx Virtual Server

Find
listen 127.0.0.1:80;

Add below
listen *:80;

Find
server_name media1.test;

Change to
server_name media1.localhost;

Find
allow 127.0.0.1;
deny all;

Change
allow all;
##deny all;

  • Save and close
Vanilla Play Files
  • Extract from vanilla-media-(...).zip the folder play to C:\CPPS\WinNMP\WWW
  • Open WinNMP program
  • In the tab Projects select Refresh Projects
  • In the tab Projects select Project Setup - Play (tools icon). Will open the project setup window
  • Check the box Enable Local Virtual Server and click on Edit Nginx Virtual Server

Find
listen 127.0.0.1:80;

Add below
listen *:80;

Find
server_name play.test;

Change to
server_name play.localhost;

Find
allow 127.0.0.1;
deny all;

Change
allow all;
##deny all;

Find
location / {
try_files $uri $uri/ =404;
}

Add below
location ~ ^/(.*)/penguin/create {
proxy_pass http://localhost:3000/create/vanilla/$1;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /penguin/create {
proxy_pass http://localhost:3000/create/vanilla/en;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ~ ^/(.)/penguin/activate/(.) {
proxy_pass http://localhost:3000/activate/vanilla/$1/$2;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ~ ^/(.*)/penguin/activate {
proxy_pass http://localhost:3000/activate/vanilla/$1;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /penguin/activate {
proxy_pass http://localhost:3000/activate/vanilla/en;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ~ ^/(.)/penguin/forgot-password/(.) {
proxy_pass http://localhost:3000/password/$1/$2;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ~ ^/(.*)/penguin/forgot-password {
proxy_pass http://localhost:3000/password/$1;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /penguin/forgot-password {
proxy_pass http://localhost:3000/password/en;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ^/(.*)/web-service/snfgenerator/session$ {
proxy_pass http://localhost:3000/session;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/v0.2/xxx/game/get/world-name-service/start_world_request {
proxy_pass http://localhost:3000/swrequest;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ~ ^/avatar/(.*)/cp$ {
proxy_pass http://localhost:3000/avatar/$1$is_args$args;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

  • Save and close
Vanilla Media Files
  • Extract from vanilla-media-(...).zip the folder media to C:\CPPS\WinNMP\WWW
  • Open WinNMP program
  • In the tab Projects select Refresh Projects
  • In the tab Projects select Project Setup - Media (tools icon). Will open the project setup window
  • Check the box Enable Local Virtual Server and click on Edit Nginx Virtual Server

Find
listen 127.0.0.1:80;

Add below
listen *:80;

Find
server_name media.test;

Change to
server_name media.localhost;

Find
allow 127.0.0.1;
deny all;

Change
allow all;
##deny all;

Find
location / {
try_files $uri $uri/ =404;
}

Add below
location /social/autocomplete/v2/search/suggestions {
proxy_pass http://localhost:3000/autocomplete;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

  • Save and close
Manager
  • Open WinNMP program
  • In the tab Projects select New Project, set the name to secured and Save
  • In the tab Projects select Project Setup - Secured (tools icon). Will open the project setup window
  • Check the box Enable Local Virtual Server and click on Edit Nginx Virtual Server

Find
listen 127.0.0.1:80;

Add below
listen *:80;

Find
server_name secured.test;

Change to
server_name secured.localhost;

Find
allow 127.0.0.1;
deny all;

Change
allow all;
##deny all;

Find
location / {
try_files $uri $uri/ =404;
}

Add below
location /manager {
proxy_pass http://localhost:3000/manager;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

  • Save and close
WinNMP
  • Open ‘HostsEditor’

If is alredy added
127.0.0.1 old.test
127.0.0.1 media1.test
127.0.0.1 play.test
127.0.0.1 media.test
127.0.0.1 secured.test

Change the host names
127.0.0.1 old.localhost
127.0.0.1 media1.localhost
127.0.0.1 play.localhost
127.0.0.1 media.localhost
127.0.0.1 secured.localhost

  • Save and close

Next steps if you use legacy version.

  • Dash create endpoints support Google reCAPTCHA. You require reCAPTCHA v3 keys fromhere.
  • Select type: reCAPTCHA v3 and Insert domain: old.localhost
  • Create the reCAPTCHA and save the two keys in your desktop.
  • Edit C:\CPPS\WinNMP\WWW\old\index.html, C:\CPPS\WinNMP\WWW\old\en\index.html, C:\CPPS\WinNMP\WWW\old\es\index.html, C:\CPPS\WinNMP\WWW\old\fr\index.html and C:\CPPS\WinNMP\WWW\old\pt\index.html files:

Find
data=“http://media.localhost/boots.swf

Change to
data=“http://media1.localhost/boots.swf

Find

> *Add above* > > > > *Change the two SITE-KEY with the site key provided on the Google reCAPTCHA website.*

Next steps if you use vanilla version.

  • Edit C:\CPPS\WinNMP\WWW\play\index.html, C:\CPPS\WinNMP\WWW\play\es\index.html, C:\CPPS\WinNMP\WWW\play\fr\index.html and C:\CPPS\WinNMP\WWW\play\pt\index.html files:

Find
var media = “http://media1.clubpenguin.com/”;

Change to
var media = “http://media.localhost/”;

  • Edit C:\CPPS\WinNMP\WWW\play\web_service\environment_data.xml and C:\CPPS\WinNMP\WWW\media\play\web_service\environment_data.xml files:

name=“play” value=“http://media.localhost/play/
name=“client” value=“http://media.localhost/play/v2/client/
name=“content” value=“http://media.localhost/play/v2/content/
name=“games” value=“http://media.localhost/play/v2/games/
name=“drupal” value=“http://play.localhost/
name=“secured” value=“https://secured.localhost/
name=“config” value=“http://media.localhost/play/


Houdini
  • Extract the folder from ‘houdini-(…).zip’ to C:\CPPS and rename to ‘houdini’
  • Open the thr file C:\CPPS\houdini\requirements.txt

Add to the top
wheel

  • Run the command in this folder (CMD.exe):

pip install -r requirements.txt

  • In the file C:\CPPS\houdini\bootstrap.py find the database_group.add_argument and change the default values if needed

database_address: localhost
database_username: postgres
database_password: password
database_name: postgres


Dash
  • Extract the folder from dash-(...).zip to C:\CPPS and rename to dash
  • Open the folder
  • Run the command in this directory (CMD.exe):

pip install -r requirements.txt

  • Rename the file C:\CPPS\dash\sample.config.py to config.py
  • In the file C:\CPPS\dash\config.py find and change the default values if needed:

postgres_host = ‘localhost’
postgres_name = ‘postgres’
postgres_user = ‘postgres’
postgres_password = ‘password’
approve_username = true
legacy_activate_redirect = ‘http://old.localhost
vanilla_activate_redirect = ‘http://play.localhost
legacy_play_link = ‘http://old.localhost
vanilla_play_link = ‘http://play.localhost

If you use the legacy version:
GSITE_KEY = reCAPTCHA site key for old.localhost
GSECRET_KEY = reCAPTCHA secret key for old.localhost


PostgeSQL
  • Search on Google how to edit the System Variables on your Windows version
  • Search in the Variables Path if is any PostgreSQL related path. If not, add to the end

;C:\CPPS\PostgreSQL\12\lib;C:\CPPS\PostgreSQL\12\bin\

( !!! \PostgreSQL\ is the folder where i install PostgreSQL and can contain a subfolder with the version number \12\)

  • Save and close
  • Open the folder C:\CPPS\houdini
  • Run the command in this directory (CMD.exe):

psql -h localhost -d postgres -U postgres -f houdini.sql

(password: password)


III Part - Run the Servers

WinNMP
  • Open WinNMP, the servers Nginx and Redis should automatically start

Houdini
  • Open the folder C:\CPPS\houdini
  • Run the commands in this folder (CMD.exe):

You can choose which languages you want to use.
Login server required and at least one World server.

python bootstrap.py login
English world Server: python bootstrap.py world -p 9875
Spanish world Server: python bootstrap.py world -p 9876
French world Server: python bootstrap.py world -p 9878
Portuguese world Server: python bootstrap.py world -p 9877


Dash
  • Open the folder C:\CPPS\dash
  • Run the commands in this folder (CMD.exe):

python bootstrap.py -c config.py


If you used this tutorial and it is working, leave a like.

6 Likes

Hi, I followed all of the steps in the guide, double checked and everything seems to be the same, but when I go to create a penguin I’m hit with a 404. So I was looking around and noticed that my url was still play.test and wasn’t redirecting properly. Even changing .test to .localhost for both play and media on everything this guide said to, it still won’t change and I still can’t get past the 404. I’m used to using Xampp and using phpmyadmin, so I’m a little unsure what I’m doing here.

I updated the tutorial, tested and working.

So, I’ve got everything up and running as specified in the tutorial, only problem I’m having is that WinNMP still tries to pull up ‘play.test’ instead of ‘play.localhost’ and such. I’ve changed it everywhere that ‘play.test’ appears but no dice. Any ideas of how to fix this? When I select ‘project setup’, the link still says ‘http://play.test’ and the ‘help’ link to the right of it is not actually any help at all lol

The button ‘project setup’ dont change. You need to use the link http://play.localhost in your browser.

Okay, the webpage loads and I’m able to create a penguin just fine. But when I go to login and select the Blizzard server, it just sits here infinitely loading. I started both the Houdini login and world servers, and started Dash as well but I’m not able to do anything else.

The world command for Blizzard (English server) is python bootstrap.py world -p 9875

That’s what I was using. Do I need to use seperate cmds for the login and blizzard server, or should they be run in the same cmd? I got wand running in a linux virtual box and there everything runs in the same terminal and works. I’d just rather get this up and running in Windows since I’m more comfortable with it.

You need to run the commands in separated cmds. (the login in one and the world in other)

im getting infinite freeze when i try to enable local virtual server, doesnt matter if its for media or play, winnmp doesnt let me enable it. help pls. its not the file size neither a problem because tested with empty folder and same

Hey, how’s it going?

Can you help me? I’m confused about where to change reCAPCHA keys for “legacy” servers.