www.ClassicTW.com
http://classictw.com/

TWX Error: ListSectorParams
http://classictw.com/viewtopic.php?f=15&t=35121
Page 1 of 1

Author:  Hammer_2 [ Mon Oct 23, 2017 6:47 pm ]
Post subject:  TWX Error: ListSectorParams

Hi All,

ListSectorPArams only returns a max of 13 results for a sector

Code:

setSectorParameter 10 "test1" TRUE
setSectorParameter 10 "test2" FALSE
setSectorParameter 10 "test3" TRUE
setSectorParameter 10 "test4" FALSE
setSectorParameter 10 "test5" TRUE
setSectorParameter 10 "test6" TRUE
setSectorParameter 10 "test7" TRUE
setSectorParameter 10 "test8" TRUE
setSectorParameter 10 "test9" TRUE
setSectorParameter 10 "test10" TRUE
setSectorParameter 10 "test11" TRUE
setSectorParameter 10 "test12" TRUE
setSectorParameter 10 "test13" TRUE
setSectorParameter 10 "test14" TRUE
setSectorParameter 10 "test15" TRUE
setSectorParameter 10 "test16" TRUE
setSectorParameter 10 "test17" TRUE
setSectorParameter 10 "test18" TRUE
setSectorParameter 10 "test19" TRUE
setSectorParameter 10 "test20" TRUE


listSectorParameters 10 $parms
setVar $b 1
while ($b <= $parms)
   getSectorParameter 10 $parms[$b]  $check
   echo "* $parms[$b] "  $parms[$b] " " $check
   add $b 1
end
add $a 1



Returns:

Quote:
$parms[$b] MSLSEC 1
$parms[$b] FIGSEC 0
$parms[$b] test1 1
$parms[$b] test2 0
$parms[$b] test3 1
$parms[$b] test4 0
$parms[$b] test5 1
$parms[$b] test6 1
$parms[$b] test7 1
$parms[$b] test8 1
$parms[$b] test9 1
$parms[$b] test10 1
$parms[$b] test11 1


I've specified far more than 13 vars here.

I noted the issue because EP HAggle sets 13 all by itself!

Quote:
R Remmah EQUIPMENTL: 228
R Remmah EQUIPMENTH: 228
R Remmah EQUIPMENT-: -62
R Remmah EQUIPMENT+: -62
R Remmah MCIC: -47
R Remmah FUELL: 227
R Remmah FUELH: 227
R Remmah FUEL-: 85
R Remmah FUEL+: 85
R Remmah ORGANICSL: 160
R Remmah ORGANICSH: 160
R Remmah ORGANICS-: 55
R Remmah ORGANICS+: 55


Or am I doing something wrong?

just a FYI even tho this doesn't return the other parameters you can still get their values using getSectorParamater - So they are there, just not returned in the List.

Thanks

Hamish

Author:  ElderProphet [ Mon Oct 23, 2017 10:42 pm ]
Post subject:  Re: TWX Error: ListSectorParams

Wow, I can confirm that this is a bug. Seems to just be with the listSectorParameters command. Nice catch. I'll get it updated.

+EP+

Author:  Micro [ Tue Oct 24, 2017 12:08 am ]
Post subject:  Re: TWX Error: ListSectorParams

It isn't actually a bug, there is an intentional limit of 13, although that seems like an odd number to use... lol

Would 25 be enough, or just make it unlimited?

Attachments:
listsectorparams.png
listsectorparams.png [ 12.63 KiB | Viewed 11370 times ]

Author:  Hammer_2 [ Tue Oct 24, 2017 1:07 am ]
Post subject:  Re: TWX Error: ListSectorParams

Well this is only the display of the parameters, the rest are still there; they just don't get listed. I tested this when I was testing if ports had busted, they weren't being listed in the listSectorParameters but were showing up in the getSectorParam BUSTED.

So really I can't see why that is there at all! Unless there is some other issue where it keeps getting "empty" parameters and this solves it.

I say make it 32, because that's a nice round computer number :)

Author:  Shadow [ Wed Oct 25, 2017 8:28 pm ]
Post subject:  Re: TWX Error: ListSectorParams

Micro wrote:
It isn't actually a bug, there is an intentional limit of 13, although that seems like an odd number to use... lol

Would 25 be enough, or just make it unlimited?


Hey Micro,

What version is that snippet from?

Are you actually able to compile twx and have it work? I ask because most of the attempts I've seen at compiling or modifying recent versions seem to have, uh, undesirable results.

Author:  Micro [ Thu Oct 26, 2017 12:27 am ]
Post subject:  Re: TWX Error: ListSectorParams

Shadow wrote:
Micro wrote:
It isn't actually a bug, there is an intentional limit of 13, although that seems like an odd number to use... lol

Would 25 be enough, or just make it unlimited?


Hey Micro,

What version is that snippet from?

Are you actually able to compile twx and have it work? I ask because most of the attempts I've seen at compiling or modifying recent versions seem to have, uh, undesirable results.

Yes, I have a stable compile. I'm trying to track down one last unhandled exception when closing a connection, and then I will make a release.

Author:  ElderProphet [ Thu Oct 26, 2017 7:11 pm ]
Post subject:  Re: TWX Error: ListSectorParams

I'm not sure what I was thinking when I limited it to 13, but it was supposed to be removed after testing. That's what I meant by bug. It should be unlimited.

+EP+

Author:  Micro [ Sat Oct 28, 2017 12:51 am ]
Post subject:  Re: TWX Error: ListSectorParams

ElderProphet wrote:
I'm not sure what I was thinking when I limited it to 13, but it was supposed to be removed after testing. That's what I meant by bug. It should be unlimited.

+EP+

Maybe it was one of those runaway loops we all love so much. If it was debug code you forgot to remove, then i guess it is kind of a bug, but it was essentially doing what it was told. I kept it at 64, just in case there was a runaway loop.

When i think of a real bug, I think more about the type of bugs in tcp.pas. You may not recognize the file when I upload the copy I am currently testing. I thought it would be fixed when I removed the "Client Disconnected" message box, but it was also throwing dozens of unhanded exceptions per second while disconnecting/reconnecting, and attempting at least 4 reconnects per second when using Mombot. Now that is what I call a plethora of bugs.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/