public void Read(RakNet.BitStream stream, RakNet.Packet packet, Client client) { int plID = 0; stream.Read(out plID); if (plID == 0 || !sWorld.VobDict.ContainsKey(plID)) { throw new Exception("Vob not found!"); } Vob vob = sWorld.VobDict[plID]; if (!(vob is Player)) { throw new Exception("Vob is not an Player!"); } if (Player.Hero == vob) { return; } vob.Despawn(); sWorld.removeVob(vob); }
public void Read(RakNet.BitStream stream, RakNet.Packet packet, Client client) { int vobID = 0; stream.Read(out vobID); if (vobID == 0 || !sWorld.VobDict.ContainsKey(vobID)) { throw new Exception("Vob not found!"); } Vob vob = sWorld.VobDict[vobID]; sWorld.getWorld(vob.Map).removeVob(vob); vob.Despawn(); }
public void Read(RakNet.BitStream stream, RakNet.Packet packet, Client client) { int plID = 0; String levelName = ""; stream.Read(out plID); stream.Read(out levelName); if (Player.Hero.ID != plID) { Vob pl = sWorld.VobDict[plID]; pl.Despawn(); sWorld.getWorld(levelName).addVob(pl); pl.Spawn(pl.Map, pl.Position, pl.Direction); } else { zString ln = zString.Create(Process.ThisProcess(), levelName); oCGame.Game(Process.ThisProcess()).ChangeLevel(ln, ln); ln.Dispose(); } }