Time parameter for tempgroup
This commit is contained in:
parent
1b69a47d71
commit
cd353c27a3
2 changed files with 14 additions and 0 deletions
|
|
@ -22,9 +22,11 @@ using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Timers;
|
||||||
using Terraria;
|
using Terraria;
|
||||||
using TShockAPI.DB;
|
using TShockAPI.DB;
|
||||||
using TShockAPI.Net;
|
using TShockAPI.Net;
|
||||||
|
using Timer = System.Timers.Timer;
|
||||||
|
|
||||||
namespace TShockAPI
|
namespace TShockAPI
|
||||||
{
|
{
|
||||||
|
|
@ -111,6 +113,8 @@ namespace TShockAPI
|
||||||
/// The player's temporary group. This overrides the user's actual group.
|
/// The player's temporary group. This overrides the user's actual group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Group tempGroup = null;
|
public Group tempGroup = null;
|
||||||
|
|
||||||
|
public Timer tempGroupTimer;
|
||||||
|
|
||||||
private Group group = null;
|
private Group group = null;
|
||||||
|
|
||||||
|
|
@ -523,6 +527,11 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void TempGroupTimerElapsed(object sender, ElapsedEventArgs args)
|
||||||
|
{
|
||||||
|
tempGroup = null;
|
||||||
|
}
|
||||||
|
|
||||||
public void SendWorldInfo(int tilex, int tiley, bool fakeid)
|
public void SendWorldInfo(int tilex, int tiley, bool fakeid)
|
||||||
{
|
{
|
||||||
using (var ms = new MemoryStream())
|
using (var ms = new MemoryStream())
|
||||||
|
|
|
||||||
|
|
@ -1022,6 +1022,11 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
RememberedPos.InsertLeavePos(tsplr.Name, tsplr.IP, (int) (tsplr.X/16), (int) (tsplr.Y/16));
|
RememberedPos.InsertLeavePos(tsplr.Name, tsplr.IP, (int) (tsplr.X/16), (int) (tsplr.Y/16));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tsplr.tempGroupTimer != null)
|
||||||
|
{
|
||||||
|
tsplr.tempGroupTimer.Stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The last player will leave after this hook is executed.
|
// The last player will leave after this hook is executed.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue