|
@@ -12,7 +12,6 @@ namespace ET.Server
|
|
|
protected override void Awake(MapDouyinLiveCommentComponent self)
|
|
|
{
|
|
|
Log.Info($"创建抖音直播评论任务组件...");
|
|
|
- // self.StartTask();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -21,6 +20,14 @@ namespace ET.Server
|
|
|
protected override void Destroy(MapDouyinLiveCommentComponent self)
|
|
|
{
|
|
|
Log.Info($"销毁抖音直播评论任务组件");
|
|
|
+
|
|
|
+ bool tokenIsNull = self.GetParent<Map>().TokenIsNull();
|
|
|
+
|
|
|
+ if (tokenIsNull)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
self.StopTask();
|
|
|
}
|
|
|
}
|
|
@@ -29,6 +36,12 @@ namespace ET.Server
|
|
|
{
|
|
|
protected override void Update(MapDouyinLiveCommentComponent self)
|
|
|
{
|
|
|
+ bool tokenIsNull = self.GetParent<Map>().TokenIsNull();
|
|
|
+
|
|
|
+ if (tokenIsNull)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 运行中状态
|
|
|
if (self.Status == 3)
|
|
|
{
|
|
@@ -74,7 +87,7 @@ namespace ET.Server
|
|
|
{
|
|
|
// 请求头
|
|
|
Dictionary<string, string> head = new Dictionary<string, string>();
|
|
|
- head.Add("access-token", self.GetParent<Map>().AccessToken);
|
|
|
+ head.Add("access-token", self.GetParent<Map>().GetDouyinAccessToken());
|
|
|
// 参数
|
|
|
JObject param = new JObject();
|
|
|
param.Add("roomid", self.GetParent<Map>().RoomId.ToString());
|
|
@@ -111,7 +124,7 @@ namespace ET.Server
|
|
|
{
|
|
|
// 请求头
|
|
|
Dictionary<string, string> head = new Dictionary<string, string>();
|
|
|
- head.Add("access-token", self.GetParent<Map>().AccessToken);
|
|
|
+ head.Add("access-token", self.GetParent<Map>().GetDouyinAccessToken());
|
|
|
// 参数
|
|
|
JObject param = new JObject();
|
|
|
param.Add("roomid", self.GetParent<Map>().RoomId.ToString());
|
|
@@ -147,7 +160,7 @@ namespace ET.Server
|
|
|
private static int CheckTaskStatus(this MapDouyinLiveCommentComponent self)
|
|
|
{
|
|
|
Dictionary<string, string> head = new Dictionary<string, string>();
|
|
|
- head.Add("access-token", self.GetParent<Map>().AccessToken);
|
|
|
+ head.Add("access-token", self.GetParent<Map>().GetDouyinAccessToken());
|
|
|
// 参数
|
|
|
Dictionary<string, string> param = new Dictionary<string, string>();
|
|
|
param.Add("roomid", self.GetParent<Map>().RoomId.ToString());
|