Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database error #6

Open
gpn39f opened this issue Oct 13, 2013 · 9 comments
Open

Database error #6

gpn39f opened this issue Oct 13, 2013 · 9 comments

Comments

@gpn39f
Copy link

gpn39f commented Oct 13, 2013

on Public Function GetQuestMenu
in class WS.Quests.vb

is a query:

[code]
WorldDatabase.Query(String.Format("SELECT s.questid, q.Title, q.Level_Normal, q.specialflags FROM queststarters s LEFT JOIN quests q ON (s.questid=q.id) WHERE s.type = {0} AND s.typeid = {1} AND q.Level_Start <= {2} AND (q.Required_Race = 0 OR (Required_Race & {4}) > 0) AND (q.Required_Class = 0 OR (Required_Class & {5}) > 0) " & _
"AND NOT EXISTS(SELECT * FROM characters_quests WHERE char_guid = {3} AND quest_status <> -2 AND quest_id = q.id) AND (q.Required_Quest1 = 0 OR EXISTS(SELECT * FROM characters_quests WHERE char_guid = {3} AND quest_status = -1 AND quest_id = q.Required_Quest1)) " & _
"AND (q.Required_Quest2 = 0 OR EXISTS(SELECT * FROM characters_quests WHERE char_guid = {3} AND quest_status = -1 AND quest_id = q.Required_Quest2)) AND (q.Required_Quest3 = 0 OR EXISTS(SELECT * FROM characters_quests WHERE char_guid = {3} AND quest_status = -1 AND quest_id = q.Required_Quest3)) " & _
"AND (q.Required_Quest4 = 0 OR EXISTS(SELECT * FROM characters_quests WHERE char_guid = {3} AND quest_status = -1 AND quest_id = q.Required_Quest4));", _
CType(QuestGiverType.QUEST_OBJECTTYPE_CREATURE, Byte), CType(WORLD_CREATUREs(GUID), CreatureObject).ID, c.Level, c.GUID, 1 << (c.Race - 1), 1 << (c.Classe - 1)), MySQLQuery)
[/code]

this query is not only stored on table worlddatabase, but in CharacterDatabase to.

is there are profi, there can split this to a new query over two databases?

later in the class the next function have a similar query over two databases..

@gpn39f
Copy link
Author

gpn39f commented Oct 18, 2013

we have now split the database in 3 databases. i think it is not possible to create one query that can take a filter for more and one database. so i try to do it in 2 steps..
i think this is very slow..
someone with a better Idee?

@billy1arm
Copy link

it will be possible with a join, i did something similar in ServerOne.

Any chance of a push of the changes ?

@gpn39f
Copy link
Author

gpn39f commented Oct 18, 2013

look at my changes in my fork :-)
can a join sample data from different databases???
also between accessdatabase.realm and worlddatabase.creature ???

@billy1arm
Copy link

yes, with some cleaver coding ;)

@billy1arm
Copy link

Point me at the lines you need adjusting and I’ll post the required changes

If you are a member of the getmangos forum, please PM me (ID: Antz) with your email / skype details and we can chat more)

From: Frank [mailto:[email protected]]
Sent: 18 October 2013 20:44
To: mangosvb/serverTwo
Cc: Antz
Subject: Re: [serverTwo] Database error (#6)

look at my changes in my fork :-)
can a join sample data from different databases???


Reply to this email directly or view it on GitHub #6 (comment) . https://github.com/notifications/beacon/oaF1d12tQ5hKyEU6svQ6h4B-6BeCtD4DJkf6_-UzC7Xq0tvS94WwdwrjJFFmFKsP.gif

@gpn39f
Copy link
Author

gpn39f commented Oct 19, 2013

it's on ws.quest.vb

Public Function GetQuestMenu
Public Function GetQuestMenuGO
Public Function GetQuestgiverStatus

in this function's there are many of query typ with join "queststarters on worlddatabase" and "characters_quests on characterdatabase"

if i see a example i can try to fix the rest :-)

I'm now on work, i'm back late to day..

@billy1arm
Copy link

@gpn39f
Copy link
Author

gpn39f commented Oct 28, 2013

Super.. thanks..

I was update my fork, include you’re corrections.

Found some more errors on packet, changed in 335

now we can move on J

Frank

Von: Antz [mailto:[email protected]]
Gesendet: Montag, 28. Oktober 2013 14:34
An: mangosvb/serverTwo
Cc: Frank
Betreff: Re: [serverTwo] Database error (#6)

please look at https://github.com/mangosvb/serverOne/blob/master/Server/WorldServer/WS.Quests.vb

Lines 537 onwards


Reply to this email directly or view it on GitHub #6 (comment) . https://github.com/notifications/beacon/CVbCK3wKjFbWhf7M4-goom6E2GWUB9AGZI-nW114_eyEWef-nnVsuF6tXH6qEmWS.gif

@billy1arm
Copy link

frank, can you contact me on the getmangos.co.uk forum using pm ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants