Added inventory over websockets, death reporting, taper reporting.
This commit is contained in:
parent
ebf6fd0bf7
commit
28bdf7f312
7 changed files with 273 additions and 8 deletions
|
|
@ -17,6 +17,7 @@ namespace Mag.Shared
|
|||
public int Id;
|
||||
public int LastIdTime;
|
||||
public int ObjectClass;
|
||||
public int Icon;
|
||||
|
||||
public SerializableDictionary<int, bool> BoolValues = new SerializableDictionary<int, bool>();
|
||||
public SerializableDictionary<int, double> DoubleValues = new SerializableDictionary<int, double>();
|
||||
|
|
@ -26,12 +27,13 @@ namespace Mag.Shared
|
|||
public List<int> ActiveSpells = new List<int>();
|
||||
public List<int> Spells = new List<int>();
|
||||
|
||||
public void Init(bool hasIdData, int id, int lastIdTime, int objectClass, IDictionary<int, bool> boolValues, IDictionary<int, double> doubleValues, IDictionary<int, int> intValues, IDictionary<int, string> stringValues, IList<int> activeSpells, IList<int> spells)
|
||||
public void Init(bool hasIdData, int id, int lastIdTime, int objectClass, int icon, IDictionary<int, bool> boolValues, IDictionary<int, double> doubleValues, IDictionary<int, int> intValues, IDictionary<int, string> stringValues, IList<int> activeSpells, IList<int> spells)
|
||||
{
|
||||
HasIdData = hasIdData;
|
||||
Id = id;
|
||||
LastIdTime = lastIdTime;
|
||||
ObjectClass = objectClass;
|
||||
Icon = icon;
|
||||
|
||||
AddTo(boolValues, doubleValues, intValues, stringValues);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,13 +35,19 @@ namespace Mag.Shared
|
|||
for (int i = 0; i < wo.SpellCount; i++)
|
||||
spells.Add(wo.Spell(i));
|
||||
|
||||
mwo.Init(wo.HasIdData, wo.Id, wo.LastIdTime, (int)wo.ObjectClass, boolValues, doubleValues, intValues, stringValues, activeSpells, spells);
|
||||
mwo.Init(wo.HasIdData, wo.Id, wo.LastIdTime, (int)wo.ObjectClass, wo.Icon, boolValues, doubleValues, intValues, stringValues, activeSpells, spells);
|
||||
|
||||
return mwo;
|
||||
}
|
||||
|
||||
public static MyWorldObject Combine(MyWorldObject older, WorldObject newer)
|
||||
{
|
||||
// Always repair missing icons from old JSON files (plugin upgrades)
|
||||
if (older.Icon == 0 && newer.Icon != 0)
|
||||
{
|
||||
older.Icon = newer.Icon;
|
||||
}
|
||||
|
||||
if (!older.HasIdData || newer.HasIdData)
|
||||
return Create(newer);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue