Public Web Editor
Moderator: Team Members
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: Public Web Editor
It will come in time. Right now just trying to get things working and making sense.
Resident Dirty Hippy
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: Public Web Editor
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
https://www.w3schools.com/js/js_bitwise.asp
Resident Dirty Hippy
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Public Web Editor
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
Then I divided by int32 max to get the "second" int32 and then do the checks on that for the rest of the classes
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;
Code: Select all
var advClasses2 = Math.floor(advClasses / 4294967296);
if ( (advClasses2 & 1) > 0) document.getElementById("cbRogue").checked = true;
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: Public Web Editor
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.
Shit works though. And no ajax callbacks on it, it just works.
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>
Resident Dirty Hippy
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: Public Web Editor
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.
Resident Dirty Hippy
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: Public Web Editor
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
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
Last edited by Gangrenous on Thu Apr 04, 2019 9:05 am, edited 1 time in total.
Resident Dirty Hippy
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: Public Web Editor
Moving along, it all works. Randomly clicking on different classes saves and retrieves fine.
You do not have the required permissions to view the files attached to this post.
Resident Dirty Hippy
- Ememjr
- Team Member
- Posts: 975
- Joined: Wed Mar 15, 2017 9:41 am
- EQ2Emu Server: Perseverance
Re: Public Web Editor
hmm i though tinkering would be in there as wellGangrenous 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
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: Public Web Editor
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?
Resident Dirty Hippy
- Ememjr
- Team Member
- Posts: 975
- Joined: Wed Mar 15, 2017 9:41 am
- EQ2Emu Server: Perseverance
Re: Public Web Editor
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
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
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: Public Web Editor
Looks like 0. Take an item Troll Snot Flinger(48982), it shows tradeskill_classes = 0 and that is a tinkered item.
Resident Dirty Hippy
- Ememjr
- Team Member
- Posts: 975
- Joined: Wed Mar 15, 2017 9:41 am
- EQ2Emu Server: Perseverance
Re: Public Web Editor
but look further cuz i havent , yet, is it restricted to a tinkerer or can any one use itGangrenous 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.
a blueprint would be better to look at since a blue print can only be scribed by a tinker
- Ememjr
- Team Member
- Posts: 975
- Joined: Wed Mar 15, 2017 9:41 am
- EQ2Emu Server: Perseverance
Re: Public Web Editor
https://eq2.fandom.com/wiki/Troll_Snot_Flinger
is usuable by all TS classes
is usuable by all TS classes
Who is online
Users browsing this forum: No registered users and 0 guests