Is it possible to check for a player class to filter a gossip menu? - azerothcore

Im trying to implement a condition that will check for the class of the player so only one class can access the gossip.
I founded https://www.azerothcore.org/wiki/conditions and its well written, but the part that im looking for is not yet explained.
That is the CONDITION_CLASS section.
Looks like it checks the table ChrClasses.dbc, but its empty, so im stuck.
I dont know if the answer is to populate the table with the classes but as for now i dont know what to do.

Related

Algolia - WordPress - how can I get the actual query into JS variable to work with it further in the hits template?

I would like to do some interesting stuff with the hits that are being displayed based on the search query that user is not only typing into search box but actually filtering using the instant search filters. I have filter based on hierarchical events_location taxonomy. Based on what user selected I would get the info in JS variable that I can then further use to do other operations in the hits div, specifically on each hit card.
So my URL when searching updates like this:
/what-to-see/?q=&idx=sdbeta_posts_events&p=0&hFR%5Btaxonomies_hierarchical.events_calendar.lvl0%5D%5B0%5D=JUL%204&hFR%5Btaxonomies_hierarchical.events_category.lvl0%5D%5B0%5D=All&hFR%5Btaxonomies_hierarchical.events_locations.lvl0%5D%5B0%5D=Paddock%20Stage
I could potentially take the URL and extract the data from it, but I am sure there is more elegant way of working with the query.
In InstantSearch.js, the state is managed by another library called the algoliasearch-helper. Through this library you can read and write the search parameters.
The cleanest to access the helper is to build a custom widget, which is a plain object with lifecycle hooks (initial rendering and the other renderings). You can read more about custom widgets there.
Once you've accessed the helper, you can read and write with the helper API.
This can be found under search.searchParameters
So:
console.log(search.searchParameters);
Will give you whole object that you can then work with.
There is however one issue with this and that is that it works only on initial load. I was unable to make this work or get any data after starting to selecting categories. So if anyone knows how to use this so it updates after each selection please comment bellow.

Find `MenuItem` by id `lookup`?

It seems to not be possible to find MenuItems using Parent#lookup because they're items, not children - is this correct? Is there another way to find one by id without writing a complete new search algorithm?
Since I'm using Clojure, not Java, using a controller class is not an option.

what is the difference between System.Net.Cookie and System.Web.HttpCookie?

I obtain a HTTPCookie, but need a Net.Cookie. Are they just something you can recast, or how would i go about it?
Actually you have two questions:
Difference between System.Web.HttpCookie and System.Net.Cookie
How to convert from HTTPCookie to a Cookie.
Part 1)
This question is really interesting ,I'm still thinking why there are two classes which looks pretty same ,My initial thought was System.Web.HttpCookie inherits System.Net.Cookie but this isn't true both directly inherit from Object so they are distinct classes ,but the properties matches a lot ,so this gives a hope for the solution of part 2.
Part 2)
I think its possible to convert one into another theoretically since both are just objects if you populate them the right way it will work , here a little analysis when I compared the two classes.
Click to open in new tab to enlarge
Update:
The System.Web is made to be used in server-based apps and System.Net can be used for client based apps.
Some Thoughts:
Write a method or a static class which can convert one object into another, I haven't check all of them but properties whose names match, there signature also matches.
Properties which don't exists in the another object you can stuff some constant or a value which you know matches the scenario like Port number.
Good luck ,let me know how you came up with the final solution ,post the code or link.
Some Links
this post has some related code

What is a good approach to bind an entityproxy to a UI component?

I'm currently working on a GWT project. The thing is, I find very hard to believe that I need to repeat some boilerplate over and over to bind the data from an EntityProxy (say a getSomeData() method) to a UI component (say a TextBox).
How do you guys overcome this issue? For now I have to create a method to read from the TextBox and set it to the EntityProxy, and a method to write to the TextBox after reading from the EntityProxy.
Basically, it's always the same! i.e.:
// Update the text box
T someData = entity.getSomeData();
textBox.setText(someData);
// Update the entity
String value = textBox.getText();
entity.setSomeData(value);
You get my point? I'm aware there is no Reflection at client side. I could use deffered binding but I'm not sure how or if it is a good approach with RequestFactory's EntityProxys.
Thank you
I use the technique you have defined in your question to push and collect data from my controls. Recently I have found out that there is a built-in feature of GWT called Editors. I didn't have a chance to try it myself yet but perhaps you want to check it out it seems promising. Also here is another useful link from Thomas Broyer's blog about Editors

How to persist a change in a DBML

I have a table of users called Users
And a view called UsersActive that filters out deactivated users.
When I create my DBML, I drag the Users table in, then I change the property on the table to point to UsersActive.
This works well, until the DBML gets re-created.
Does anyone know how to fix this?
I've tried overriding the
[Table(Name="dbo.Users")]
attribute in a partial class but get the error:
Duplicate 'Table' attribute
Does anyone know how to go about this?
Thanks in advance!
-Ev
You should just be able to add the View to the DBML, just like a table...yes?
Update: No, it will probably not maintain the relationships -- views don't have relationships.
It sounds like your goal is to query active users in a simple way, without having to specify the criterion in each query?
What you might do then is to have a repository class with a method of GetUsers(). That method does the Linq query and ensures that the active criterion is always there.
Perhaps the method would have a signature of Respository.GetUsers(bool includeDeativated = false). Calling GetUsers() without arguments will not return deactivated, but you can override it if desired.

Resources