(tools, client, server) feat: Remove gRPC support, add TCP back and reorganized project
This commit is contained in:
@ -1,14 +0,0 @@
|
||||
using Network;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
public class GrpcClientTest : MonoBehaviour
|
||||
{
|
||||
private async void Start()
|
||||
{
|
||||
var loginResult = await GrpcClient.Instance.Login("野兽先辈", "114514");
|
||||
Debug.Log($"Received login result: {loginResult.Result}");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98c1b145899d4d97bd981b177b5c45a9
|
||||
timeCreated: 1752478138
|
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}");
|
||||
}
|
||||
}
|
||||
}
|
2
Client/Assets/Scripts/Test/TcpClientTest.cs.meta
Normal file
2
Client/Assets/Scripts/Test/TcpClientTest.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e722dcca5e226864b964cd80358a17f9
|
@ -8,7 +8,7 @@ namespace Test
|
||||
{
|
||||
private async void Start()
|
||||
{
|
||||
var sendBytes = Encoding.UTF8.GetBytes("Test 汉语 and English simultaneously!");
|
||||
var sendBytes = Encoding.UTF8.GetBytes("This is a test string sent via UDP.");
|
||||
|
||||
var receivedBytes = await UnityUdpClient.Instance.SendAndReceiveData(sendBytes);
|
||||
var receivedString = Encoding.UTF8.GetString(receivedBytes);
|
||||
|
Reference in New Issue
Block a user