mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-12 23:44:34 +02:00
Added a thread and update() calls for gamestate changing.
This commit is contained in:
parent
6a6ee67ae2
commit
9372b4bc32
7 changed files with 78 additions and 0 deletions
|
@ -303,6 +303,10 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket);
|
||||
}
|
||||
|
||||
public void Update(double deltaTime)
|
||||
{
|
||||
}
|
||||
|
||||
public void GenerateActorName(int actorNumber)
|
||||
{
|
||||
//Format Class Name
|
||||
|
|
|
@ -373,5 +373,14 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(double deltaTime)
|
||||
{
|
||||
lock (mActorList)
|
||||
{
|
||||
foreach (Actor a in mActorList.Values)
|
||||
a.Update(deltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -482,6 +482,30 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return;
|
||||
}
|
||||
|
||||
public void Update(double deltaTime)
|
||||
{
|
||||
LuaScript parent = null, child = null;
|
||||
|
||||
if (File.Exists("./scripts/base/" + classPath + ".lua"))
|
||||
parent = LuaEngine.LoadScript("./scripts/base/" + classPath + ".lua");
|
||||
if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier)))
|
||||
child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier));
|
||||
|
||||
if (parent == null && child == null)
|
||||
{
|
||||
//LuaEngine.SendError(player, String.Format("ERROR: Could not find script for actor {0}.", GetName()));
|
||||
return;
|
||||
}
|
||||
|
||||
//Run Script
|
||||
if (child != null && child.Globals["onThink"] != null)
|
||||
child.Call(child.Globals["onThink"], this, deltaTime);
|
||||
else if (parent != null && parent.Globals["onThink"] != null)
|
||||
parent.Call(parent.Globals["onThink"], this, deltaTime);
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
//A party member list packet came, set the party
|
||||
/* public void SetParty(MonsterPartyGroup group)
|
||||
{
|
||||
|
|
|
@ -1361,5 +1361,10 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
currentParty = null;
|
||||
}
|
||||
|
||||
public void Update(double delta)
|
||||
{
|
||||
LuaEngine.OnPlayerUpdate(this, delta);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue