Jump to content

Recommended Posts

Posted (edited)

Don't use mysql (deprecated) / mysqli! There is PDO and nothing else. :lol:

 

Also, you can build something like a template engine...

For example:

 

index.php

<?php

function render($tplFile, array $data) {
    ob_start();
    extract($data, EXTR_SKIP);
    require "template/{$tplFile}";
    echo ob_get_clean();
}

$someData = [
    'title' => 'Cool Page Title',
    'text' => 'Some cool text'
];

render('home.php', $someData);
template/home.php

<!DOCTYPE html>
<html>
    <head>
        <title><?= $data['title']; ?></title>
    </head>
    <body>
        <div><?= $data['text']; ?></div>
    </body>
</html>
Edited by Tessa
Posted

I know pdo is used on the updated version.

First adding more donation options and debugging the system as best i can.

i will try to keep this in mind when i'm going to worry about templates ^^

Posted

It's not about templates. When you separate the HTML (also known as 'view') from the programming logic, your code becomes more readable. You can also separate the database logic and your application will be even easier to debug. :)

Posted

It's not about templates. When you separate the HTML (also known as 'view') from the programming logic, your code becomes more readable. You can also separate the database logic and your application will be even easier to debug. :)

 

I still prefer the good clean jsp and servlets

Posted

I still prefer the good clean jsp and servlets

PHP can be clean too, there are a lot of frameworks you can use to do that.

 

For a web apps I prefer Python + Django. Python is sweet, Django is powerful. :lol:

Posted

I'm not that good at coding. if something comes out, its mostly chaotic.

But yea i'm trying my best to give a free tool to the l2j community.

I'm mostly working alone at it so some help is welcome.

Maby giving ideas to better handle the code.

With example would be very usefull :)

  • 3 weeks later...
Posted (edited)

Yes i will explain it a bit on how to test.

 

Login: https://developer.paypal.com/webapps/developer/applications/ipn_simulator

Step1: choose your ipn file and select web accept:

8546e594-d0f2-11e5-9338-b30f01f1b338.png

 

Step2: check if its instant, confirmed and verified:

e00a54fe-d0f0-11e5-8946-cc45eae5b663.png

 

step3: you can select every donation option just change mc_gross and custom field:

66eaeb78-d0f1-11e5-842e-f07d08eb4f25.png

 

Options for custom field:

 

// Note for selecting the correct option (coins karma pk) use the correct mc_gross amount same as your config.
Charactername|Coins
Charactername|Karma
Charactername|Pkpoints

 

// These ones are for the enchant option.

charname|Enchitems|Shirt
charname|Enchitems|Helmet
charname|Enchitems|Necklace
charname|Enchitems|Weapon
charname|Enchitems|FullarmorBreastplate
charname|Enchitems|Shield
charname|Enchitems|Ring1
charname|Enchitems|Ring2
charname|Enchitems|Earring1
charname|Enchitems|Earring2
charname|Enchitems|Gloves
charname|Enchitems|Leggings
charname|Enchitems|Boots
charname|Enchitems|Belt

 

Change  MC_gross = donation amount. Same as your config otherwise the donations wont work.

It will get logged into admin/donationoverview because the donation amount is not correct.

 

And turn sandbox mode on in config if you are testing trough the ipn simulator. Otherwise it will also fail.

 

Edit: Also good to know this system is not tested good yet, and maby it could burn your server in the near future :P.

 

Still working on it i just dont have so mutch time lately to learn and code.

When i have more time i will try to make it better.

Edited by dasoldier
  • 2 months later...
Posted (edited)

Hey all,

 

I have shared a donation system.

Still improving it and try to solve problems i have encountered.

Note: Spanish is not in there yet.

https://github.com/Dasoldier1/Donation_Center

 

* register form

* Now players connect their character to their donation center account

 

5aaeba7c-29bd-11e6-903e-53b355093e91.jpg

 

5ad06a00-29bd-11e6-9bd6-46b5c4090123.jpg

 

It is exerimental so if you encounter some problems with the system inform us and we will look for a solution.

 

Greetings,

Dasoldier

Edited by dasoldier
  • 3 years later...
Posted (edited)

When you donate with a sandbox personal account to a sandbox business account, payment status is set to Pending for some reason and not Completed. So be aware guys

Edited by Zake

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • I open the l2j server and see 1. XOR->NewCrypt.encXORPass(raw, offset, size, Rnd.nextInt()); ---> xor everything is clear 2. _staticCrypt.crypt(raw, offset, size); -----> private void encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex) { int xl = bytesTo32bits(src, srcIndex); int xr = bytesTo32bits(src, srcIndex + 4); xl ^= P[0]; for (int i = 1; i < ROUNDS; i += 2) { xr ^= func(xl) ^ P[i]; xl ^= func(xr) ^ P[i + 1]; } xr ^= P[ROUNDS + 1]; bits32ToBytes(xr, dst, dstIndex); bits32ToBytes(xl, dst, dstIndex + 4); }   I scroll down the code and see this code   ----->>> /**      * Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset. The input will be an exact multiple of our blocksize.      * @param src      * @param srcIndex      * @param dst      * @param dstIndex      */     private void decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)     {         int xl = bytesTo32bits(src, srcIndex);         int xr = bytesTo32bits(src, srcIndex + 4);         xl ^= P[ROUNDS + 1];         for (int i = ROUNDS; i > 0; i -= 2)         {             xr ^= func(xl) ^ P[i];             xl ^= func(xr) ^ P[i - 1];         }         xr ^= P[0];         bits32ToBytes(xr, dst, dstIndex);         bits32ToBytes(xl, dst, dstIndex + 4);     }   ===================================================   I'm transferring this code to C# private void decryptBlock(byte[] src, uint srcIndex, byte[] dst, uint dstIndex)    {        uint xl = BytesTo32bits(src, srcIndex);        uint xr = BytesTo32bits(src, srcIndex + 4);        xl ^= P[ROUNDS + 1];        for (int i = ROUNDS; i > 0; i -= 2)        {            xr ^= F(xl) ^ P[i];            xl ^= F(xr) ^ P[i - 1];        }        xr ^= P[0];        Bits32ToBytes(xr, dst, dstIndex);        Bits32ToBytes(xl, dst, dstIndex + 4);    }   And in c# I first do decryptBlock and then XOR and everything works, I get the package and the first 2 bytes have already been removed as far as I remember   This only works for the login server for the game server, I think it’s not much different  
    • Ask him what you know, and what I know hahaha.
    • https://prnt.sc/2G_hOHfUIGLM   not sure what you mean Teddy boi  
    • Hello first of all thank you for your prompt response and the time you are taking to read this and answer, I am aware that not everyone takes the time and for that I thank you. On the other hand the specific problem is when decrypting this package and being able to parse it,  In some places it says that it is only encrypted with xor, in others that only a static blowfish is used and in others that both are used in the order of xor and then blowfish, this is the problem in spite of being able to see the encryption mechanisms of the servers, I can not put together the function that reverses this encryption to obtain the keys sent by the init packet.   Thanks for your time, hopefully the rest can contribute something because it is a super useful module to extend any functionality to the client and I will publish it in an opensource way when it is finished.
  • Topics

×
×
  • Create New...