Page 2 of 5
Re: Public Web Editor
Posted: Sat Mar 30, 2019 7:09 pm
by Gangrenous
It will come in time. Right now just trying to get things working and making sense.
Re: Public Web Editor
Posted: Wed Apr 03, 2019 7:02 pm
by Gangrenous
Well I finally hit a small hiccup after great progress. It appears javascript cannot do bitwise past 32 bit. Bitwise or Bitmask, depending on what you want to call it is pretty important on displaying our class list and other things. So basically with MVC I was transferring back the item classes and just looping them and performing a bitwise operator against them. As soon as I hit the higher integers it starting failing and I already new it was going to be a large int problem. I am not sure what to do about this just yet. My original solution was elegant, I hate band aids and ugly solutions.
https://www.w3schools.com/js/js_bitwise.asp
Re: Public Web Editor
Posted: Wed Apr 03, 2019 7:48 pm
by Jabantiz
I had this problem as well, if i remember right i split it into two int32's then did the bitmask checks. I will look at the code I came up with and edit this post with it.
EDIT: So I first did the bitmask operations on the value I got
Code: Select all
var advClasses = document.getElementById("AdvClasses").value;
if ( (advClasses & 2) > 0) document.getElementById("cbFighter").checked = true;
Then I divided by int32 max to get the "second" int32 and then do the checks on that for the rest of the classes
Code: Select all
var advClasses2 = Math.floor(advClasses / 4294967296);
if ( (advClasses2 & 1) > 0) document.getElementById("cbRogue").checked = true;
Re: Public Web Editor
Posted: Wed Apr 03, 2019 8:01 pm
by Gangrenous
I saw that solution, and something that Google had written, but that would mean importing in yet another library. As it is, I really want to strip anything not used out of this before it gets pushed out. I found a nice way of dealing with it in the control itself. Laravel uses Eloquent as a data modeler. In the control itself, I will do something like this.
Code: Select all
<td>{!! isset($item) ? Form::checkbox('class_assassin', 0, 1099511627776 & $item->adventure_classes, ['id'=>'class_assassin', 'name'=>'class_assassin', 'class'=>'control-click' ]) : '' !!}Assassin</td>
Shit works though. And no ajax callbacks on it, it just works.
Re: Public Web Editor
Posted: Wed Apr 03, 2019 8:23 pm
by Gangrenous
Speedy reply there Jabantiz...just saying.
Re: Public Web Editor
Posted: Thu Apr 04, 2019 6:00 am
by Gangrenous
Anyone know the tradeskill_classes bitmask? Looking at the items table, it appears to follow the same design as character_classes. I can probably figure them out by trial and error but it would save time if someone knows them. Searching did not help, neither did the source.
Re: Public Web Editor
Posted: Thu Apr 04, 2019 6:13 am
by Gangrenous
This may be it. I think originally adorning was throwing me off.
0 Tinkering
1 Adorning
2 Artisan
4 Craftsman
8 PROVISIONER
16 WOODWORKER
32 CARPENTER
64 OUTFITTER
128 ARMORER
256 WEAPONSMITH
512 TAILOR
1024 SCHOLAR
2048 JEWELER
4096 SAGE
8192 ALCHEMIST
Re: Public Web Editor
Posted: Thu Apr 04, 2019 7:13 am
by Gangrenous
Moving along, it all works. Randomly clicking on different classes saves and retrieves fine.
Re: Public Web Editor
Posted: Thu Apr 04, 2019 8:49 am
by Ememjr
Gangrenous wrote: Thu Apr 04, 2019 6:13 am
This may be it. I think originally adorning was throwing me off.
1 Adorning
2 Artisan
4 Craftsman
8 PROVISIONER
16 WOODWORKER
32 CARPENTER
64 OUTFITTER
128 ARMORER
256 WEAPONSMITH
512 TAILOR
1024 SCHOLAR
2048 JEWELER
4096 SAGE
8192 ALCHEMIST
hmm i though tinkering would be in there as well
Re: Public Web Editor
Posted: Thu Apr 04, 2019 8:57 am
by Gangrenous
Hmmm, errr....hmmm....let me look
Re: Public Web Editor
Posted: Thu Apr 04, 2019 9:01 am
by Gangrenous
I see one note about it being 0, but that may had been ID 0, not the bitmask. If you made the bitmask 0 for tinkering, everything would be tinkering. At least that is my though?
Re: Public Web Editor
Posted: Thu Apr 04, 2019 9:02 am
by Ememjr
in our db items that are restricted to adorners and also
items that are restricter to tinkerer both us bit 0 and have a value of 1 under tradeskill class
not sure if that is our doing or info from census, when i get a change ill get a couple of tinker books, and a couple adorning books and see what the bitmap it is using
Re: Public Web Editor
Posted: Thu Apr 04, 2019 9:05 am
by Gangrenous
Looks like 0. Take an item Troll Snot Flinger(48982), it shows tradeskill_classes = 0 and that is a tinkered item.
Re: Public Web Editor
Posted: Thu Apr 04, 2019 9:10 am
by Ememjr
Gangrenous wrote: Thu Apr 04, 2019 9:05 am
Looks like 0. Take an item Troll Snot Flinger(48982), it shows tradeskill_classes = 0 and that is a tinkered item.
but look further cuz i havent , yet, is it restricted to a tinkerer or can any one use it
a blueprint would be better to look at since a blue print can only be scribed by a tinker
Re: Public Web Editor
Posted: Thu Apr 04, 2019 9:11 am
by Ememjr