add:添加服务器脚本
This commit is contained in:
@@ -101,7 +101,9 @@ namespace Valheim
|
||||
[SyncVar]
|
||||
public long vistEnd = 0;
|
||||
// 总游玩时长
|
||||
private int vistAllTime = (int)(60 * 15F);
|
||||
public int vistAllTime = (int)(60 * 15F);
|
||||
|
||||
public float curGameTime = 0;
|
||||
// 游戏是否结束
|
||||
[NonSerialized]
|
||||
[SyncVar]
|
||||
@@ -282,6 +284,11 @@ namespace Valheim
|
||||
battleArea.SetActive(false);
|
||||
}
|
||||
|
||||
public int GetNowTime()
|
||||
{
|
||||
return Mathf.RoundToInt(curGameTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建复活点
|
||||
/// </summary>
|
||||
@@ -1585,7 +1592,7 @@ namespace Valheim
|
||||
if (GameInit.Ins.place == Place.GongSi1LouShiwai)
|
||||
authInfo.shop = 999;
|
||||
#endif
|
||||
authInfo.gameId = 4;
|
||||
authInfo.gameId = (int)GameInit.Ins.gameId;
|
||||
string authJson = JsonUtility.ToJson(authInfo);
|
||||
Debug.Log("发送数据 -> " + authJson);
|
||||
request.RawData = System.Text.Encoding.UTF8.GetBytes(authJson);
|
||||
@@ -1892,6 +1899,11 @@ namespace Valheim
|
||||
}, 75f);
|
||||
|
||||
}
|
||||
|
||||
if (isPlayGame)
|
||||
{
|
||||
curGameTime += Time.deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user