Entity Create Thing.

05/17/2012 20:05 agathom#1
Yesterday i was trying to disable creating ninja and monks in my server. I cant figure out how did they handle it in Classic Co . I am using impulse 5518+.

Heres the image of what i mean.

[Only registered and activated users can see links. Click Here To Register...]

help would be apreciated.
thanks in advance
05/17/2012 20:17 I don't have a username#2
Just check for the ninja and monk job in the character creation handler. Then send the message packet with the character creation chat-type.
05/17/2012 22:07 Kiyono#3
Well if it's a variation of impulse's source than it's not that hard.
Search for
Code:
public static bool CreateEntity(Network.GamePackets.EnitityCreate eC, Client.GameState client, ref string message)
And stick in:
if (eC.Class == 50)
{
//something
message = "Ninjas disabled";
}
Or something along those lines.
05/17/2012 22:17 agathom#4
Thanks for the replies apreciate that.
I fixed it already

@kiyono
Your were right , I am using yours now .

This is old my code looks retard ,How would they make 51 -55 class if they are in the entity create portion ' Im not thinking at all. :D
Code:
            if (eC.Class >= 50 && eC.Class <= 55)
            {
                message = "Ninja has been removed.";
                return false;
            }
05/17/2012 22:34 pro4never#5
51-55 are promotions of ninja... 50 is what's sent during character creation.

Note: That is also poor program flow as you have it written....

Every method should have one entry point and one exit point. EG: avoid goto whenever possible. It requires slightly more planning when setting up the logic for the method but it makes it infinitely easier to read and debug.

<edit>

You should be handling ONLY valid data from client. Never just assume the information being received is correct. Saint taught me that back in my first source when he decided to test all my validity checks and was able to make a character with....

Invalid UID
Invalid Name
Invalid Job
Invalid Mesh

He decided to stop before having it drop my entire database by using sql syntax inside the name.

Moral of the story... validate ALL information coming from client and structure your logic correctly the first time so it's easily readable and maintainable.
05/17/2012 22:42 agathom#6
Thanks for the explanation, will look in to it.
05/21/2012 09:12 I don't have a username#7
Quote:
Originally Posted by pro4never View Post
He decided to stop before having it drop my entire database by using sql syntax inside the name.
This is why I love people with no mysql experience or knowledge about sql injection. This works on half of the co-servers :p
05/21/2012 10:28 agathom#8
This can be closed.

I dont want to hear more GodWords.

Thanks.
05/21/2012 10:53 Spirited#9
Quote:
Originally Posted by pro4never View Post
He decided to stop before having it drop my entire database by using sql syntax inside the name.
That's fucking brilliant.