mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-20 11:47:48 +00:00
Added functions to allow for an improved seamless zone change. Player can now pull actors from two zones when performing a seamless zone change to give a improved feel.
This commit is contained in:
parent
63edbe81f3
commit
b43a6885c5
3 changed files with 36 additions and 5 deletions
|
@ -324,7 +324,7 @@ namespace FFXIVClassic_Map_Server
|
||||||
z.SpawnAllActors(true);
|
z.SpawnAllActors(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Moves the actor to the new zone if exists. No packets are sent nor position changed.
|
//Moves the actor to the new zone if exists. No packets are sent nor position changed. Merged zone is removed.
|
||||||
public void DoSeamlessZoneChange(Player player, uint destinationZoneId)
|
public void DoSeamlessZoneChange(Player player, uint destinationZoneId)
|
||||||
{
|
{
|
||||||
Area oldZone;
|
Area oldZone;
|
||||||
|
@ -344,6 +344,30 @@ namespace FFXIVClassic_Map_Server
|
||||||
|
|
||||||
newZone.AddActorToZone(player);
|
newZone.AddActorToZone(player);
|
||||||
|
|
||||||
|
player.zone = newZone;
|
||||||
|
player.zoneId = destinationZoneId;
|
||||||
|
|
||||||
|
player.zone2 = null;
|
||||||
|
player.zoneId2 = 0;
|
||||||
|
|
||||||
|
LuaEngine.OnZoneIn(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Adds a second zone to pull actors from. Used for an improved seamless zone change.
|
||||||
|
public void MergeZones(Player player, uint mergedZoneId)
|
||||||
|
{
|
||||||
|
//Add player to new zone and update
|
||||||
|
Zone mergedZone = GetZone(mergedZoneId);
|
||||||
|
|
||||||
|
//This server does not contain that zoneId
|
||||||
|
if (mergedZone == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mergedZone.AddActorToZone(player);
|
||||||
|
|
||||||
|
player.zone2 = mergedZone;
|
||||||
|
player.zoneId2 = mergedZone.actorId;
|
||||||
|
|
||||||
LuaEngine.OnZoneIn(player);
|
LuaEngine.OnZoneIn(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
public ushort moveState, oldMoveState;
|
public ushort moveState, oldMoveState;
|
||||||
public float[] moveSpeeds = new float[5];
|
public float[] moveSpeeds = new float[5];
|
||||||
|
|
||||||
public uint zoneId;
|
public uint zoneId, zoneId2;
|
||||||
public Area zone = null;
|
public Area zone = null;
|
||||||
|
public Area zone2 = null;
|
||||||
public bool isZoning = false;
|
public bool isZoning = false;
|
||||||
|
|
||||||
public bool spawnedFirstTime = false;
|
public bool spawnedFirstTime = false;
|
||||||
|
|
|
@ -1246,7 +1246,13 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
{
|
{
|
||||||
|
|
||||||
//Update Instance
|
//Update Instance
|
||||||
playerSession.UpdateInstance(zone.GetActorsAroundActor(this, 50));
|
|
||||||
|
List<Actor> aroundMe = new List<Actor>();
|
||||||
|
|
||||||
|
aroundMe.AddRange(zone.GetActorsAroundActor(this, 50));
|
||||||
|
if (zone2 != null)
|
||||||
|
aroundMe.AddRange(zone2.GetActorsAroundActor(this, 50));
|
||||||
|
playerSession.UpdateInstance(aroundMe);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue