Register for your free account! | Forgot your password?

You last visited: Today at 14:36

  • Please register to post and access all features, it's quick, easy and FREE!


[Release] 5165 Smart Item Seller

Closed Thread
 
Old 07/11/2011, 17:27   #16
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,310
Quote:
Originally Posted by joker769 View Post
sorry but first of all, ItemID's go alot higher then the uint restrictions... and if the item id is higher then 65545 then no item adds... secondly, the method is fine the way it is, if u place this in your source, it will work (unless extremely edited) which then u shud be able to adjust it to your edits... if you have a better one then good for you but i see nothing wrong with this
UInt has a max value of 4,294,967,295. Not 65545 as you stated. You're thinking of ushort (which as fang said is WRONG. Look at the packet, it's a uint)


I could have sworn I wrote a fairly lengthy reply to this thread but I'm probably mistaken.


Writing such a large amount of code without using its own methods or classes is VERY bad coding practice.


You could (theoretically) write entire programs all inside the Main() method but there's a reason that no one in their right mind EVER would even try to do so.

Reasons being...

-Efficiency
-Legibility
-Ease of Debugging
-Coding 'norms'


I could easily think up a few more if I want but this is more than enough to get us started on this little rant.


Methods should be accomplishing ONE task. Nothing more.


Example being... A method that pulls an item from a database and performs an action on it should be using two methods because it's trying to do more than one thing.

Obviously this doesn't ALWAYS happen but imagine a giant program all written within one, or few methods which handle everything the program needs to do... now think about a program where each method does a grand total of ONE task. Think about trying to debug these programs... What happens if any one aspect of the program causes an issue (at best doesn't work as intended, at worst crashes the entire program). Which is easier to debug? Which is easier to read? Hell... which is more efficient in 99 percent of cases?

TL;DR version:

You should be at the very least writing this as its own method... at most you should be writing its own methods, helper methods and debugging/error proofing them all.

You could go one step further to allow the user to input a string for an item name and then use a quick search and validity check to pull valid itemtypes that the user could purchase and calculate a price for them based on the stats/level/demand for the item.

Would provide a MUCH more robust and unique system for users.



pro4never is offline  
Old 07/16/2011, 12:19   #17
 
elite*gold: 0
Join Date: Nov 2008
Posts: 70
Received Thanks: 8
i don't care whether you like it or not, nor if it is signs of a "bad project manager", if you have a better way, fix it yourself, i am just putting the ways that i knew at the time... i believe you would better spend you time correcting or doing it urself then trying to correct me... right?

i switch between flyff, pwi, and eudemon servers nearly everyday and sometimes i forget the shortcuts... so yes IT DOES WORK FOR NOOBS... if u dont like it o well..

i went back and corrected my work anyway, so now what do you have to object about it so i can perfect my own skills at your expence???


joker769 is offline  
Thanks
1 User
Old 07/16/2011, 13:54   #18
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,310
Quote:
Originally Posted by joker769 View Post
i don't care whether you like it or not, nor if it is signs of a "bad project manager", if you have a better way, fix it yourself, i am just putting the ways that i knew at the time... i believe you would better spend you time correcting or doing it urself then trying to correct me... right?

i switch between flyff, pwi, and eudemon servers nearly everyday and sometimes i forget the shortcuts... so yes IT DOES WORK FOR NOOBS... if u dont like it o well..

i went back and corrected my work anyway, so now what do you have to object about it so i can perfect my own skills at your expence???
.... I offer advice in hopes people will learn things (when I feel I can contribute). That's kinda the point of all this isn't it?

It looks better. There's always minor things that could be changed or improved but it looks a tad more legible now thanks to switching it out of the actual npc handler.

Good luck with your future projects
P4N
pro4never is offline  
Old 07/17/2011, 13:02   #19
 
elite*gold: 0
Join Date: Nov 2008
Posts: 70
Received Thanks: 8
well u really helped here =), if u can help me with two things tho outside of this i would greatly appreciate it

1. is it truly impossible to host and login to your own 5165 source?... im not using navicat for it...

2. as for your 5355 release, why dosent the mobs spawn even though i have the values in navi cat database?


joker769 is offline  
Old 07/17/2011, 20:12   #20
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,310
Quote:
Originally Posted by joker769 View Post
well u really helped here =), if u can help me with two things tho outside of this i would greatly appreciate it

1. is it truly impossible to host and login to your own 5165 source?... im not using navicat for it...

2. as for your 5355 release, why dosent the mobs spawn even though i have the values in navi cat database?
1) There's no reason you shouldn't be able to log into your own source... I've NEVER seen a source that has issues with it. Where does it pose a problem?

2) The mob system was never coded in that source. I released a few code snippets cause I got tired of people never doing it themselves which will allow mobs to display but they have no actions and cannot be killed. You have to code the full mob system in that source.
pro4never is offline  
Old 07/20/2011, 09:51   #21
 
elite*gold: 0
Join Date: Nov 2008
Posts: 70
Received Thanks: 8
when i set my ip to the server host, and then connect through my router to it, the client closes.. i believe it is the same problem as setting yours server to 127.0.0.1...

and i just found that today... im working on it as best i can lol...
joker769 is offline  
Old 03/21/2012, 17:41   #22
 
elite*gold: 0
Join Date: Jan 2009
Posts: 30
Received Thanks: 2
Hey Brother lol i cant believe i find you

when you see this try to contact me on FB or MSN

[Marcus]


Bello00 is offline  
Closed Thread



« [RELEASE] TERATO DRAGON + TIGER MOUNT | [Release]Ancient-Devil's-Quest!5165 source! »

Similar Threads
[Release] 5165 Item Verify; Event display
03/22/2011 - CO2 PServer Guides & Releases - 2 Replies
Uses :if you need something that asks the player if he/she wants to use it :if you need to implement an event that teleports the players to it NOTE: if your advanced just grab the codes, you know what to do... just pay attention to the red...
[RELEASE]Level 135 item (5165)
01/02/2011 - CO2 PServer Guides & Releases - 27 Replies
WARNING: I have taken this from another forum and do NOT hit +thanks, Thanks Well guys i got these 135+ items for all classes and i thot id be nice and release them here this is for 5165 client...
[Release]Bound Item Command(5165)
08/05/2010 - CO2 PServer Guides & Releases - 15 Replies
Got bored... this is the usage: /free Item Quality Plus -Damage Socket1 Socket2 if (Cmd == "/free") { uint ID = 0; foreach (DatabaseItem DI in...
[Release]Promotion Item Seller
01/26/2010 - CO2 PServer Guides & Releases - 16 Replies
#region Promotion Item Seller case 24: { if (Control == 0) { ...



All times are GMT +2. The time now is 14:36.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.