Jump to content

Jamie

Members
  • Content count

    59
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Jamie


  1. Hello all,

    So recently I forgot to patch this up, thought I'd share it with you guys who have AS3 servers and are using Kitsune as a source.

    Basically the situation is you're able to buy as many puffle wild creatures as you like - you can go into negative balance but spam buy them still.

    Such a simple solution and I should of done it ages ago but forgot to, thought I'd share for any noobs

    Here's how to fix it:

    Go to Kitsune\ClubPenguin\Handlers\Play\Pet.php

    Find the function

    Quote
    // Check if they exceed puffle limit (?)
      // Also check if types are valid!
      protected function handleAdoptPuffle($socket) {
      $penguin = $this->penguins[$socket];
      $puffleType = Packet::$Data[2];
      $puffleName = ucfirst(Packet::$Data[3]);
      $puffleSubtype = Packet::$Data[4];
       
      if($puffleSubtype == 0) {
      $puffleCost = 400;
      } else {
      $puffleCost = 800;
      }
       
      if(is_numeric($puffleType) && is_numeric($puffleSubtype)) {
      $puffleId = $penguin->database->adoptPuffle($penguin->id, $puffleName, $puffleType, $puffleSubtype);
      $adoptionDate = time();
       
      if($puffleSubtype == 0) {
      $puffleSubtype = "";
      }
       
      $penguin->buyPuffleCareItem(3, 0, 5, true); // Puffle O's
      $penguin->buyPuffleCareItem(76, 0, 1, true); // Apple
       
      $postcardId = $penguin->database->sendMail($penguin->id, "sys", 0, $puffleName, $adoptionDate, 111);
      $penguin->send("%xt%mr%-1%sys%0%111%$puffleName%$adoptionDate%$postcardId%");
       
      $penguin->setCoins($penguin->coins - $puffleCost);
      $penguin->send("%xt%pn%{$penguin->room->internalId}%{$penguin->coins}%$puffleId|$puffleType|$puffleSubtype|$puffleName|$adoptionDate|100|100|100|100|0|0|0|1|%");
       
      $penguin->database->updateColumnById($penguin->id, "Walking", $puffleId);
      $penguin->walkingPuffle = $penguin->database->getPuffleColumns($puffleId, array("Type", "Subtype", "Hat") );
      $penguin->walkingPuffle = array_values($penguin->walkingPuffle);
      array_unshift($penguin->walkingPuffle, $puffleId);
      }
      }

    And replace it with the following

    Quote

        public function handleAdoptPuffle($socket) {
            $penguin = $this->penguins[$socket];
            $puffleType = Packet::$Data[2];
            $puffleName = ucfirst(Packet::$Data[3]);
            $puffleSubtype = Packet::$Data[4];
            
            if($puffleSubtype == 0) {
                $puffleCost = 400;
            } else {
                $puffleCost = 800;
            }
            if($penguin->coins < $puffleCost) {
                return $penguin->send("%xt%e%-1%401%");
            } 
            
            if(is_numeric($puffleType) && is_numeric($puffleSubtype)) {
                $puffleId = $penguin->database->adoptPuffle($penguin->id, $puffleName, $puffleType, $puffleSubtype);
                $adoptionDate = time();
                
                if($puffleSubtype == 0) {
                    $puffleSubtype = "";
                }
                
                $penguin->buyPuffleCareItem(3, 0, 5, true); // Puffle O's
                $penguin->buyPuffleCareItem(76, 0, 1, true); // Apple
                
                $postcardId = $penguin->database->sendMail($penguin->id, "sys", 0, $puffleName, $adoptionDate, 111);
                $penguin->send("%xt%mr%-1%sys%0%111%$puffleName%$adoptionDate%$postcardId%"); 
                
                $penguin->setCoins($penguin->coins - $puffleCost);
                $penguin->send("%xt%pn%{$penguin->room->internalId}%{$penguin->coins}%$puffleId|$puffleType|$puffleSubtype|$puffleName|$adoptionDate|100|100|100|100|0|0|0|1|%");
                
                $penguin->database->updateColumnById($penguin->id, "Walking", $puffleId);
                $penguin->walkingPuffle = $penguin->database->getPuffleColumns($puffleId, array("Type", "Subtype", "Hat") );
                $penguin->walkingPuffle = array_values($penguin->walkingPuffle);
                array_unshift($penguin->walkingPuffle, $puffleId);
            }
        }

    Save the file and restart your World server and it should be fixed.

    You're welcome

    • Like 4

  2. 56 minutes ago, Ben said:

    Unfortunately, because curl_exec is a blocking call, your server will actually hang whenever a post is made to the Discord webhook API. I did this a few weeks ago, and even with two users online, the effect on performance was noticeable, and this could very easily be abused by creating bots which login to the server repeatedly.

    PHP is able to execute multiple curl requests at once, but there isn't a way (as far as I know), to carry on with your socket server loop before the requests are complete, not without using an extension which brings real multithreading to PHP, like pthreads.

    A nice idea, and it works, to a degree, don't use this if your server has many players. :)

    Tested this for several hours and effect on performance isn't' really noticeable at the moment, working on it even more, just a test for now - as I stated in thread it isn't wise to use this with many players.

     


  3. Hello all,

    This is just a fun small project I've been working on to see how to get Discord webhooks working, nothing too serious and I kind of don't recommend using it on heavily populated servers.

    What does it do? It sends live notifications to your Discord when someone signs in - you can build off this and create bigger and better things. 

    What do you need?

    - PHP 7

    - CURL

    - Kitsune AS2/AS3


    Preview

    HU11fyfcSvqKQUqfgLbQRQ.png

    How to add

    First you need to create a webhook on your Discord server.

    Go to your server settings, and then webhooks.

    T0y7_N68T-mY5WwLd-Oz-g.png

    Click on "Create Webhook" and enter a name for your bot and also select the channel you want it in, you can also add an avatar for it (webhook icon).

    Copy the webhook url and save it somewhere.

    Now we need to go to your source and go to /Kitsune/Kitsune/ClubPenguin/Login.php

    Find 

    Quote

        public function __construct() {    
            parent::__construct();
            
            Logger::Fine("Login server is online");
        }

     

    After it add the following

    Quote

     

    public function discordwebhook($content)
    {
        $curl = curl_init("REPLACE WITH YOUR DISCORD WEB HOOK LINK");

        curl_setopt_array($curl, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_SSL_VERIFYHOST => false,
            
            CURLOPT_USERAGENT => 'Mozilla/5.0 (+https://flash.moe)',
            CURLOPT_HTTPHEADER => ['Content-Type: application/json'],

            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => json_encode($content),
        ]);

        curl_exec($curl);
    }

     

     

    Where REPLACE WITH YOUR DISCORD WEB HOOK LINK is, add the webhook link.

     

    Now find

    Quote

     $penguin->send("%xt%l%-1%{$penguinData["ID"]}|{$penguinData["SWID"]}|{$penguinData["Username"]}|$encryptedPassword|1|45|2|false|true|$loginTime%$confirmationHash%$friendsKey%101,1%{$penguinData["Email"]}%");

     

    After it add the following

     

    Quote

     

      print_r($this->discordwebhook(['embeds' => [

        [
            'title' => 'CP Reborn Server',
            'description' => $penguinData["Username"].' has signed into CP Reborn and is on the island',
            'url' => 'https://play.clubpenguinreborn.pro/',
            'timestamp' => gmdate("Y-m-d\TH:i:s.u\Z", strtotime("now")),
        ],
    ]]));        

     

     

    You can now save this file and launch your server.

    It should work great and you should then see your bot put live notifications for when someone logins.

    Have some fun with it, you can do all types of things with this - let it be a starter to create bigger and better things with it.

    Thanks to @Jad for helping me fix a few errors with it, life saver.

    • Like 2

  4. You can easily make these yourself,

    your threads seem to be 90% (just a random percentage) support, this section is here to help you along the process, not to spoon-feed you everything.

    It's time for you to put time into learning things yourself like a lot of us have had to do.

    • Like 1

  5. Seeing as a few people are having issues with getting games to work and games appearing as "white screen" when attempting to launch them, I've decided to fix the issue and release the base games for people.

    This will work with both AS2 and AS3 (AS3 has more games, this is only the base games which were originally available)

    Games included: Astro Barrier, Bean Counters, Puffle Launch (the game is server sided so you have to code the actual handlers in), Dance Contest, Ice Fishing, Hydro Hopper, Jetpack Adventures, Cart Surfer, MixMaster, Pizzatron, Puffle Rescue, Puffle Roundup, Aqua Grabber, Thin Ice, Catchin Waves and Tumblers.

    Instructions

    Go to your mediaserver and go to play/v2/content/global/

    Replace your games folder with the one you're about to download, clear your cache and reload and then attempt to play games.

    Download Here

    You're welcome, let me know if this works for you. 

    • Like 2

  6. 1 hour ago, Arthur said:

    I love it. The vocals blend in so perfectly with the song.

    I listened to it when I was in a shit mood, probably why I didn't like it but I love it now, chilling with it with headphones on is amazing.


  7. CPBlog is a simple lightweight WordPress theme which will help you get a free working Club Penguin blog up and running.

    Screenshot_121.png

    Version: 1.0 

    Download Link: Click Here

    This is a little project of mine which I want to continue working on and improving.

    Updates will come when I'm able to work on them and when I wish to work on them.

    I'll be working on a newer Club Penguin blog theme soon also.

    Requirements

    WordPress (download here)

    How to install:

    - Install WordPress

    - Go to admin Dashboard

    - On the left hand side hover over "Appearance" and click on "Themes"

    - Click on "Add New"

    - Click on "Upload Theme"

    - Download the latest version of CPBlog below, and install it as it.

    - Activate and Done!

    There is no dedicated support for this theme but you can leave issues and suggestions below. 

    Please do not re-upload this theme elsewhere, use the same download link as when I push updates the link will be the same and I don't want people using outdated versions in the near future.

    • Like 3

  8. Just now, Doxlla said:

    I need type something or what????? idk how to type like that..

    media1/play/v2/client/

    Open up dependencies.json

    Add this

    Quote

            {
                "id": "party_icon",
                "title": "party_icon"
            },

    Under

    Quote

            {
                "id": "interface",
                "title": "Interface"
            },

     


  9. 5 hours ago, Doxlla said:

    Hi, i have party files now...

    idk how to setup it, can you help me?

    Just find the original locations to most of the files and replace them.


  10. This is Music Jam 2016, with working quests. It's for AS3. All you have to do is put the files in the correct locations in your mediaserver.
    If there are any missing rooms you can download them from here, we had to modify a few files in order to get the Music Jam functional on CP Reborn.

    Hopefully it helps a few.

    Preview:

    Music Jam 2016 interface page 1Music Jam 2016 interface page 2Music Jam 2016 login 1Music Jam 2016 task 2 congratsMusic Jam 2016 task 1 congrats 1

     

    Download Here

    • Like 2

  11. f you have a AS3 CPPS, you'd know that there are some annoying issues around the fact that it uses the newer catalog system.

    This being the JSON image catalog system thing (I don't really know how to better explain it) - basically you're stuck with February 2017's furniture catalog.

    I've come up with a quick and effective fix for this.

    What you'll first need to do is make sure you have older versions of rooms which have catalogs within them (prior to 2016). You can get old versions of rooms from Club Penguin Wiki Archives.

    After you've done this, you can apply my "fix".

    Below is an attachment called "pigfarm_catalog.swf", what you want to do is put it in media1's client folder. so media1/play/v2/client/

    And done! Issue should be resolved and other catalogs should be fully functional still, no need to rely on the json image catalog system thing and have to change tons of shit to get furniture catalog working.

    So what did I do exactly?

    All I did was create a new ActionScript 2 file on Flash and make the interface show the catalog, this gets rid of all the shit pigfarm_catalog.swf originally came with.

    I've tested it and it works great, if you have any issues with this let me know, I'll assist ya.

     

    Cheers to Jad for making me realise what I was doing this wrong.

    pigfarm_catalog (1).rar

    • Like 1
×