StorageCapacity shouldn't be hardcoded

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House

StorageCapacity shouldn't be hardcoded

#1 Post by h4rry84 »

thru : http://forums.openkore.com/viewtopic.ph ... &sk=t&sd=a

it shouldn't be hardcoded ;) , many Pserv / Official Server began to make the Storage capacity larger by now (kRO storage is 600,idRO storage using premium service can large it into 600)

note : it hasn't been tested at all -_-", but it should work.

so here's the patch

Code: Select all

Index: CoreLogic.pm
===================================================================
--- CoreLogic.pm	(revision 6451)
+++ CoreLogic.pm	(working copy)
@@ -1264,7 +1264,7 @@
 				$args->{done} = 1;
 				
 				# if storage is full disconnect if it says so in conf
-				if(@storageID >= 300 && $config{'dcOnStorageFull'}) {
+				if(@storageID >= $config{'maxStorageCapacity'} && $config{'dcOnStorageFull'}) {
 					error T("Disconnecting because storage is full!\n");
 					chatLog("k", T("Disconnecting because storage is full!\n"));
 					quit();

Code: Select all

Index: config.txt
===================================================================
--- config.txt	(revision 6451)
+++ config.txt	(working copy)
@@ -581,6 +581,7 @@
 storageAuto_useChatCommand
 relogAfterStorage 1
 minStorageZeny 50
+maxStorageCapacity 300
 
 npcTimeResponse
 

Code: Select all

Index: README.txt
===================================================================
--- README.txt	(revision 6451)
+++ README.txt	(working copy)
@@ -13,6 +13,7 @@
 								  (filename without the extension) specifies which plugin files
 								  to load at startup or when the "plugin load all" command is used.
 - New flag for attackChangeTarget: 2 - find better attack target while gaining LOS to current target.
+- New config setting maxStorageCapacity to manually define how much is your server kafra storage.
 - Fixed bug crashes when console commands access undefined objects
 - Fixed bug in 'reload' chat command (thanks to Motivus)
 - Fixed bug in stripping callSign from chat commands
Bibian
Perl Monk
Perl Monk
Posts: 416
Joined: 04 Apr 2008, 03:08

Re: StorageCapacity shouldn't be hardcoded

#2 Post by Bibian »

i searched for where that was located... but i could never find it o.o
h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House

Re: StorageCapacity shouldn't be hardcoded

#3 Post by h4rry84 »

search for what ? Image

Edit, lol now i understand after reading from Feature Suggestion :lol:
sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: StorageCapacity shouldn't be hardcoded

#4 Post by sli »

Wrong. Wrong wrong wrong, all wrong! The storage capacity setting should be in servers.txt, not in the config.
cs : ee : realist
Cozzie
Spam Generator
Spam Generator
Posts: 499
Joined: 04 Apr 2008, 09:30
Noob?: No
Location: Melbourne, City of beer and awful sushis

Re: StorageCapacity shouldn't be hardcoded

#5 Post by Cozzie »

quite the purist arent you? Is it anywhere possible to have the bot detect it and set it automatically?
Make Openkore Awesome. Join the team.
h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House

Re: StorageCapacity shouldn't be hardcoded

#6 Post by h4rry84 »

uhm, sli's suggestion is quite correct. but considering the dumb of people can get -_- what you can expect

and considering only write 1 time in config than writing how much is the storage as much as servers that listed on servers.txt meanwhile you don't have any info about how many is the storage in that server.

@cozzie
Is it anywhere possible to have the bot detect it and set it automatically?
i don't know about this. maybe need packet capture :s
Cozzie
Spam Generator
Spam Generator
Posts: 499
Joined: 04 Apr 2008, 09:30
Noob?: No
Location: Melbourne, City of beer and awful sushis

Re: StorageCapacity shouldn't be hardcoded

#7 Post by Cozzie »

h4rry84 wrote: @cozzie
Is it anywhere possible to have the bot detect it and set it automatically?
i don't know about this. maybe need packet capture :s
This is because the less the users have to deal with it the better and we can put it in servers.txt without much issues.
Make Openkore Awesome. Join the team.
sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: StorageCapacity shouldn't be hardcoded

#8 Post by sli »

Yeah, packet capture is possible and probably simple. Can the bot add to a server entry?
cs : ee : realist