How to make a CPPS (full tutorial and localhosted)

If you’re not Zara,You will be able to make one.

First, you must know what a cpps(club penguin private server) is,and have the following files:

Basic Media Files: http://www.mediafire.com/?ogyveb906z585p7(if link doesn’t work try typing client(13) zip in Google)

Penguin Elite Source: http://www.mediafire.com/?cq352d0mc13e2xq(any other source will do)

Register: http://www.mediafire.com/?rbz11zo0zbcg2bn

XAAMP: Don’t have the link, but you can download it form Apache Friends.

Introduction

First of all, your going to need some files. These include a media server, a simple source and XAMPP. See the links chapter to get these files.

 

Step 1 – Starting Apache and MySQL

Once you have gathered the files you need, you are ready to start setting up your server. Open your XAMPP Control Panel and press ‘Start Apache’ and ‘Start MySQL’.

 

Step 2 – Creating Penguin Database

Open a web browser and type in ‘http://localhost/phpmyadmin’. This will open up your database, and yes, that wasn’t hard :D.

Now, to setup your penguin user tables your going to need to get the .sql installation file within the source (for purposes of this tutorial, we are going to use Penguin Elite’s source. Link on link chapter.) On the page you just went to, it will say ‘Create new database’, type in a database name and press Create.

If it shows a green tick, then the Query for executing creation of a new database was successful.

 

Step 3 – Setting up Penguin Table

Open up the source you downloaded. The source linked in this tutorial contains a file names ‘install.sql’. Your going to need to Import this file into your database. Before, we do, we need to edit it. Open it with Notepad or any other compatible text editing application. It should look like this: (spaces are huge but nothing is missing)

 

CREATE DATABASE IF NOT EXISTS opencp;

 

SET SQL_MODE=”NO_AUTO_VALUE_ON_ZERO”;

 

 

 

CREATE TABLE IF NOT EXISTS `ps_users` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`username` varchar(20) NOT NULL,

`nickname` varchar(20) NOT NULL,

`email` varchar(999) NOT NULL,

`password` varchar(999) NOT NULL,

`active` int(1) NOT NULL DEFAULT ‘0’,

`ubdate` varchar(255) NOT NULL,

`items` longblob NOT NULL,

`curhead` varchar(10) NOT NULL DEFAULT ‘0’,

`curface` varchar(10) NOT NULL DEFAULT ‘0’,

`curneck` varchar(10) NOT NULL DEFAULT ‘0’,

`curbody` varchar(10) NOT NULL DEFAULT ‘0’,

`curhands` varchar(10) NOT NULL DEFAULT ‘0’,

`curfeet` varchar(10) NOT NULL DEFAULT ‘0’,

`curphoto` varchar(10) NOT NULL DEFAULT ‘0’,

`curflag` varchar(10) NOT NULL DEFAULT ‘0’,

`colour` varchar(10) NOT NULL DEFAULT ‘1’,

`buddies` longtext NOT NULL,

`ignore` longtext NOT NULL,

`joindate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

`lkey` varchar(50) NOT NULL,

`coins` int(11) NOT NULL,

`ismoderator` int(11) NOT NULL,

`rank` int(11) NOT NULL DEFAULT ‘1’,

`ips` longtext,

PRIMARY KEY (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

 

Now make it look like this:

 

CREATE TABLE IF NOT EXISTS `ps_users` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`username` varchar(20) NOT NULL,

`nickname` varchar(20) NOT NULL,

`email` varchar(999) NOT NULL,

`password` varchar(999) NOT NULL,

`active` int(1) NOT NULL DEFAULT ‘0’,

`ubdate` varchar(255) NOT NULL,

`items` longblob NOT NULL,

`curhead` varchar(10) NOT NULL DEFAULT ‘0’,

`curface` varchar(10) NOT NULL DEFAULT ‘0’,

`curneck` varchar(10) NOT NULL DEFAULT ‘0’,

`curbody` varchar(10) NOT NULL DEFAULT ‘0’,

`curhands` varchar(10) NOT NULL DEFAULT ‘0’,

`curfeet` varchar(10) NOT NULL DEFAULT ‘0’,

`curphoto` varchar(10) NOT NULL DEFAULT ‘0’,

`curflag` varchar(10) NOT NULL DEFAULT ‘0’,

`colour` varchar(10) NOT NULL DEFAULT ‘1’,

`buddies` longtext NOT NULL,

`ignore` longtext NOT NULL,

`joindate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

`lkey` varchar(50) NOT NULL,

`coins` int(11) NOT NULL,

`ismoderator` int(11) NOT NULL,

`rank` int(11) NOT NULL DEFAULT ‘1’,

`ips` longtext,

