mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Cysharp.Threading.Tasks;
|
|
using JNGame.Runtime.Util;
|
|
|
|
namespace AppGame
|
|
{
|
|
|
|
public class TileServerInfo
|
|
{
|
|
public int tile;
|
|
public String server;
|
|
public String ip;
|
|
public int port;
|
|
public bool master;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 游戏API
|
|
/// </summary>
|
|
public class GAPI
|
|
{
|
|
|
|
//获取ID
|
|
public UniTask<NewsContext<int>> NSyncTileId = App.API.GetNews<int>($"/sync/tile/id");
|
|
public UniTask<NewsContext<int>> NSyncTileRandomId = App.API.GetNews<int>($"/sync/tile/random/id");
|
|
//获取端口
|
|
public UniTask<NewsContext<int>> NSyncTilePort = App.API.GetNews<int>($"/sync/tile/port");
|
|
//获取主连接
|
|
public UniTask<NewsContext<TileServerInfo>> NSyncTileServer(int index) => App.API.GetNews<TileServerInfo>($"/sync/tile/server?index={index}");
|
|
//获取所有连接
|
|
public UniTask<NewsContext<List<TileServerInfo>>> NSyncTileListServer(int index) => App.API.GetNews<List<TileServerInfo>>($"/sync/tile/servers?index={index}");
|
|
//获取玩家Id
|
|
public UniTask<NewsContext<int>> NSyncTileClientId = App.API.GetNews<int>($"/sync/tile/client/id");
|
|
|
|
}
|
|
} |