How to reset a quest or zone - world-of-warcraft

Is there a way to reset a quest or area in Azerothcore such that the quest giver or quest objectives are at their initial states?
I've encountered some problems when a player completes a quest that is not resetting, thereby preventing other players from doing the quest. One such quest is Torek's Assault in Ashenvale. After quest completion, the quest NPCs do not respawn at their starting positions to enable other players to perform the same quest.
Another type of problem is when a player completes the Hellfire Fortifications quest by capturing the three outposts in Hellfire Peninsula. In a server where all players are playing the same faction, only the first one gets to complete the quest. Is there any way to put the outposts back to neutral as a GM? If not, could it be done by modifying the database?

You don't reset the quest zone to achieve what you wish.
All of your issues seem to be related with creature scripting instead of zone bugs.
Each of your issues can be broken down into these 2 points:
Torek's Assault in Ashenvale. After quest completion, the quest NPCs do not respawn at their starting positions to enable other players to perform the same quest.
Your problem is that you need to despawn your desired NPCs. You need to get the closest creature entry within a certain radius and start despawning out of combat every x seconds if this is done via SmartAI. With core scripts you would need to iterate through all the found creatures and despawn them.
Another type of problem is when a player completes the Hellfire
Fortifications quest by capturing the three outposts in Hellfire
Peninsula. In a server where all players are playing the same faction,
only the first one gets to complete the quest
Is this creature's script Smart AI or core script? Is the event on repeat? Is the creature correctly scripted?

Look at the command table and our wiki, maybe there is a command for that.
Otherwise you could delete something in the Db probably but again I'm not really versed in the subject, just trying to give you some hints.
What you should do is try to do the quest alone on a dev server, see before and after, what data has been inserted, then delete it to reset it.