PRIMARY KEY (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

 

 

Save the file, and then go back to the database in your browser. At the top, you will see tabs. Click the one that says ‘Import’. Click ‘Choose file’ button on the Import page, and open the ‘install.sql’ file we just edited. Then click the ‘Go’ button at the bottom.

 

If everything went well, a table should appear on the sidebar.

Now remember the Database name you gave your Penguin Database, and make sure you remember the name of the Penguin Table (if you don’t change it, it will be ‘ps_users’)

 

Step 4 – Creating your Register

Okay, now your ready to create your register. Your going to need the register file in the links chapter at the bottom. This file is called ‘register.php’, it is a file you are going to need to edit. First of all when the file has downloaded, save it to this path on your computer: C:\xampp\htdocs\. (Or go to ‘My Computer’/’Computer’, then click on your ‘C:’ hard drive folder and open it. Look for a folder called  ‘xampp’ open it and then go to the ‘htdocs’ folder within, open that. Now drag and drop ‘register.php’ into htdocs. Now edit register.php. This is what it looks like:

 

<?php

$dbhost = “localhost”;

$dbname = “game”;

$dbuser = “root”;

$dbpass = “y3582468Y”;

$username = “This Name Is Too Long And Will Not Work With The Game So It Is Invalid So Enter A Real Username That Is Valid When Signing Up”;

$email = “thisisafakeinvalidemailanddoesnotworksoenteryouremailwhensigningup”;

$colour = 1;

 

function check_email_address($email) {

if (!ereg(“^[^@]{1,64}@[^@]{1,255}$”, $email)) {

return false;

}

$email_array = explode(“@”, $email);

$local_array = explode(“.”, $email_array[0]);

for ($i = 0; $i < sizeof($local_array); $i++) {

if (!ereg(“^(([A-Za-z0-9!#$%&’*+/=?^_`{|}~-][A-Za-z0-9!#$%&

?’*+/=?^_`{|}~\.-]{0,63})|(\”[^(\\|\”)]{0,62}\”))$”,

$local_array[$i])) {

return false;

}

}

if (!ereg(“^\[?[0-9\.]+\]?$”, $email_array[1])) {

$domain_array = explode(“.”, $email_array[1]);

if (sizeof($domain_array) < 2) {

return false;

}

for ($i = 0; $i < sizeof($domain_array); $i++) {

if

(!ereg(“^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|

?([A-Za-z0-9]+))$”,

$domain_array[$i])) {

return false;

}

}

}

return true;

}

function error($error){

$fullerror = “<h1><FONT FACE=\”arial\” COLOR=\”white\”>We have found an error!</FONT></h1><p><FONT FACE=\”arial\” COLOR=\”white\”>”.$error.”</FONT></p>”;

die($fullerror);

}

 

 

mysql_connect($dbhost, $dbuser, $dbpass)or error(“Could not connect: “.mysql_error());

mysql_select_db($dbname) or error(mysql_error());

 

if (isset($_POST[‘submit’])) {

 

if (!$_POST[‘username’] | !$_POST[‘pass’] | !$_POST[‘pass2’] ) {

error(‘You did not complete all of the required fields’);

}

if($_POST[‘colour’] >= 16){

error(‘That color is not an in game color!’);

}

 

if (!get_magic_quotes_gpc()) {

$_POST[‘username’] = addslashes($_POST[‘username’]);

}

if(ereg(“[^A-Za-z0-9_ #$&’*+/=?^_`{}~-<>]”, $_POST[‘username’])){

error(“Your name is invalid. Please try using letters numbers, and a few special characters”);

}

if (!preg_match(‘/[a-z0-9 ]/i’, $_POST[‘username’])) {

error(“Your name is invalid. Please try using letters numbers, and a few special characters”);

}

if (preg_match(‘/[|]/i’, $_POST[‘username’])) {

error(“Your name is invalid. Please try using letters numbers, and a few special characters”);

}

if (preg_match(‘/[%]/i’, $_POST[‘username’])) {

error(“Your name is invalid. Please try using letters numbers, and a few special characters”);

}

if(substr($_POST[‘username’], 0,1) == ” ” || substr(strrev($_POST[‘username’]), 0,1) == ” “){

error(‘Error in Username’);

}

$_POST[‘username’] =  mysql_real_escape_string($_POST[‘username’]);

$_POST[‘pass’] =  mysql_real_escape_string($_POST[‘pass’]);

$_POST[‘colour’] =  mysql_real_escape_string($_POST[‘colour’]);

$_POST[’email’] =  mysql_real_escape_string($_POST[’email’]);

if (!get_magic_quotes_gpc()) {

$_POST[‘pass’] = addslashes($_POST[‘pass’]);

$_POST[’email’] = addslashes($_POST[’email’]);

$_POST[‘colour’] = addslashes($_POST[‘colour’]);

$_POST[‘username’] = addslashes($_POST[‘username’]);

}

$usercheck = $_POST[‘username’];

$check = mysql_query(“SELECT username FROM ps_users WHERE username = ‘$usercheck'”)

or error(mysql_error());

$check2 = mysql_num_rows($check);

if(check_email_address($_POST[’email’]) == false){

error(“Invalid Email!”);

}

 

if ($check2 != 0) {

error(‘Sorry, the username ‘.$_POST[‘username’].’ is already in use.’);

}

 

if ($_POST[‘pass’] != $_POST[‘pass2’]) {

error(‘Your passwords did not match. ‘);

}

if(strlen($_POST[‘pass’]) <= 5){

error(‘Your password is too short! It needs to be 5 caracteres or over, as this minimizes the risk of stolen passwords.’);

}

if(strlen($_POST[‘username’]) <= 3){

error(‘Your username is too short! ‘);

}

 

$_POST[‘pass’] =  strtoupper(hash(‘md5’, $_POST[‘pass’]));

 

if($_POST[‘colour’] == “r”){

$_POST[‘colour’] = rand(1,15);

}

$insert = “INSERT INTO ps_users (`id`, `username`, `nickname`, `email`, `password`, `active`, `ubdate`, `items`, `curhead`, `curface`, `curneck`, `curbody`, `curhands`, `curfeet`, `curphoto`, `curflag`, `colour`, `buddies`, `ignore`, `joindate`, `lkey`, `coins`, `ismoderator`, `rank`, `ips`) VALUES (NULL, ‘”.$_POST[‘username’].”‘, ‘”.$_POST[‘username’].”‘, ‘”.$_POST[’email’].”‘, ‘”.$_POST[‘pass’].”‘, ‘1’, ‘0’, ”, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘”.$_POST[‘colour’].”‘, ”, ”, CURRENT_TIMESTAMP, ”, ‘1000000’, ‘0’, ‘1’, ‘”.$ip.”‘)”;

//$log = “Username: “.$_POST[‘username’].” Pass:”.$_POST[‘pass’].” Colour:”.$_POST[‘colour’].” Email:”.$_POST[’email’].” IP:”.$ip.” \n”;

//file_put_contents(“log.txt”, $log, FILE_APPEND | LOCK_EX);

$add_member = mysql_query($insert);

?>

 

<h1><FONT FACE=”arial” COLOR=”#ffffff”>Thanks For Registering</FONT></h1>

<p><FONT FACE=”arial” COLOR=”#ffffff”>Now Get OFF THIS PAGE & START PLAYING!</FONT></p>

<p><FONT FACE=”arial” COLOR=”#ffffff”><small><small>Powered By Ghetto Penguin</small></small></FONT></p>

<?php }

else { ?>

<form action=”<?php echo $_SERVER[‘PHP_SELF’]; ?>” method=”post”>

<table border=”0″>

<tr><td><FONT FACE=”arial” COLOR=”#ffffff”>Username:</FONT></td><td>

<input type=”text” name=”username” maxlength=”60″>

</td></tr>

<tr><td><FONT FACE=”arial” COLOR=”#ffffff”>Email Address:</FONT></td><td>

<input type=”text” name=”email” maxlength=”60″>

</td></tr>

<tr><td><FONT FACE=”arial” COLOR=”#ffffff”>Password:</FONT></td><td>

<input type=”password” name=”pass” maxlength=”10″>

</td></tr>

<tr><td><FONT FACE=”arial” COLOR=”#ffffff”>Confirm Password:</FONT></td><td>

<input type=”password” name=”pass2″ maxlength=”10″>

</td></tr>

<tr><td><FONT FACE=”arial” COLOR=”#ffffff”>Color:</FONT></td><td>

<select name=”colour” id=”colour”>

<option value=”0″ selected=”true”>Random</option>

<option value=”1″ >Blue</option>

<option value=”2″>Green</option>

<option value=”3″>Pink</option>

<option value=”4″>Black</option>

<option value=”5″>Red</option>

<option value=”6″>Orange</option>

<option value=”7″>Yellow</option>

<option value=”8″>Dark Purple</option>

<option value=”9″>Brown</option>

<option value=”10″>Peach</option>

<option value=”11″>Dark Green</option>

<option value=”12″>Light Blue</option>

<option value=”13″>Light Green</option>

<option value=”14″>Gray</option>

<option value=”15″>Aqua</option>

</select>

</td></tr>

<tr><th colspan=2><input type=”submit” name=”submit”

value=”Register”></th></tr> </table>

</form>

<?php

} ?>

 

You must change these lines:

$dbhost = “localhost”;

$dbname = “game”;

$dbuser = “root”;

$dbpass = “”;

 

.. to look like this:

 

$dbhost = “localhost”;

$dbname = “penguin database”; <<Put your Penguin Database name in here

$dbuser = “root”;

$dbpass = “”;

 

Save that file and then test it. Go to http://localhost/register.php

If it lets you make a Penguin and it turns out successful, then you’ve just made a working register! If theres a problem, make sure the table name within the register file is set to the name of the table on the sidebar on the database, and it looks exactly like it does above. (If you’ve got a local hosted mysql password, fill it in)

 

Step 5 – Configuring the Source

Now, go back to Penguin Elite (PE_Public) source you downloaded where we found install.sql. In there, there are 3 XML files. We need to edit all 3 of them.

Open these files:

config.xml

config2.xml

config3.xml

 

Change them all to the following:

 

==================

Change config.xml to:

 

<penguinelite>

<port>6112</port>

<ip>0</ip>

<type>login</type>

<mysql>

<host>127.0.0.1</host>

<username>root</username>

<dbname>penguin database</dbname> <<Put your Penguin Database name in here

<password></password>

<userTableName>ps_users</userTableName> <<Put your Penguin Table name in here (if you didn’t change it, leave it :P)

</mysql>

</penguinelite>

 

==================

Change config2.xml to:

 

<penguinelite>

<port>6113</port>

<ip>0</ip>

<type>game</type>

<mysql>

<host>127.0.0.1</host>

<username>root</username>

<dbname>penguin database</dbname> <<Put your Penguin Database name in here

<password></password>

<userTableName>ps_users</userTableName> <<Put your Penguin Table name in here (if you didn’t change it, leave it :P)

</mysql>

</penguinelite>

 

=================

 

Change config3.xml to:

 

<penguinelite>

<port>6114</port>

<ip>0</ip>

<type>game</type>

<mysql>

<host>127.0.0.1</host>

<username>root</username>

<dbname>penguin database</dbname> <<Put your Penguin Database name in here

<password></password>

<userTableName>ps_users</userTableName> <<Put your Penguin Table name in here (if you didn’t change it, leave it :P)

</mysql>

</penguinelite>

 

Now there is another file called ‘config.php’, open that one too.

 

Change config.php to:

 

<?php

$ServerName = “Test CPPS”; //The name of your CPPS here

$mysqlhost = “127.0.0.1”;

$mysqluser = “root”;

$mysqlpass = “”;

$database = “penguin database”; //Put your Penguin Database name in here

$table = “ps_users”; // << Put your Penguin Table name in here (if you didn’t change it, leave it :P)

$loginIP = “127.0.0.1”;

$loginPort = “6112”

$server1IP = “127.0.0.1”;

$server1Port = “6113”;

$server1Name = “server1”;

$server2IP = “127.0.0.1”;

$server2Port = “6114”;

$server2Name = “server2”;

$BotName = “Bot”;

?>

 

Save it. Now your ready to start up your login, and game server. To do this, open ‘Run Game.bat’ in the source folder and ‘Run Login.bat’. If they open properly, your ready to move onto the next step.

 

Step 6 – Making your loader

Now, this is where your going to need to use the Basic Media Server files. Unzip the ‘play’ folder within client(13).zip. As you did with ‘register.php’, you need to move the play folder to C:\xampp\htdocs\. The play folder is quite large so expect to wait while you move this into htdocs. When it is in htdocs, go into the play folder. In there, open the ‘src’ folder. You will see a file and a folder in there called ‘load.fla’ file and a folder called ‘com’.

 

First, open the ‘load.fla’ file in there. You will need Adobe Flash Professional to edit these files. You can download it at www.adobe.com/flash. When its open, go back to the folder and open ‘com > hypeCP > loader’ then open the file called ‘loader.as’. Open it with Adobe Flash. Change it EXACTLY to this:

<THE BOLD ARE THE LINES YOU NEED TO EDIT> NOTE: THERE IS A LITTLE THING RIGHT AT THE BOTTOM OF THIS CODE YOU NEED TO EDIT 😉 (DONT PUT THIS LINE INxD)

========================================================

class com.hypeCP.loader.loader

{

var PLUGIN_HOLDER, loadSWFb, CLIENT, onEnterFrame;

function loader(arg)

{

HANDLERS.SHELL = {};

HANDLERS.AIRTOWER = {};

HANDLERS.LOCAL_CRUMBS = {};

HANDLERS.GLOBAL_CRUMBS = {};

HANDLERS.ENGINE = {};

HANDLERS.INTERFACE = {};

this._addReplace(function (url)

{

return (url);

});

 _global.baseURL = “http://localhost/&#8221;;

System.security.allowDomain(“*”);

loadMovieNum(“http://localhost/play/v2/client/load.swf?cp1356&#8221;, 1);

_root.onEnterFrame = function ()

{

for (var _loc11 in _level1)

{

if (typeof(_level1[_loc11]) == “movieclip”)

{

_level1.bootLoader.messageFromAS3({type: “setEnvironmentData”, data: {clientPath: “http://localhost/play/v2/client/&#8221;, contentPath: “http://localhost/play/v2/content/&#8221;, gamesPath: “http://localhost/play/v2/games/&#8221;, connectionID: “hype127”, language: “en”, basePath: “”, affiliateID: “0”}});

_root.onEnterFrame = function ()

{

if (_level1.shellContainer.DEPENDENCIES_FILENAME)

{

_level1.bootLoader.messageFromAS3({type: “showLogin”});

_level0.CLIENT.handleContainerFound(_level0.CLIENT.PENGUIN = _level1.shellContainer);

} // end if

};

} // end if

} // end of for…in

};

} // End of the function

function handlePluginLoaded(pluginFunction, inter)

{

if (PENGUIN.AIRTOWER && (!inter || PENGUIN.INTERFACE))

{

pluginFunction();

}

else

{

PLUGINS.push([pluginFunction, inter]);

} // end else if

} // End of the function

function handleContainerFound(container)

{

this.PLUGIN_HOLDER = this.PENGUIN.createEmptyMovieClip(“pluginContainer_mc”, 65535);

_global.PenguBackup = container;

with (container)

{

if (LOCAL_CRUMBS)

{

_level0.CLIENT._fireEvent(“LOCAL_CRUMBS”);

} // end if

if (GLOBAL_CRUMBS)

{

_level0.CLIENT._fireEvent(“GLOBAL_CRUMBS”);

} // end if

if (AIRTOWER)

{

_level0.CLIENT._fireEvent(“AIRTOWER”);

} // end if

if (SHELL)

{

_level0.CLIENT._fireEvent(“SHELL”);

} // end if

if (!LOCAL_CRUMBS)

{

return;

} // end if

for (var i in this.FAKE_LANG)

{

LOCAL_CRUMBS.lang[i] = this.FAKE_LANG[i];

} // end of for…in

if (!GLOBAL_CRUMBS || !AIRTOWER || !SHELL)

{

return;

} // end if

createEmptyMovieClip(“addons_mc”, _level1.getNextHighestDepth());

SHELL.analytics = false;

SHELL.hideErrorPrompt();

GLOBAL_CRUMBS.login_server.ip = [this.HOST];

GLOBAL_CRUMBS.login_server.even_port = 6112;

GLOBAL_CRUMBS.login_server.odd_port = 6112;

GLOBAL_CRUMBS.redemption_server.ip = this.HOST;

GLOBAL_CRUMBS.redemption_server.port = 6113;

AIRTOWER.LOGIN_IP = this.HOST;

AIRTOWER.LOGIN_PORT_EVEN = 6112;

AIRTOWER.LOGIN_PORT_ODD = 6112;

AIRTOWER.PLUGIN_LOAD = “pl”;

AIRTOWER.SERVER_DATA = “sd”;

AIRTOWER.GET_VERSION = “gv”;

AIRTOWER.GET_SERVERS = “gs”;

AIRTOWER.MOD_REQUEST = “xy”;

AIRTOWER.SWF_COMMAND = “fc”;

AIRTOWER.UPDATE_MOOD = “umo”;

AIRTOWER.PRIVATE_MSG = “pmsg”;

AIRTOWER.GET_USERLOG = “glog”;

AIRTOWER.NEW_USERLOG = “nlog”;

AIRTOWER.TIMER_KICK = “tk”;

AIRTOWER.LOAD_MOVIE = “lm”;

SHELL.e_func[SHELL.KICK] = function ()

{

trace (“Kicked”);

};

AIRTOWER.addListener(AIRTOWER.PLUGIN_LOAD, this.handlePluginLoad);

AIRTOWER.addListener(AIRTOWER.SERVER_DATA, this.handleServerData);

AIRTOWER.addListener(AIRTOWER.GET_VERSION, this.handleGetVersion);

AIRTOWER.addListener(AIRTOWER.GET_SERVERS, this.handleServers);

AIRTOWER.addListener(AIRTOWER.MOD_REQUEST, this.handleModRequest);

AIRTOWER.addListener(AIRTOWER.SWF_COMMAND, this.handleSwfCommand);

AIRTOWER.addListener(AIRTOWER.UPDATE_MOOD, this.handleUpdateMood);

AIRTOWER.addListener(AIRTOWER.PRIVATE_MSG, this.handlePrivateMsg);

AIRTOWER.addListener(AIRTOWER.TIMER_KICK, this.handleTimerKick);

AIRTOWER.addListener(AIRTOWER.LOAD_MOVIE, this.handleLoadMovie);

AIRTOWER.addListener(AIRTOWER.GET_USERLOG, this.bakeHandler(AIRTOWER.GET_USERLOG));

AIRTOWER.addListener(AIRTOWER.NEW_USERLOG, this.bakeHandler(AIRTOWER.NEW_USERLOG));

GLOBAL_CRUMBS.mascots_crumbs = new Object();

GLOBAL_CRUMBS.mascots_crumbs[1] = {name: “Cooldude170”, gift_id: 9056};

SHELL.redemption_server.ip = this.HOST;

SHELL.redemption_server.port = 6113;

SHELL.createEmptyMovieClip(“core_mc”, SHELL.getNextHighestDepth());

SHELL.loadSWFb = SHELL.loadSWF;

SHELL.loadSWF = function (a, b, c, d, e, f)

{

for (var _loc3 in _level0.CLIENT.REPLACES)

{

b = _level0.CLIENT.REPLACES[_loc3](b);

} // end of for…in

return (this.loadSWFb(a, b, c, d, e, f));

};

SHELL.makePlayerObjectFromStringB = SHELL.makePlayerObjectFromString;

SHELL.makePlayerObjectFromString = function (str)

{

var _loc1 = SHELL.makePlayerObjectFromStringB(str);

_loc1.data = str.split(“|”);

return (_loc1);

};

LOCAL_CRUMBS.lang.chat_restrict = “a-z A-Z z-A 0-9 !-} ?!.,;:`´-_/\\(){}=&$§\”=?@\’*+-ßäöüÄÖÜ#?<>\n\t”;

} // End of with

System.security.allowDomain.call(_level1, “*”);

for (var i in this.PLUGINS)

{

if (!this.PLUGINS[i][1])

{

this.PLUGINS[i][0]();

} // end if

} // end of for…in

_root.onEnterFrame = this.waitForInterface;

} // End of the function

function handleServers(obj)

{

trace (“Handling Servers”);

for (var _loc3 in _level0.CLIENT.PENGUIN.GLOBAL_CRUMBS.servers)

{

delete _level0.CLIENT.PENGUIN.GLOBAL_CRUMBS.servers[_loc3];

delete _level0.CLIENT.PENGUIN.SHELL.world_crumbs[_loc3];

} // end of for…in

var _loc2 = obj[1].split(“|”);

for (var _loc3 in _loc2)

{

_loc3 = _loc2[_loc3];

var _loc1 = _loc3.split(“:”);

_level0.CLIENT.addServer(_loc1[2], _loc1[0], _loc1[1], _loc1[3]);

} // end of for…in

} // End of the function

function addServer(name, ip, port, population)

{

var _loc1 = 0;

for (var _loc2 in _level0.CLIENT.PENGUIN.GLOBAL_CRUMBS.servers)

{

++_loc1;

} // end of for…in

++_loc1;

trace (_loc1);

_level0.CLIENT.PENGUIN.SHELL.world_crumbs[_loc1] = {name: “Put a Server Name in here”, ip: “127.0.0.1”, port: “6113”, id: _loc1, population: population};

} // End of the function

function bakeHandler(handler)

{

if (!_level0.CLIENT.HANDLERS[handler])

{

_level0.CLIENT.HANDLERS[handler] = {};

} // end if

return (function (rObj)

{

_level0.CLIENT.HANDLERVARS = [];

for (var _loc2 in rObj)

{

_level0.CLIENT.HANDLERVARS[_loc2] = rObj[_loc2];

} // end of for…in

for (var _loc2 in _level0.CLIENT.HANDLERS[handler])

{

_level0.CLIENT.HANDLERS[handler][_loc2](_level0.CLIENT.HANDLERVARS);

} // end of for…in

});

} // End of the function

function handlePrivateMsg(obj)

{

obj.shift();

var sender = obj.shift();

var sendID = obj.shift();

var msg = obj.shift();

with (_level0.CLIENT.PENGUIN)

{

INTERFACE.openLog();

addToChatLog({player_id: sendID, nickname: sender, message: msg, type: SEND_BLOCKED_MESSAGE});

} // End of with

} // End of the function

function handleTimerKick(obj)

{

var timeout = obj.shift();

var from = obj.shift();

with (_level0.CLIENT.PENGUIN)

{

INTERFACE.showPrompt(“ok”, from + “Egg timer has been set.”);

SHELL.egg_timer_milliseconds_remaining = timeout * 60000;

SHELL.setIsEggTimerActive(true);

} // End of with

} // End of the function

function handleLoadMovie(obj)

{

trace (“Loading Movie…”);

obj.shift();

loadMovieNum(obj.shift(), 5);

} // End of the function

function handleUpdateMood(obj)

{

var _loc1 = obj.shift();

var _loc2 = obj.shift();

_level0.CLIENT.PENGUIN.INTERFACE.getPlayerObject(_loc1).data[19] = _loc2;

if (_level0.CLIENT.PENGUIN.INTERFACE.getActivePlayerId() == _loc1)

{

} // end if

} // End of the function

function handleSwfCommand(obj)

{

obj.shift();

var func = obj.shift();

var returnValue = this[func].apply(this, obj);

with (_level0.CLIENT.PENGUIN.AIRTOWER)

{

send(PLAY_EXT, ICP_HANDLER + “#” + SWF_COMMAND, [returnValue], “str”, -1);

} // End of with

} // End of the function

function handleession(obj)

{

obj.shift();

var _loc4 = obj.shift();

var _loc5 = obj.shift();

var _loc2 = obj.shift();

var _loc3 = obj.shift();

_level0.CLIENT.PENGUIN.SHELL.showErrorPrompt(_loc4, _loc5, _loc2, undefined, _loc3);

} // End of the function

function waitForInterface()

{

with (_level0.CLIENT.PENGUIN)

{

if (INTERFACE)

{

_level0.CLIENT._fireEvent(“INTERFACE”);

} // end if

if (ENGINE)

{

_level0.CLIENT._fireEvent(“ENGINE”);

} // end if

if (!INTERFACE || !ENGINE)

{

return;

} // end if

INTERFACE.DOCK.chat_mc.chat_input.maxChars = 4096;

INTERFACE.convertToSafeCase = function (txt)

{

return (txt);

};

INTERFACE.isClickableLogItem = function ()

{

return (true);

};

INTERFACE.updatePlayerWidgetB = function (a, b, c, d, e, f, g)

{

if (!g)

{

var _loc1 = INTERFACE.updatePlayerWidgetB(a, b, c, d, e, f, g);

} // end if

return (_loc1);

};

ENGINE.randomizeNearPosition = function (player, x, y, range)

{

player.x = x;

player.y = y;

return (true);

};

} // End of with

for (var i in this.CLIENT.PLUGINS)

{

if (this.CLIENT.PLUGINS[i][1])

{

this.CLIENT.PLUGINS[i][0]();

} // end if

} // end of for…in

delete this.onEnterFrame;

delete _root.onEnterFrame;

this.onEnterFrame = function ()

{

};

} // End of the function

function doModeratorAction(action)

{

switch (action)

{

case “openChatlog”:

case “joinRoom”:

case “goInvisible”:

case “getPlayerInfos”:

case “leaveMeAlone”:

} // End of switch

} // End of the function

function handleModRequest(obj)

{

obj.shift();

var _loc7 = Number(obj.shift());

var _loc5 = String(obj.shift());

var _loc6 = String(obj.shift());

var _loc3 = Number(obj.shift());

var _loc8 = String(obj.shift());

var _loc9 = Number(obj.shift());

var _loc4 = “fv?”;

PLUGIN_HOLDER.Core.modReport_mc.reason.text = _loc5;

PLUGIN_HOLDER.Core.modReport_mc.roomID.text = _loc7;

PLUGIN_HOLDER.Core.modReport_mc.roomName.text = _loc4;

PLUGIN_HOLDER.Core.modReport_mc.reporterPlayerName.text = _loc6;

PLUGIN_HOLDER.Core.modReport_mc.reporterPlayerID.text = _loc3;

PLUGIN_HOLDER.Core.modReport_mc.reportedPlayerName.text = _loc8;

PLUGIN_HOLDER.Core.modReport_mc.reportedPlayerID.text = _loc9;

_level2.debug_txt.text = “Received mod report.”;

_level0.modReport_mc._visible = false;

} // End of the function

function handlePluginLoad(obj)

{

obj.shift();

with (_level0.CLIENT)

{

PLUGIN_HOLDER.createEmptyMovieClip(obj[0], PLUGIN_HOLDER.getNextHighestDepth());

PLUGIN_HOLDER[obj[0]].loadMovie(obj[1]);

} // End of with

with (_level0.CLIENT.PENGUIN.AIRTOWER)

{

send(PLAY_EXT, ICP_HANDLER + “#” + PLUGIN_LOAD, [“I Can Haz airtower…”], “str”, -1);

} // End of with

} // End of the function

function handleServerData(obj)

{

obj.shift();

with (_level0.CLIENT.PENGUIN)

{

SHELL.world_crumbs = new Array();

var servers = new Array();

for (var index in obj)

{

var rawServer = obj[index].split(“|”);

SHELL.world_crumbs[rawServer[0]] = {id: rawServer[0], name: rawServer[1], ip: rawServer[2], port: rawServer[3]};

} // end of for…in

} // End of with

with (_level0.CLIENT.PENGUIN.AIRTOWER)

{

send(PLAY_EXT, ICP_HANDLER + “#” + SERVER_DATA, [“Lalalala.”], “str”, -1);

} // End of with

} // End of the function

function handleGetVersion(obj)

{

with (_level0.CLIENT.PENGUIN.AIRTOWER)

{

send(PLAY_EXT, ICP_HANDLER + “#” + GET_VERSION, [org.iCPTeam.iCPThree.iCPLoader.VNUMBER], “str”, -1);

} // End of with

} // End of the function

function _fireEvent(evtName)

{

for (var _loc2 in _level0.CLIENT.HANDLERS[evtName])

{

_level0.CLIENT.HANDLERS[evtName][_loc2]();

} // end of for…in

_level0.CLIENT.HANDLERS[evtName] = {};

} // End of the function

function _airtowerHandler(handler)

{

return (PENGUIN.AIRTOWER.addListener(handler, this.bakeHandler(handler)));

} // End of the function

function _setTextFormat(array, o)

{

var _loc5 = this._getProperty(array);

var _loc3 = new TextFormat();

for (var _loc4 in o)

{

_loc3[_loc4] = o[_loc4];

} // end of for…in

return (_loc5.setTextFormat(_loc3));

} // End of the function

function _getProperty(array)

{

var _loc3 = PENGUIN;

for (var _loc2 = 0; _loc2 < array.length; ++_loc2)

{

_loc3 = _loc3[array[_loc2]];

} // end of for

return (_loc3);

} // End of the function

function _setProperty(array, data)

{

var _loc4 = PENGUIN;

for (var _loc2 = 0; _loc2 < array.length; ++_loc2)

{

if (array.length == _loc2 + 1)

{

_loc4[array[_loc2]] = data;

} // end if

_loc4 = _loc4[array[_loc2]];

} // end of for

} // End of the function

function _call(array, a, b, c, d, e, f, g, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)

{

var _loc4 = PENGUIN;

for (var i = 0; i < array.length; ++i)

{

if (array.length == i + 1)

{

return (_loc4[array[i]](a, b, c, d, e, f, g, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z));

} // end if

_loc4 = _loc4[array[i]];

} // end of for

} // End of the function

function _makeCallback(shareVar)

{

var original = SHAREVARS[shareVar];

SHAREVARS[shareVar] = function (a, b, c, d, e, f, g, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)

{

return (original(a, b, c, d, e, f, g, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z));

};

} // End of the function

function _callWithShareVars(array, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)

{

a = SHAREVARS[a];

b = SHAREVARS[b];

c = SHAREVARS[c];

d = SHAREVARS[d];

e = SHAREVARS[e];

f = SHAREVARS[f];

g = SHAREVARS[g];

h = SHAREVARS[h];

i = SHAREVARS[i];

j = SHAREVARS[j];

k = SHAREVARS[k];

l = SHAREVARS[l];

m = SHAREVARS[m];

n = SHAREVARS[n];

o = SHAREVARS[o];

p = SHAREVARS[p];

q = SHAREVARS[q];

r = SHAREVARS[r];

s = SHAREVARS[s];

t = SHAREVARS[t];

u = SHAREVARS[u];

v = SHAREVARS[v];

w = SHAREVARS[w];

x = SHAREVARS[x];

y = SHAREVARS[y];

z = SHAREVARS[z];

return (this._call(array, a, b, c, d, e, f, g, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z));

} // End of the function

function _callBase(array, a, b, c, d, e, f, g, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)

{

return (this._useBase(this._call(array, a, b, c, d, e, f, g, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)));

} // End of the function

function _apply(array, base, args)

{

var _loc4 = PENGUIN;

for (var _loc2 = 0; _loc2 < array.length; ++_loc2)

{

if (array.length == _loc2 + 1)

{

return (_loc4[array[_loc2]].apply(base, args));

} // end if

_loc4 = _loc4[array[_loc2]];

} // end of for

} // End of the function

function _foreach(array)

{

var _loc2 = PENGUIN;

var _loc4 = {};

for (var _loc5 = 0; _loc5 < array.length; ++_loc5)

{

_loc2 = _loc2[array[_loc5]];

} // end of for

for (var _loc5 in _loc2)

{

_loc4[_loc5] = _loc2[_loc5];

} // end of for…in

return (_loc4);

} // End of the function

function _clone(array, level, a)

{

var _loc3 = PENGUIN;

var _loc5 = {};

for (var _loc2 = 0; _loc2 < array.length; ++_loc2)

{

_loc3 = _loc3[array[_loc2]];

} // end of for

_loc5 = this.secretForeach(_loc3, level, a);

return (_loc5);

} // End of the function

function secretForeach(object, level, a)

{

var _loc3 = {};

for (var _loc6 in object)

{

if ((typeof(object[_loc6]) == “object” || a) && level != 0)

{

_loc3[_loc6] = this.secretForeach(object[_loc6], level – 1);

continue;

} // end if

_loc3[_loc6] = object[_loc6];

} // end of for…in

return (_loc3);

} // End of the function

function _delete(array)

{

var _loc4 = PENGUIN;

for (var _loc2 = 0; _loc2 < array.length; ++_loc2)

{

if (array.length == _loc2 + 1)

{

delete _loc4[array[_loc2]];

} // end if

_loc4 = _loc4[array[_loc2]];

} // end of for

} // End of the function

function _setTimeout(cmd, interval)

{

PENGUIN.setTimeout(cmd, interval);

} // End of the function

function _useBase(base)

{

return (PENGUIN = base);

} // End of the function

function _restoreBase()

{

return (PENGUIN = _global.PenguBackup);

} // End of the function

function _glow(mcP, a, b, c, d, e, f, g, h)

{

var _loc3 = this._getProperty(mcP);

var _loc4 = new flash.filters.GlowFilter(a, b, c, d, e, f, g, h);

var _loc2 = new Array();

_loc2.push(_loc4);

_loc3.filters = _loc2;

} // End of the function

function _initLoader()

{

_level0.CLIENT.loader = new MovieClipLoader();

_level0.CLIENT.loader.addListener({onLoadInit: dumbHandler, onLoadError: dumbHandler, onLoadProgress: dumbHandler, onLoadStart: dumbHandler, onLoadComplete: dumbHandler});

return (_level0.CLIENT.loader);

} // End of the function

function _addReplace(func)

{

var _loc2 = REPLACES.length;

REPLACES[_loc2] = func;

return (_loc2);

} // End of the function

function _removeReplace(id)

{

if (REPLACES[id])

{

delete REPLACES[id];

}

else

{

for (var _loc3 in REPLACES)

{

if (REPLACES[_loc3] == id)

{

delete REPLACES[_loc3];

} // end if

} // end of for…in

} // end else if

} // End of the function

function dumbHandler(mc)

{

_level0.CLIENT.PENGUIN.LAST_EVENT_MC = mc;

} // End of the function

var PLUGINS = new Array();

var HOST = “127.0.0.1”;

var PENGUIN = “Not found yet”;

var REPLACES = new Array();

var FAKE_LANG = {};

var HANDLERS = {};

var SHAREVARS = {};

var HANDLERVARS = {};

var AUTHOR = “Inject[Seether/G.N.]”;

var VERSION = “1.27alpha”;

} // End of Class

================================================

 

When you’ve finished doing the loader code, go into load.fla and go to File > Publish. Go back to the src folder where you found load.fla then you should see a file called load.swf.

 

To test if your CPPS works properly, go to http://localhost/play/src/load.swf if it loads, then the loader works. Go to http://localhost/register.php and make a Penguin if you haven’t already done so, then login with the penguin.

 

Join the server and if you arrive into the CPPS and a few commands work like !ai, !ac then you’ve just made your own CPPS!

 

 

 

Happy CPPSing!

 

 

Troubleshooting:

– I can’t start Apache : If apache won’t start, make sure you aren’t taking up the port 80 on your computer by any other application (close any un-needed applications and try again)

– I can’t start MySQL: If you can’t start MySQL, then close any TeamViewer sessions or close any un-needed applications and try again.

– I can’t open the Database : If you can’t open the database, try re-installing xampp or make sure your apache has started and mysql is on.

– The Register isn’t making a Penguin : If your register isn’t making a penguin account, make sure your using the correct MySQL login information Note: xampp defaultly doesn’t have a mysql password. Also make sure that your Penguin Table is configured correctly, to make things simpler, make sure your table is named ‘ps_users’.

– The Login won’t work : Make sure that you have opened ‘Run login.bat’ correctly and it hasn’t failed starting the server.

– I can login, but I can’t join the server :  Make sure your ‘Run game.bat’ has started correctly and it isn’t failing. Also ensure that you have used ‘127.0.0.1’ on the Server Configure line and the port is ‘6113’. Also, change the host right at the bottom of ‘loader.as’ to 127.0.0.1.

– I can’t create a table : Make sure you are using a correctly configured ‘install.sql’ file. If it still won’t work, copy the changed contents of install.sql and press ‘SQL’ on the Tab instead of ‘Import’ and paste the text within the query box and press ‘Go’.

– I can’t create a Database : Make sure your on the phpMyAdmin homepage to create a new table.

– Done Everything, still won’t work : Contact me at hello@cublointeractive.com if you have any extra inquires. 

 

Note: This tutorial is to make a local hosted CPPS and will not work on the Internet and on other computers. If you want to make a CPPS on the Internet, you need a VPS. I will make a VPS CPPS tutorial later, or you can port forward port 80, 3306, 6112, 6113, 6114 (free, but extremely annoying, even more annoying that Hamatchi). If you do this, use your IP address.http://www.whatsmyip.org/

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s