コード例 #1
0
ファイル: Server.cs プロジェクト: ysguoqiang/FrameUpdate
    private void __onDisconn(NetworkMessage netMsg)
    {
        if (playerDic.ContainsKey(netMsg.conn.connectionId))
        {
            Message.Leave leave = new Message.Leave();
            leave.playerId = playerDic[netMsg.conn.connectionId].playerId;

            NetworkServer.SendToAll(MessageType.Leave, leave);


            playerDic.Remove(netMsg.conn.connectionId);
        }
        Log.Instance.Info(string.Format("Client: {0} 下线", netMsg.conn.connectionId));
    }
コード例 #2
0
ファイル: Client.cs プロジェクト: ysguoqiang/FrameUpdate
    private void __onLeave(NetworkMessage netMsg)
    {
        Message.Leave leave = netMsg.ReadMessage <Message.Leave>();

        GameManager.Instance.RemovePlayer(leave.playerId);
    }