|
@@ -29,6 +29,8 @@ namespace ET.Server
|
|
|
PlayerInfo playerInfo = new PlayerInfo();
|
|
|
playerInfo.Id = IdGenerater.Instance.GenerateUnitId(scene.DomainZone());
|
|
|
|
|
|
+ GameDouyinComponent douyinComponent = Root.Instance.Scene.GetComponent<GameDouyinComponent>();
|
|
|
+
|
|
|
if (tokenIsNull)
|
|
|
{
|
|
|
// Token为空初始化信息
|
|
@@ -37,14 +39,19 @@ namespace ET.Server
|
|
|
playerInfo.AvatarUrl = "";
|
|
|
playerInfo.Name = "主播-" + playerInfo.Id;
|
|
|
|
|
|
- scene.AddComponent<GameDouyinComponent>().TokenIsNull = true;
|
|
|
+ if (douyinComponent == null)
|
|
|
+ {
|
|
|
+ Root.Instance.Scene.AddComponent<GameDouyinComponent, bool>(true);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- // 添加抖音组件
|
|
|
- GameDouyinComponent douyinComponent = scene.AddComponent<GameDouyinComponent>();
|
|
|
+ if (douyinComponent == null)
|
|
|
+ {
|
|
|
+ douyinComponent = Root.Instance.Scene.AddComponent<GameDouyinComponent, bool>(false);
|
|
|
|
|
|
- douyinComponent.TokenIsNull = false;
|
|
|
+ douyinComponent.InitAccessToken();
|
|
|
+ }
|
|
|
|
|
|
JObject roomInfo = douyinComponent.GetRoomInfo(request.Token.Trim());
|
|
|
|