Create a SAI for that creature. Make him to respawn at location where you want ( With the timer, or on quest taken/complete

Related

Best way to implement background “timer” functionality in Python/Django

I am trying to implement a Django web application (on Python 3.8.5) which allows a user to create “activities” where they define an activity duration and then set the activity status to “In progress”.
The POST action to the View writes the new status, the duration and the start time (end time, based on start time and duration is also possible to add here of course).
The back-end should then keep track of the duration and automatically change the status to “Finished”.
User actions can also change the status to “Finished” before the calculated end time (i.e. the timer no longer needs to be tracked).
I am fairly new to Python so I need some advice on the smartest way to implement such a concept?
It needs to be efficient and scalable – I’m currently using a Heroku Free account so have limited system resources, but efficiency would also be important for future production implementations of course.
I have looked at the Python threading Timer, and this seems to work on a basic level, but I’ve not been able to determine what kind of constraints this places on the system – e.g. whether the spawned Timer thread might prevent the main thread from finishing and releasing resources (i.e. Heroku Dyno threads), etc.
I have read that persistence might be a problem (if the server goes down), and I haven’t found a way to cancel the timer from another process (the .cancel() method seems to rely on having the original object to cancel, and I’m not sure if this is achievable from another process).
I was also wondering about a more “background” approach, i.e. a single process which is constantly checking the database looking for activity records which have reached their end time and swapping the status.
But what would be the best way of implementing such a server?
Is it practical to read the database every second to find records with an end time of “now”? I need the status to change in real-time when the end time is reached.
Is something like Celery a good option, or is it overkill for a single process like this?
As I said I’m fairly new to these technologies, so I may be missing other obvious solutions – please feel free to enlighten me!
Thanks in advance.
To achieve this you need some kind of scheduling tasks functionality. For a fast simpler implementation is a good solution to use the Timer object from the
Threading module.
A more complete solution is tu use Celery. If you are new, deeping in it will give you a good value start using celery as a queue manager distributing your work easily across several threads or process.
You mentioned that you want it to be efficient and scalable, so I guess you will want to implement similar functionalities that will require multiprocessing and schedule so for that reason my recommendation is to use celery.
You can integrate it into your Django application easily following the documentation Integrate Django with Celery.

For how long are Game Center matches (GKMatch) available?

In iOS 10, the Game Center app is gone, so I'm assuming that it would be a good idea to offer the possibility of deleting matches directly from the app, but does Game Center do some housekeeping on its own?
If users don't delete a match manually, does the match stay listed forever? Would it be a good idea to delete finished or abandoned matches after some time (6 months, maybe)? or does Game Center already do something like it?
Game center doesn't delete any matches, at least, it's never deleted any of my turn-based matches (barring the one big migration from the sandbox GC env, but that was a non-backwards-compatible upgrade, not housekeeping).
From the very start, though, I've always provided a list of of inprogress matches in the game, allowing users to resume and delete matches. One benefit of this approach: if the user deleted the match from the old game center app, the match just went away. It turns out the match would be deleted but the other players were never notified. Other players were stranded perpetually while waiting for the "deleter" to finish a turn that would never be finished. By managing the deletion inside the app, you can issue the appropriate "quit game" (in-turn, out-of-turn) call to salvage the game for the other players.
Now that they've removed the game center app, the responsibility to manage the matches does seem to fall entirely to us but I don't think the above trap scenario can happen anymore. I believe that's an improvement. We now don't have to worry about events happening outside our app that we're not aware of and can't recover from.

LabView playing more than one sound at the time

I'm using event structure and want to do some like Launchpad.
Numeric keyboard have for each number added a sound.
Problem is, that when I press number example one, the program is waiting when the music stop play and next I can press example number four.
Is it possible, to play sounds from 3 key's at the same time using event structure ?
I put the files online here and added screenshots below. Block diagram:
Front panel:
Working Solution
I think I got this working much more easily than I expected using the Play Sound File VI under the Graphics and Sound -> Sound -> Output palette. That link is the 2011 documentation (couldn't find a more recent link), but it does not look like it has changed. The working result is shown below, with two different events handled by the event structure:
Key Down? event:
Stop Button event:
You may be fine without using the Sound Output Clear VI to the right of the main event loop, but having it there won't hurt.
It turns out that the Play Sound File VI does not block, so you can play multiple overlapping sound files. If you run into blocking on your machine (one sound file plays, then the next, and so on), let me know because I have another solution that might work.
A word on events
An important thing to understand is that events are handled in a queue. When you press keys, those key presses go in order onto the event queue. Each time your event-handling loop executes, it takes the oldest event out of that queue and processes it. The event structure in LabVIEW will only handle one event per iteration of your event-handling loop. On the next iteration, if events are still in the queue that your structure is set up to process, it will take the next-oldest one for that iteration and repeat.
Now, lets say that you want to do some super complicated processing that takes 10 seconds every time you press a key, and you put that processing inside of your main event loop. Your key presses still go onto the event queue as fast as you press them, but LabVIEW has to wait the full 10 seconds before it can dequeue the next keypress and process it, so you end up with an application that seems to hang while it chugs through the queue much slower than you are adding items to the queue.
One way to get around this is to take that complicated processing and put it outside of the queue in another process. If you have the resources, you can actually call a separate instance of a processing sub-VI in its own thread for every one of those key presses. This allows the event handling loop to spawn processes as fast as you can press keys, and then your processes take whatever time they need to simultaneously (resources permitting) perform whatever actions you wanted.
Essentially that is what the Play Sound File VI is doing. It sees that you want to play a file and spawns a process to play that sound over the speakers, allowing the event-handling loop to continue immediately rather than waiting for the sound to finish playing. As you press more keys, more processes get spawn that kill themselves when they are finished. You can do this manually too, which is the other solution that I have for you if Play Sound File does not behave the same way for you as it did for me.
Update:
Thanks to #Engineero for pointing out that Play Sound File vi actually isn't blocking. The updated code shows how to play overlapping sounds. I'll leave it to the user to add the Stop Sound on Key Up code. No timeout is needed because nothing is taking place in the event structure.
Also, note that for me the Play Sound vi needed to be in a while loop to keep playing. Not sure why this is needed, but the NI examples sets it up this way (\examples\Graphics and Sound\Sound\Sound Player.vi).
Finally, you may crash the vi if your sound card gets overwhelmed as mentioned here. If that happens I would go with a better sound library to try and squeeze more performance out of your sound card.
Original:
First, I assume you a referring to this Launchpad?
I was able to press up to 4 keys at once will the following - the important thing is to set the event timeout to 1 ms. If you need more than that it will require a more sophisticated design.
I was no able to easily implement a sound because all the basic LabVIEW beeps are what's considered "blocking I/O" meaning if you call 2 Beeps simultaneously than Windows will play one after another not both at the same time. You will need to implement you instrument notes using non blocking I/O probably in a language other than LabVIEW such as this C++ library.

As a user, I want a status bar (or similar) to notify me that a job is working when using a Wx.Python gui app

Can someone recommend a straight forward way of adding some type of graphical notification (status bar, spinning clocks, etc...) to my wx.Python gui application? Currently, it searches logs on a server for unique strings, and often times takes upwards to 3-4 minutes to complete. However, it would be convenient to have some type of display letting a user know that the status of the job towards finishing/completion. If I added a feature like this, I'm not sure, but I'm afraid I may have to look at using threads ... and I'm a complete newbie to Python? Any help and direction will be appreciated.
Yes, you'd need to use threads or queues or something similar. Fortunately, there are some excellent examples here: http://wiki.wxpython.org/LongRunningTasks and this tutorial I wrote is pretty straight-forward too: http://www.blog.pythonlibrary.org/2010/05/22/wxpython-and-threads/
Using threads isn't that hard. Basically you put the long running part in the thread and every so often, you send a status update to your GUI using a thread-safe method, like wx.PostEvent or wx.CallAfter. Then you can update your statusbar or a progress bar or whatever you're using.

How to monitor screen updates?

I am trying to write a program that monitors when the screen has been redrawn.
Meaning if any part of any window is redrawn, then the program is notified.
As far as I understand I should use a journal record hook like at
http://www.vbaccelerator.com/home/vb/code/libraries/Hooks/Journal_Record_Hooks/article.asp
However, I do not understand which MSG type would get me the WM_PAINT events (WH_CALLWNDPROC and WH_CALLWNDPROCRET do not seem to do the job). I'm not even sure that WM_PAINT is what I'm looking for...
Basically, if I knew when the DC associated with GetDesktopWindow() has changed then my problem would be solved.
Question is: How do you monitor screen updates?
I don't believe this is possible without hooking the display driver. I can imagine there would be some serious performance implications if it were possible in general...
You would be better taking a screenshot every second or whatever. Every version of Windows has the little network icon in the tray always changing when you transfer data over a network, meaning the screen will be changing pretty much constantly.

Resources