Exemplo n.º 1
0
        public IMcpeMessageHandler CreatePlayer(INetworkHandler session, PlayerInfo playerInfo)
        {
            EssentialPlayer player = (EssentialPlayer)factory.CreatePlayer(_server, session.GetClientEndPoint(), playerInfo);

            player.NetworkHandler  = session;
            player.CertificateData = playerInfo.CertificateData;
            player.Username        = playerInfo.Username;
            player.ClientUuid      = playerInfo.ClientUuid;
            player.ServerAddress   = playerInfo.ServerAddress;
            player.ClientId        = playerInfo.ClientId;
            player.Skin            = playerInfo.Skin;
            player.PlayerInfo      = playerInfo;
            player.PlayerJoin     += OnPlayerJoin;
            player.PlayerLeave    += OnPlayerLeave;
            if (player.IsOp())
            {
                player.PermissionLevel = PermissionLevel.Operator;
            }
            else
            {
                player.PermissionLevel = PermissionLevel.Member;
            }
            return(player);
        }