Public Web Editor

Topics related to tools created by the Core Team or 3rd-party community members.

Moderator: Team Members

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » Sat Mar 30, 2019 7:09 pm

It will come in time. Right now just trying to get things working and making sense.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » Wed Apr 03, 2019 7:02 pm

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
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Public Web Editor

Post by Jabantiz » Wed Apr 03, 2019 7:48 pm

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;

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » Wed Apr 03, 2019 8:01 pm

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.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » Wed Apr 03, 2019 8:23 pm

Speedy reply there Jabantiz...just saying.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » Thu Apr 04, 2019 6:00 am

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

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » Thu Apr 04, 2019 6:13 am

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
Last edited by Gangrenous on Thu Apr 04, 2019 9:05 am, edited 1 time in total.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » Thu Apr 04, 2019 7:13 am

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

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Public Web Editor

Post by Ememjr » Thu Apr 04, 2019 8:49 am

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

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » Thu Apr 04, 2019 8:57 am

Hmmm, errr....hmmm....let me look
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » Thu Apr 04, 2019 9:01 am

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

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Public Web Editor

Post by Ememjr » Thu Apr 04, 2019 9:02 am

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

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Public Web Editor

Post by Gangrenous » 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.
Resident Dirty Hippy

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Public Web Editor

Post by Ememjr » Thu Apr 04, 2019 9:10 am

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

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Public Web Editor

Post by Ememjr » Thu Apr 04, 2019 9:11 am


Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests