Full Version : Compile Errors with latest svn
xmlspawner >>Troubleshooting >>Compile Errors with latest svn
<< Prev | Next >>
Packer898- 12-02-2007
Just a couple errors with the latest svn that I need help with. Thanks.
Error:

CODE
+ Custom/Engines/XML Spawner [2.0] Version 3.12/XmlSpawnerGumps.cs: CS0117: Line 989: 'System.Collections.Generic.IEnumerable<Server.Gumps.Gump> ' does not contain a definition for 'Count' CS0021: Line 991: Cannot apply indexing with [] to an expression of type 'Sy
stem.Collections.Generic.IEnumerable<Server.Gumps.Gump>'
CS0117: Line 1022: 'System.Collections.Generic.IEnumerable<Server.Gumps.Gump
>' does not contain a definition for 'Remove'

Script:

CODE
public static void RefreshSpawnerGumps( Mobile from ) { if(from == null) return; NetState ns = from.NetState; if ( ns != null && ns.Gumps != null)
{
//ArrayList current = new ArrayList();
List<Gump> current = new List<Gump>();
for ( int i = 0; i < ns.Gumps.Count; ++i )//Line 989
{
current.Add(ns.Gumps[i]);//Line 991
}
// close all of the currently opened spawner gumps
from.CloseGump(typeof(XmlSpawnerGump));
ArrayList refresh = new ArrayList();
for ( int i = 0; i < current.Count; ++i )
{
Gump g = (Gump)current[i];
if(g is XmlSpawnerGump)
{
XmlSpawnerGump xg = (XmlSpawnerGump)g;
// clear the gump status on the spawner associated with the gump
if(xg.m_Spawner != null)
{
// and add the old gump to the removal list
refresh.Add(xg);
}
}
}
// remove the closed gumps from the gump collection
foreach(XmlSpawnerGump g in refresh)
{
ns.Gumps.Remove(g);//Line 1022
}
// reopen the closed gumps from the gump collection
foreach(XmlSpawnerGump g in refresh)
{
// reopen a new gump for the spawner
if(g.m_Spawner != null && g.m_Spawner.SpawnerGump == g)
{
// flag the current gump on the spawner as closed
g.m_Spawner.GumpReset = true;
XmlSpawnerGump xg = new XmlSpawnerGump(g.m_Spawner, g.X, g.Y, g.m_ShowGump,g.xoffset, g.page, g.Rentry);
from.SendGump(xg );
}
}
}
}

ArteGordon- 12-02-2007
you need to update to the most recent xmlspawner version or at least get the latest xmlspawnergump.cs
read this post
http://xmlspawner.15.forumer.com/index.php...wtopic=580&st=0
You will probably want to update the xmlspawner package so that you have the most recent svn support for things like the latest client.
Packer898- 12-04-2007
Thanks Arte got it going. =)-