mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-19 21:57:12 +08:00
(tools, client, server) feat: Remove gRPC support, add TCP back and reorganized project
This commit is contained in:
19
Client/Assets/Scripts/Test/TcpClientTest.cs
Normal file
19
Client/Assets/Scripts/Test/TcpClientTest.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Network;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
public class TcpClientTest : MonoBehaviour
|
||||
{
|
||||
private async void Start()
|
||||
{
|
||||
var sendBytes = Encoding.UTF8.GetBytes("This is a test string sent via TCP.");
|
||||
|
||||
var receivedBytes = await UnityTcpClient.Instance.SendAndReceiveData(sendBytes);
|
||||
var receivedString = Encoding.UTF8.GetString(receivedBytes);
|
||||
|
||||
Debug.Log($"Received string: {receivedString}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user