diff --git a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj
index 03135e26..5f77be8f 100644
--- a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj
+++ b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj
@@ -87,6 +87,8 @@
+
+
diff --git a/FFXIVClassic Map Server/actors/director/Director.cs b/FFXIVClassic Map Server/actors/director/Director.cs
index 6007003f..047fbc26 100644
--- a/FFXIVClassic Map Server/actors/director/Director.cs
+++ b/FFXIVClassic Map Server/actors/director/Director.cs
@@ -110,6 +110,9 @@ namespace FFXIVClassic_Map_Server.actors.director
p.QueuePacket(GetInitPackets(p.actorId));
}
}
+
+
+ StartCoroutine("mainLoop", this);
}
public void AddMember(Actor actor)
@@ -223,5 +226,21 @@ namespace FFXIVClassic_Map_Server.actors.director
return null;
}
+ private List StartCoroutine(string funcName, params object[] args)
+ {
+ if (directorScript != null)
+ {
+ if (!directorScript.Globals.Get(funcName).IsNil())
+ {
+ currentCoroutine = directorScript.CreateCoroutine(directorScript.Globals[funcName]).Coroutine;
+ DynValue value = currentCoroutine.Resume(args);
+ LuaEngine.GetInstance().ResolveResume(null, currentCoroutine, value);
+ }
+ else
+ Program.Log.Error("Could not find script for director {0}.", GetName());
+ }
+ return null;
+ }
+
}
-}
+}
\ No newline at end of file
diff --git a/FFXIVClassic Map Server/actors/director/GuildleveDirector.cs b/FFXIVClassic Map Server/actors/director/GuildleveDirector.cs
index f7987df3..fe116210 100644
--- a/FFXIVClassic Map Server/actors/director/GuildleveDirector.cs
+++ b/FFXIVClassic Map Server/actors/director/GuildleveDirector.cs
@@ -36,7 +36,7 @@ namespace FFXIVClassic_Map_Server.actors.director
guildleveWork.startTime = Utils.UnixTimeStampUTC();
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/start", this, actorId);
propertyBuilder.AddProperty("guildleveWork.startTime");
- SendPacketsToPlayers(propertyBuilder.Done());
+ SendPacketsToPlayers(propertyBuilder.Done());
}
public void EndGuildleve()
diff --git a/FFXIVClassic Map Server/dataobjects/Session.cs b/FFXIVClassic Map Server/dataobjects/Session.cs
index 8c35d6dd..5a83c565 100644
--- a/FFXIVClassic Map Server/dataobjects/Session.cs
+++ b/FFXIVClassic Map Server/dataobjects/Session.cs
@@ -38,7 +38,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
public void QueuePacket(SubPacket subPacket, bool isAuthed, bool isEncrypted)
{
- //subPacket.header.targetId = id;
+ subPacket.header.targetId = id;
Server.GetWorldConnection().QueuePacket(subPacket, isAuthed, isEncrypted);
}
diff --git a/FFXIVClassic Map Server/lua/LuaEngine.cs b/FFXIVClassic Map Server/lua/LuaEngine.cs
index cf778c05..9ffcf5e4 100644
--- a/FFXIVClassic Map Server/lua/LuaEngine.cs
+++ b/FFXIVClassic Map Server/lua/LuaEngine.cs
@@ -372,12 +372,12 @@ namespace FFXIVClassic_Map_Server.lua
CallLuaFunction(player, target, "onEventStarted", false, LuaUtils.CreateLuaParamObjectList(lparams));
}
- private DynValue ResolveResume(Player player, Coroutine coroutine, DynValue value)
+ public DynValue ResolveResume(Player player, Coroutine coroutine, DynValue value)
{
if (value == null || value.IsVoid())
return value;
- if (value.String != null && value.String.Equals("_WAIT_EVENT"))
+ if (player != null && value.String != null && value.String.Equals("_WAIT_EVENT"))
{
GetInstance().AddWaitEventCoroutine(player, coroutine);
}
diff --git a/FFXIVClassic Map Server/packets/send/Actor/SetActorPropetyPacket.cs b/FFXIVClassic Map Server/packets/send/Actor/SetActorPropetyPacket.cs
index a20ccb82..cc41cdfb 100644
--- a/FFXIVClassic Map Server/packets/send/Actor/SetActorPropetyPacket.cs
+++ b/FFXIVClassic Map Server/packets/send/Actor/SetActorPropetyPacket.cs
@@ -113,7 +113,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
string[] split = name.Split('.');
int arrayIndex = 0;
- if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork")))
+ if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork") || split[0].Equals("guildleveWork")))
return false;
Object curObj = actor;
diff --git a/data/scripts/directors/Guildleve/PrivateGLBattleDetectNormal.lua b/data/scripts/directors/Guildleve/PrivateGLBattleDetectNormal.lua
index 9c54a2ab..26c30a2e 100644
--- a/data/scripts/directors/Guildleve/PrivateGLBattleDetectNormal.lua
+++ b/data/scripts/directors/Guildleve/PrivateGLBattleDetectNormal.lua
@@ -3,25 +3,22 @@ require ("guildleve")
--DirectorId, GuildleveId, Aetheryte Location (6 or ~6), exMarkerX, exMarkerY, exMarkerZ
-local guildleveId;
-
-function init(thisDirector, glId)
- guildleveId = glId;
-
- guildleveData = GetGuildleveGamedata(glId);
+function init(thisDirector)
+ guildleveData = GetGuildleveGamedata(thisDirector.guildleveId);
members = thisDirector:GetPlayerMembers();
if (members ~= nil and #members ~= 0) then
player = members[0];
- player:SendGameMessage(GetWorldMaster(), 50036, 0x20, glId, player, 0); --"You have started the leve..."
+ player:SendGameMessage(GetWorldMaster(), 50036, 0x20, thisDirector.guildleveId, player, 0); --"You have started the leve..."
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, false));
end
- return "/Director/Guildleve/PrivateGLBattleDetectNormal", 0x4e25, glId, 6, 0, 0, 0;
+ return "/Director/Guildleve/PrivateGLBattleDetectNormal", 0x4e25, thisDirector.guildleveId, 6, 0, 0, 0;
end
function mainLoop(thisDirector)
-
+ wait(3)
+ thisDirector:StartGuildleve();
end
\ No newline at end of file