feat jenkins cicd

This commit is contained in:
2025-12-31 23:34:44 +08:00
parent 670140e7d3
commit 01621ec237
32 changed files with 505 additions and 92 deletions

View File

@@ -7,7 +7,7 @@ public class PlayerManager : MonoBehaviour
public GameObject playerPrefab;
public Transform playerScene;
private Dictionary<int, PlayerMove> _players = new();
private Dictionary<long, PlayerMove> _players = new();
public static PlayerManager Instance { get; private set; }
@@ -32,10 +32,10 @@ public class PlayerManager : MonoBehaviour
private GameObject AddPlayer(PositionInfo info)
{
var player = Instantiate(playerPrefab, playerScene);
player.GetComponent<PlayerInfo>().uid = info.UID;
player.GetComponent<PlayerInfo>().usn = info.USN;
var move = player.GetComponent<PlayerMove>();
move.SetPosition(info.X, info.Y);
_players.Add(info.UID, move);
_players.Add(info.USN, move);
return player;
}
@@ -51,13 +51,13 @@ public class PlayerManager : MonoBehaviour
var position = S2C_Position.Parser.ParseFrom(msg);
foreach (var info in position.Info)
{
if (!_players.ContainsKey(info.UID))
if (!_players.ContainsKey(info.USN))
{
AddPlayer(info);
}
else
{
_players[info.UID].SetPosition(info.X, info.Y);
_players[info.USN].SetPosition(info.X, info.Y);
}
}
}

View File

@@ -21,8 +21,8 @@ public class SocketManager : MonoBehaviour
public async void Connect()
{
// _ws = new WebSocket($"wss://www.hlsq.asia/ws/?token={Random.Range(1, 1000)}");
_ws = new WebSocket($"ws://127.0.0.1:8501/?token={Random.Range(1, 1000)}");
_ws = new WebSocket($"wss://www.hlsq.asia/ws/?token={Random.Range(1, 1000)}");
// _ws = new WebSocket($"ws://127.0.0.1:8501/?token={Random.Range(1, 1000)}");
_ws.OnOpen += () =>
{

View File

@@ -30,7 +30,7 @@ public class PlayerControl : MonoBehaviour
private void SendMoveInput(Vector2 direction)
{
Debug.Log($"SendMoveInput {direction} {transform.GetComponent<PlayerInfo>().uid}");
Debug.Log($"SendMoveInput {direction} {transform.GetComponent<PlayerInfo>().usn}");
_lastSentDirection = direction;
_lastSendTime = Time.time;
SocketManager.Instance.SendMessage(MessageID.Action, new C2S_Action

View File

@@ -2,5 +2,5 @@ using UnityEngine;
public class PlayerInfo : MonoBehaviour
{
[HideInInspector] public int uid;
[HideInInspector] public long usn;
}