-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJoinPartyTask.cs
More file actions
69 lines (58 loc) · 1.83 KB
/
JoinPartyTask.cs
File metadata and controls
69 lines (58 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System.Linq;
using System.Threading.Tasks;
using DreamPoeBot.Loki.Bot;
using DreamPoeBot.Loki.Common;
using DreamPoeBot.Loki.Game;
using FollowBot.Helpers;
using log4net;
namespace FollowBot
{
class JoinPartyTask : ITask
{
private readonly ILog Log = Logger.GetLoggerInstanceForType();
public string Name { get { return "JoinPartyTask"; } }
public string Description { get { return "This task will ask for party."; } }
public string Author { get { return "NotYourFriend, origial code from Unknown"; } }
public string Version { get { return "0.0.0.1"; } }
public void Start()
{
Log.InfoFormat("[{0}] Task Loaded.", Name);
}
public void Stop()
{
}
public void Tick()
{
}
public async Task<bool> Run()
{
if (LokiPoe.InstanceInfo.PartyStatus == DreamPoeBot.Loki.Game.GameData.PartyStatus.PartyMember)
{
return false;
}
if (LokiPoe.InstanceInfo.PartyStatus == DreamPoeBot.Loki.Game.GameData.PartyStatus.PartyLeader)
{
await PartyHelper.LeaveParty();
return true;
}
var invite = LokiPoe.InstanceInfo.PendingPartyInvites;
if(invite.Any())
{
await PartyHelper.HandlePartyInvite();
}
else if (LokiPoe.InstanceInfo.PartyStatus == DreamPoeBot.Loki.Game.GameData.PartyStatus.None)
{
return true;
}
return true;
}
public async Task<LogicResult> Logic(Logic logic)
{
return LogicResult.Unprovided;
}
public MessageResult Message(Message message)
{
return MessageResult.Unprocessed;
}
}
}