mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +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
|
@ -20,6 +20,8 @@ using FFXIVClassic_Map_Server.actors.group;
|
|||
using FFXIVClassic_Map_Server.packets.send.group;
|
||||
using FFXIVClassic_Map_Server.packets.WorldPackets.Receive;
|
||||
using FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace FFXIVClassic_Map_Server
|
||||
{
|
||||
|
@ -37,6 +39,9 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
private Server mServer;
|
||||
|
||||
private const int MILIS_LOOPTIME = 10;
|
||||
private Timer mZoneTimer;
|
||||
|
||||
public WorldManager(Server server)
|
||||
{
|
||||
mServer = server;
|
||||
|
@ -801,6 +806,21 @@ namespace FFXIVClassic_Map_Server
|
|||
SubPacket groupInviteResultPacket = GroupInviteResultPacket.BuildPacket(player.playerSession, groupType, result);
|
||||
player.QueuePacket(groupInviteResultPacket);
|
||||
}
|
||||
|
||||
public void StartZoneThread()
|
||||
{
|
||||
mZoneTimer = new Timer(ZoneThreadLoop, null, 0, MILIS_LOOPTIME);
|
||||
Program.Log.Info("Zone Loop has started");
|
||||
}
|
||||
|
||||
public void ZoneThreadLoop(Object state)
|
||||
{
|
||||
lock (zoneList)
|
||||
{
|
||||
foreach (Area area in zoneList.Values)
|
||||
area.Update(MILIS_LOOPTIME);
|
||||
}
|
||||
}
|
||||
|
||||
public Player GetPCInWorld(string name)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue