View Full Version : No list updates?
jag111
11-07-2003, 04:09 PM
So I'm not sure when it happened, but at some point with all of these client changes, a change was made that has caused the spawn list information to not be updated anymore.
i.e. When you first zone in or do a list refresh, you get the current status of all spawns in the zone and all of the columns show the current data at that point in time. But from then on, no updates are made to that data visibly.
What's interesting is that it looks like we *are* updating the properties of the listitem for each spawn, it's just that updated listitem is never pushed to the actual lstSpawnList control.
I'm attempting to re-enable this, but the "easy" way is currently doubling the cpu utilization and causing a ton of flicker when the list updates. So I need to find a better way to do this.
MQSEQ2
11-07-2003, 06:22 PM
Look in the:
private void ProcessPacket(byte[] packet, int bytes)
Around this code area:
if (newSpawns.Count > 0)
{
lstSpawnList.BeginUpdate();
ListViewItem[] items = new ListViewItem[newSpawns.Count];
int d = 0;
foreach(ListViewItem i in newSpawns)
items[d++] = i;
lstSpawnList.Items.AddRange(items);
lstSpawnList.EndUpdate();
newSpawns.Clear();
}
jag111
11-08-2003, 10:39 AM
Right. That code adds any new spawns to the list. It doesn't do anything to update information for spawns that are already in the list.
Spawns only get added to that newSpawns arraylist if they aren't found in the mobs hashtable.
MQSEQ2
11-08-2003, 05:15 PM
Yes t checks the HashTable and if not found then will add to list. in that same section it checks to see if the name changes (ie corpse) then it will update the List.
What are you wanting to update? The X,Y,Z stuff don't get updated in the current code due to the slow refresh I guess. I will look at fixing that if I can.
jag111
11-08-2003, 07:45 PM
What I'm saying is that even if you did uncomment the code that checks for X,Y,Z,Distance changes, it wouldn't update the visible list...it'd only update the listitem that is part of each SPAWNINFO structure.
It's ok though. I'm working on it. It falls right in line with the View filter changes I'm working on (which btw, are almost done).
MQSEQ2
11-08-2003, 09:25 PM
Cool let me know when you get them done so I can add them to the source code.
I know the Spawn List wouldn't get updated but you can look at this code to figure out how it's done:
// now keep a reference to the listview item to speed up lookups.
ListViewItem li = mob.listitem ;
string oldname = FixMobName(mob.Name);
string newname = FixMobName(si.Name);
// use replace so that we dont loose the alert prefixes.
li.Text = li.Text.Replace(oldname,newname);
mob.Name = si.Name;
The li.Text will update the actual ListView. If you try this make sure you to use:
lstSpawnList.BeginUpdate();
{Your Code Here}
lstSpawnList.EndUpdate();
This will prevent it refreshing everytime you make a change and wait till it's all done so it will look very fast.
jag111
11-08-2003, 09:43 PM
GOOD GOD, shoot me! I have just been on crack the whole time i thought it wasn't updating.
Originally, I had tried uncommenting the code that would update the X,Y,Z, and Distance columns and it wasn't updating on the list. BUT, I had forgotten there was code that set the X,Y,Z values equal to each other between the new spawn packet and the existing spawn in the hastable. So I spent like 3 hours trying to debug why the X,Y,Z wasn't getting updated before I realized it.
The only thing left that doesn't work how I would think it would is that when the list gets updated, it doesn't re-sort based on the info that's changed. You'd have to manually reverse sort, and re-sort to get the new sort order.
However, I realize that in some situations, people may not like the autosorting because the list would jump around to much. So I'll throw a toggle option in there to specify whether you want the list to re-sort automatically when details change in the list.
MQSEQ2
11-09-2003, 01:10 AM
Sounds cool. We need to add the option to bold mobs without using the Alerts. Maybe double clicking or something.
Also need to add a textbox so folks can enter a mobs name and it adds it to the hunt list (without it being in the Alerts). Need to add a way to Right Click Spawn List and have option to add it to the Zone Alert Hunt/Caution/Rare.
Once these are added have it to a autorefresh to show the changes.
These are some of the things folks are currently asking for.
I spent about 8 hrs trying to convert the SetACL functions and finally found an easier way of doing it.
Powered by vBulletin® Version 4.1.11 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.