mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
30 lines
730 B
C#
30 lines
730 B
C#
|
using System.Threading.Tasks;
|
|||
|
using Plugins.JNGame.Network.Group;
|
|||
|
|
|||
|
namespace AppGame.Systems
|
|||
|
{
|
|||
|
public class JNGClientGroup : JNClientGroup<JNGClient>
|
|||
|
{
|
|||
|
|
|||
|
//玩家Id
|
|||
|
private int clientId;
|
|||
|
|
|||
|
public int ClientID => clientId;
|
|||
|
|
|||
|
public override async Task OnInit()
|
|||
|
{
|
|||
|
clientId = (await App.GAPI.NSyncTileClientId).data;
|
|||
|
await base.OnInit();
|
|||
|
}
|
|||
|
|
|||
|
public override void AddClient(JNGClient client)
|
|||
|
{
|
|||
|
base.AddClient(client);
|
|||
|
//向服务器发送玩家Id
|
|||
|
client.Send((int)GActionEnum.BindClientID,new RClientIDMessage()
|
|||
|
{
|
|||
|
ClientId = clientId
|
|||
|
});
|
|||
|
}
|
|||
|
}
|
|||
|
}
|